Project

General

Profile

« Previous | Next » 

Revision 51516

using dsm_datasources instead of datasources table, fixed datasource data migration rules for languages and od_contenttypes

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/doaj_journals/xslt/doaj_journals_2_db.xslt
12 12

  
13 13
	<xsl:template match="/">
14 14

  
15
		<record
16
		>
15
		<record>
17 16

  
18 17
			<xsl:copy-of select=".//*[local-name()='header']"/>
19 18
			<metadata>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/journaltitles2db.xsl
7 7
	<xsl:param name="namespacePrefix"/>
8 8

  
9 9
	<xsl:template match="/">
10
		<record
11
		>
10
		<record>
12 11

  
13 12
			<xsl:copy-of select=".//*[local-name()='header']"/>
14 13
			<metadata>
15 14
				<xsl:variable name="rid" select="normalize-space(//column[./@name='ISSN'])"/>
16 15
				<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
17 16
				<xsl:variable name="ISSNNS" select="stringUtils:replace($rid,'-','')"/>
18
				<xsl:variable name="oName" select="normalize-space(//column[./@name='Title'])"/>
19
				<xsl:variable name="organizationId"
20
				              select="translate(concat($namespacePrefix, '::', $oName), ' ', '_')"/>
17

  
21 18
				<ROWS>
22
					<ROW table="datasources">
19
					<ROW table="dsm_datasources">
23 20
						<FIELD name="id">
24 21
							<xsl:value-of select="$datasourceId"/>
25 22
						</FIELD>
26
						<FIELD name="_dnet_resource_identifier_">
27
							<xsl:value-of select="$datasourceId"/>
28
						</FIELD>
29 23
						<FIELD name="officialname">
30 24
							<xsl:value-of select="normalize-space(//column[./@name='Title'])"/>
31 25
						</FIELD>
......
35 29
						<FIELD name="od_contenttypes">
36 30
							<xsl:value-of select="string('Journal articles')"/>
37 31
						</FIELD>
38
						<FIELD name="od_languages">
32
						<FIELD name="languages">
39 33
							<xsl:value-of select="normalize-space(//column[./@name='Language'])"/>
40 34
						</FIELD>
41 35
						<FIELD name="issn">
......
53 47
						<FIELD name="namespaceprefix">
54 48
							<xsl:value-of select="concat('ojs_', $ISSNNS)"/>
55 49
						</FIELD>
56
						<FIELD name="datasourceclass">pubsrepository::journal</FIELD>
50
						<FIELD name="typology">pubsrepository::journal</FIELD>
57 51
						<FIELD name="collectedfrom">
58 52
							<xsl:value-of select="$parentDatasourceId"/>
59 53
						</FIELD>
60
						<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
61
						<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
54
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
62 55
					</ROW>
63 56
				</ROWS>
64 57
			</metadata>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/opendoar_2_db.xsl
35 35

  
36 36
				<xsl:variable name="contenttypes">
37 37
					<xsl:for-each select=".//contentType">
38
						<xsl:if test="position() &gt; 1">-</xsl:if>
38
						<xsl:if test="position() &gt; 1"> - </xsl:if>
39 39
						<xsl:value-of select="."/>
40 40
					</xsl:for-each>
41 41
				</xsl:variable>
42 42
				<xsl:variable name="languages">
43 43
					<xsl:for-each select=".//lName">
44
						<xsl:if test="position() &gt; 1">,</xsl:if>
44
						<xsl:if test="position() &gt; 1">, </xsl:if>
45 45
						<xsl:value-of select="."/>
46 46
					</xsl:for-each>
47 47
				</xsl:variable>
48 48

  
49 49
				<xsl:variable name="subjects">
50 50
					<xsl:for-each select=".//clTitle">
51
						<xsl:if test="position() &gt; 1">,</xsl:if>
51
						<xsl:if test="position() &gt; 1">, </xsl:if>
52 52
						<xsl:value-of select="concat('&quot;', ., '&quot;')"/>
53 53
					</xsl:for-each>
