Project

General

Profile

« Previous | Next » 

Revision 51591

fixing mappings for datasource subjects, languages, contenttypes

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/hbase/queryDatasources.sql
39 39
	d.namespaceprefix                                                                                          AS namespaceprefix,
40 40
	NULL                                                                                                       AS odnumberofitems,
41 41
	NULL                                                                                                       AS odnumberofitemsdate,
42
	(SELECT array_agg(s|| '###unknown@@@unknown@@@dnet:subjects@@@dnet:subjects') FROM UNNEST(d.subjects::text[]) AS s) AS subjects,
42

  
43
	(SELECT array_agg(s|| '###keywords@@@keywords@@@dnet:subject_classification_typologies@@@dnet:subject_classification_typologies')
44
		FROM UNNEST(
45
			ARRAY(
46
				SELECT trim(s)
47
        FROM unnest(string_to_array(d.subjects, '@@')) AS s)) AS s)                                   AS subjects,
48

  
43 49
	d.description                                                                                              AS description,
44 50
	NULL                                                                                                       AS odpolicies,
45
	d.languages                                                                                                AS odlanguages,
46
	d.od_contenttypes                                                                                          AS odcontenttypes,
51
	ARRAY(SELECT trim(s)
52
	      FROM unnest(string_to_array(d.languages, ',')) AS s)                                                 AS odlanguages,
53
	ARRAY(SELECT trim(s)
54
	      FROM unnest(string_to_array(d.od_contenttypes, '-')) AS s)                                           AS odcontenttypes,
47 55
	false                                                                                                      AS inferred,
48 56
	false                                                                                                      AS deletedbyinference,
49 57
	0.9                                                                                                        AS trust,
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/opendoar_2_db.xsl
48 48

  
49 49
				<xsl:variable name="subjects">
50 50
					<xsl:for-each select=".//clTitle">
51
						<xsl:if test="position() &gt; 1">, </xsl:if>
52
						<xsl:value-of select="concat('&quot;', ., '&quot;')"/>
51
						<xsl:if test="position() &gt; 1"> @@ </xsl:if>
52
						<xsl:value-of select="."/>
53 53
					</xsl:for-each>
54 54
				</xsl:variable>
55 55

  
......
103 103
						</FIELD>
104 104
						
105 105
						<FIELD name="subjects">
106
							<xsl:value-of select="concat('{', normalize-space($subjects), '}')"/>
106
							<xsl:value-of select="normalize-space($subjects)"/>
107 107
						</FIELD>
108 108
					</ROW>
109 109

  
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/re3data_2_db.xsl
9 9
	<xsl:variable name="dsId" select="concat($namespacePrefix, '::', normalize-space(.//*[local-name()='re3data.orgIdentifier']))"/>
10 10
	<xsl:variable name="subjects">
11 11
		<xsl:for-each select="//*[local-name()='subject']">
12
			<xsl:if test="position() &gt; 1">,</xsl:if>
13
			<xsl:value-of select="concat('&quot;', substring-after(., ' '), '&quot;')"/>
12
			<xsl:if test="position() &gt; 1"> @@ </xsl:if>
13
			<xsl:value-of select="substring-after(., ' ')"/>
14 14
		</xsl:for-each>
15 15
	</xsl:variable>
16 16

  
......
109 109
							<xsl:value-of select=".//*[local-name()='certificate']"/>
110 110
						</FIELD>
111 111
						<FIELD name="subjects">
112
							<xsl:value-of select="concat('{', normalize-space($subjects), '}')"/>
112
							<xsl:value-of select="normalize-space($subjects)"/>
113 113
						</FIELD>
114 114
					</ROW>
115 115

  

Also available in: Unified diff