54 54
				</xsl:variable>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/doaj2db.xsl
32 32
			<metadata>
33 33
				<xsl:variable name="datasourceId" select="concat($namespacePrefix, '::', $rid)"/>
34 34
				<xsl:variable name="ISSNNS" select="stringUtils:replace($rid,'-','')"/>
35
				<xsl:variable name="oName" select="normalize-space(//column[./@name='Journal title'])"/>
36
				<xsl:variable name="organizationId"
37
				              select="translate(concat($namespacePrefix, '::', $oName), ' ', '_')"/>
38 35
				<ROWS>
39
					<ROW table="datasources">
36
					<ROW table="dsm_datasources">
40 37
						<FIELD name="id">
41 38
							<xsl:value-of select="$datasourceId"/>
42 39
						</FIELD>
43
						<FIELD name="_dnet_resource_identifier_">
44
							<xsl:value-of select="$datasourceId"/>
45
						</FIELD>
46 40
						<FIELD name="officialname">
47 41
							<xsl:value-of select="normalize-space(//column[./@name='Journal title'])"/>
48 42
						</FIELD>
......
64 58
						<FIELD name="namespaceprefix">
65 59
							<xsl:value-of select="concat('doaj', $ISSNNS)"/>
66 60
						</FIELD>
67
						<FIELD name="datasourceclass">pubsrepository::journal</FIELD>
61
						<FIELD name="typology">pubsrepository::journal</FIELD>
68 62
						<FIELD name="collectedfrom">
69 63
							<xsl:value-of select="$parentDatasourceId"/>
70 64
						</FIELD>
71
						<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
72
						<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
65
						<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
73 66
					</ROW>
74 67
				</ROWS>
75 68
			</metadata>
......
77 70
	</xsl:template>
78 71

  
79 72

  
80
</xsl:stylesheet>
73
</xsl:stylesheet>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt/irdb2db.xsl
18 18
						<xsl:variable name="namespacePrefix" select='format-number($rid, "00000")'/>
19 19

  
20 20
						<ROWS>
21
							<ROW table="datasources">
21
							<ROW table="dsm_datasources">
22 22
								<FIELD name="id">
23 23
									<xsl:value-of select="$datasourceId"/>
24 24
								</FIELD>
25
								<FIELD name="_dnet_resource_identifier_">
26
									<xsl:value-of select="$datasourceId"/>
27
								</FIELD>
28 25
								<FIELD name="officialname">
29 26
									<xsl:value-of select="$oName"/>
30 27
								</FIELD>
......
40 37
								<FIELD name="namespaceprefix">
41 38
									<xsl:value-of select="concat('irdb___',$namespacePrefix)"/>
42 39
								</FIELD>
43
								<FIELD name="datasourceclass">pubsrepository::journal</FIELD>
40
								<FIELD name="typology">pubsrepository::journal</FIELD>
44 41
								<FIELD name="collectedfrom">
45 42
									<xsl:value-of select="$parentDatasourceId"/>
46 43
								</FIELD>
47
								<FIELD name="provenanceActionClass">sysimport:crosswalk:entityregistry</FIELD>
48
								<FIELD name="provenanceActionScheme">dnet:provenanceActions</FIELD>
44
								<FIELD name="provenanceaction">sysimport:crosswalk:entityregistry</FIELD>
49 45
							</ROW>
50 46
						</ROWS>
51 47
					</metadata>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/patch-db/migrate_dsm.sql
44 44
	d.longitude, 
45 45
	d.timezone, 
46 46
	d.namespaceprefix as namespaceprefix,
47
	ARRAY(select trim(s) from unnest(string_to_array(d.od_languages, ',')) as s) as languages,
48
	ARRAY(select trim(s) from unnest(string_to_array(d.od_contenttypes, '-')) as s) as od_contenttypes,
47
	d.od_languages as languages,
48
	d.od_contenttypes,
49 49
	d.collectedfrom,
50 50
	d.dateofvalidation,
51 51
	d.datasourceclass as typology,

Also available in: Unified diff