Project

General

Profile

« Previous | Next » 

Revision 49055

XSLTs for pangaea removed from the datacite folder.
They must be only in their dedicate folder of the classpath.
For the pangaea by project, the format of the id slightly changed and the mappings have been changed accordingly

View differences:

modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/dataRepositoryByProject/xsl/DatasetfromPangaeaTransform.xsl
24 24

  
25 25
		<xsl:variable name="dataset_identifier">
26 26
			<xsl:value-of
27
					select="stringUtils:substringAfter(//md:citation/md:URI,'doi:')"/>
27
					select="//md:citation/md:URI"/>
28 28
		</xsl:variable>
29 29
		<xsl:variable name="openaire_dataset_identifier">
30 30
			<xsl:value-of
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/dataRepositoryByProject/xsl/PublicationFromPangaeatransform.xsl
17 17
	<xsl:template match="/">
18 18
		<xsl:variable name="identifier">
19 19
			<xsl:value-of
20
					select="stringUtils:substringAfter(//md:citation/md:URI,'doi:')"/>
20
					select="//md:citation/md:URI"/>
21 21
		</xsl:variable>
22 22
		<xsl:variable name="identifier_datacite">
23 23
			<xsl:value-of select="oai:record/oai:header/dri:objIdentifier"/>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/dataRepositoryByProject/xsl/DatasetsFromPangaeaIngestion.xsl
17 17
	<xsl:template match="/">
18 18
		<xsl:variable name="identifier">
19 19
			<xsl:value-of
20
					select="stringUtils:substringAfter(/*[local-name()='datasetsRecord']/*[local-name()='metadata']/*[local-name()='MetaData']/*[local-name()='citation']/*[local-name()='URI'],'doi:')"
20
					select="/*[local-name()='datasetsRecord']/*[local-name()='metadata']/*[local-name()='MetaData']/*[local-name()='citation']/*[local-name()='URI']"
21 21
			/>
22 22
		</xsl:variable>
23 23
		<oai:record>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt-datacite/DatasetfromPangaeaTransform.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:oai="http://www.openarchives.org/OAI/2.0/"
4
                xmlns:datetime="http://exslt.org/dates-and-times"
5
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
6
                xmlns:md="http://www.pangaea.de/MetaData"
7
                xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf"
8
                xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
9
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
10
                version="1.0"
11
                exclude-result-prefixes="xsl dnet oaa fn stringUtils datetime">
12
	<xsl:param name="namespacePrefix"/>
13
	<xsl:param name="dataSourceId"/>
14
	<xsl:param name="parentDatasourceId"/>
15
	<xsl:param name="dataprovider_name"/>
16
	<xsl:param name="dataprovider_id"/>
17

  
18
	<xsl:template match="/">
19

  
20

  
21
		<xsl:variable name="identifier_datacite">
22
			<xsl:value-of select="oai:record/oai:header/dri:objIdentifier"/>
23
		</xsl:variable>
24

  
25
		<xsl:variable name="dataset_identifier">
26
			<xsl:value-of
27
					select="stringUtils:substringAfter(//md:citation/md:URI,'doi:')"/>
28
		</xsl:variable>
29
		<xsl:variable name="openaire_dataset_identifier">
30
			<xsl:value-of
31
					select="concat($namespacePrefix,'::', dnet:md5($dataset_identifier))"/>
32
		</xsl:variable>
33

  
34
		<xsl:variable name="parentURI">
35
			<xsl:value-of select="//md:citation/md:parentURI"/>
36
		</xsl:variable>
37

  
38
		<xsl:call-template name="CreateRecord">
39
			<xsl:with-param name="openaire_dataset_identifier" select="$openaire_dataset_identifier"/>
40
			<xsl:with-param name="dataset_identifier" select="$dataset_identifier"/>
41
			<xsl:with-param name="parent_uri" select="$parentURI"/>
42
		</xsl:call-template>
43
	</xsl:template>
44

  
45

  
46
	<xsl:template name="CreateRecord">
47
		<xsl:param name="openaire_dataset_identifier"/>
48
		<xsl:param name="dataset_identifier"/>
49
		<xsl:param name="parent_uri"/>
50
		<oai:record>
51
			<oai:header>
52
				<dri:objIdentifier>
53
					<xsl:value-of select="$openaire_dataset_identifier"/>
54
				</dri:objIdentifier>
55
				<dri:recordIdentifier>
56
					<xsl:value-of select="$dataset_identifier"/>
57
				</dri:recordIdentifier>
58
				<dri:dateOfCollection>
59
					<xsl:value-of select="datetime:dateTime()"/>
60
				</dri:dateOfCollection>
61
				<dri:repositoryId>
62
					<xsl:value-of select="$dataprovider_id"/>
63
				</dri:repositoryId>
64
				<oaf:datasourceprefix>
65
					<xsl:value-of select="$namespacePrefix"/>
66
				</oaf:datasourceprefix>
67
			</oai:header>
68
			<oai:metadata>
69
				<resource
70
						xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
71
						xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd"
72
						xmlns="http://datacite.org/schema/kernel-3">
73
					<identifier identifierType="DOI">
74
						<xsl:value-of
75
								select="$dataset_identifier"/>
76
					</identifier>
77
					<creators>
78
						<xsl:for-each select="//md:citation/md:author">
79
							<creator>
80
								<creatorName>
81
									<xsl:value-of select="concat(./md:firstName, ' ', ./md:lastName)"/>
82
								</creatorName>
83
								<nameIdentifier schemeURI="http://www.pangaea.de"
84
								                nameIdentifierScheme="PANGAEA">
85
									<xsl:value-of select="./@id"/>
86
								</nameIdentifier>
87

  
88
							</creator>
89
						</xsl:for-each>
90
					</creators>
91
					<titles>
92
						<xsl:for-each select="//md:citation/md:title">
93
							<title xml:lang="en-us">
94
								<xsl:value-of select="."/>
95
							</title>
96
						</xsl:for-each>
97
					</titles>
98
					<publisher>PANGAEA</publisher>
99
					<publicationYear>
100
						<xsl:value-of select="//md:citation/md:year"/>
101
					</publicationYear>
102
					<resourceType resourceTypeGeneral="Dataset"/>
103
					<xsl:variable name="description">
104
						<xsl:value-of select="//md:citation/md:abstract"/>
105
					</xsl:variable>
106
					<xsl:if test="$description">
107
						<descriptions>
108
							<description descriptionType="Abstract">
109
								<xsl:value-of select="$description"/>
110
							</description>
111
						</descriptions>
112
					</xsl:if>
113
					<rights>info:eu-repo/semantics/openAccess</rights>
114
					<contributors>
115
						<contributor contributorType="Funder">
116
							<contributorName>European Commission</contributorName>
117
							<nameIdentifier nameIdentifierScheme="info">
118
								<xsl:value-of
119
										select="//oaf:projectid"/>
120
							</nameIdentifier>
121
						</contributor>
122
					</contributors>
123
				</resource>
124
				<xsl:variable name="journalName">
125
					<xsl:value-of select="//*[local-name() ='journal']/@name"/>
126
				</xsl:variable>
127
				<xsl:variable name="journalISSN">
128
					<xsl:value-of select="//*[local-name() ='journal']/@issn"/>
129
				</xsl:variable>
130
				<xsl:variable name="journalDSId">
131
					<xsl:value-of select="//*[local-name() ='journal']/@datasourceid"/>
132
				</xsl:variable>
133

  
134
				<xsl:choose>
135
					<xsl:when test="string-length($journalISSN) &gt; 0">
136
						<oaf:journal issn="{$journalISSN}" eissn="">
137
							<xsl:value-of select="$journalName"/>
138
						</oaf:journal>
139
						<oaf:hostedBy>
140
							<xsl:attribute name="id">
141
								<xsl:value-of select="$journalDSId"/>
142
							</xsl:attribute>
143
							<xsl:attribute name="name">
144
								<xsl:value-of select="$journalName"/>
145
							</xsl:attribute>
146
						</oaf:hostedBy>
147
					</xsl:when>
148
					<xsl:otherwise>
149
						<oaf:hostedBy
150
								id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18"
151
								name="Unknown Repository"/>
152
					</xsl:otherwise>
153
				</xsl:choose>
154
				<xsl:for-each select="//md:citation/md:supplementTo/@id">
155
					<xsl:variable name="publicationID">
156
						<xsl:value-of select="."/>
157
					</xsl:variable>
158
					<xsl:choose>
159
						<xsl:when test="string-length($publicationID) &gt; 0">
160
							<oaf:relatedPublication>
161
								<xsl:attribute name="id">
162
									<xsl:value-of
163
											select="concat($namespacePrefix,'::', dnet:md5($publicationID))"/>
164
								</xsl:attribute>
165
							</oaf:relatedPublication>
166
						</xsl:when>
167
					</xsl:choose>
168
				</xsl:for-each>
169

  
170
				<xsl:choose>
171
					<xsl:when test="string-length($parent_uri) &gt; 0">
172
						<xsl:variable name="dataset_relate_ID">
173
							<xsl:value-of select="stringUtils:substringAfter($parent_uri,'doi:')"/>
174
						</xsl:variable>
175
						<xsl:choose>
176
							<xsl:when test="string-length($dataset_relate_ID) &gt; 0">
177
								<oaf:relatedDataSet>
178
									<xsl:attribute name="id">
179
										<xsl:value-of
180
												select="concat($namespacePrefix,'::', dnet:md5($dataset_relate_ID))"/>
181
									</xsl:attribute>
182
								</oaf:relatedDataSet>
183
							</xsl:when>
184
						</xsl:choose>
185

  
186
					</xsl:when>
187
				</xsl:choose>
188

  
189
				<oaf:about>
190
					<oaf:datainfo>
191
						<oaf:inferred>false</oaf:inferred>
192
						<oaf:deletedbyinference>false</oaf:deletedbyinference>
193
						<oaf:trust>0.9</oaf:trust>
194
						<oaf:inferenceprovenance/>
195
						<oaf:provenanceaction classid="sysimport:crosswalk:datasetarchive"
196
						                      classname="sysimport:crosswalk:datasetarchive"
197
						                      schemeid="dnet:provenanceActions"
198
						                      schemename="dnet:provenanceActions"/>
199
					</oaf:datainfo>
200
				</oaf:about>
201
			</oai:metadata>
202
		</oai:record>
203
	</xsl:template>
204
</xsl:stylesheet>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt-datacite/PublicationFromPangaeatransform.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
3
                xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dr="http://www.driver-repository.eu/namespace/dr"
4
                xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:datetime="http://exslt.org/dates-and-times"
5
                xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:md="http://www.pangaea.de/MetaData"
6
                xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf"
7
                xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
8
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
9
                version="1.0"
10
                exclude-result-prefixes="xsl dnet oaa fn stringUtils datetime">
11

  
12
	<xsl:param name="namespacePrefix"/>
13
	<xsl:param name="dataprovider_id"/>
14
	<xsl:param name="parentDatasourceId"/>
15
	<xsl:param name="dataprovider_name"/>
16

  
17
	<xsl:template match="/">
18
		<xsl:variable name="identifier">
19
			<xsl:value-of
20
					select="stringUtils:substringAfter(//md:citation/md:URI,'doi:')"/>
21
		</xsl:variable>
22
		<xsl:variable name="identifier_datacite">
23
			<xsl:value-of select="oai:record/oai:header/dri:objIdentifier"/>
24
		</xsl:variable>
25
		<publications>
26
			<xsl:for-each select="//md:citation/md:supplementTo">
27
				<xsl:variable name="pub_identifier">
28
					<xsl:value-of select="./@id"/>
29
				</xsl:variable>
30
				<xsl:choose>
31
					<xsl:when test="string-length($pub_identifier)">
32
						<xsl:call-template name="GeneratePublication">
33
							<xsl:with-param name="pub_identifier" select="$pub_identifier"/>
34
						</xsl:call-template>
35
					</xsl:when>
36
				</xsl:choose>
37
			</xsl:for-each>
38
		</publications>
39
	</xsl:template>
40
	<xsl:template name="GeneratePublication">
41
		<xsl:param name="pub_identifier"/>
42
		<publication>
43
			<oai:record>
44
				<oai:header>
45
					<dri:objIdentifier>
46
						<xsl:value-of
47
								select="concat($namespacePrefix,'::', dnet:md5($pub_identifier))"/>
48
					</dri:objIdentifier>
49
					<dri:recordIdentifier>
50
						<xsl:value-of select="$pub_identifier"/>
51
					</dri:recordIdentifier>
52
					<dri:dateOfCollection>
53
						<xsl:value-of select="datetime:dateTime()"/>
54
					</dri:dateOfCollection>
55
					<dri:repositoryId>
56
						<xsl:value-of select="$dataprovider_id"/>
57
					</dri:repositoryId>
58
					<oaf:datasourceprefix>
59
						<xsl:value-of select="$namespacePrefix"/>
60
					</oaf:datasourceprefix>
61
				</oai:header>
62
				<oai:metadata>
63
					<dc:identifier>
64
						<xsl:value-of select="$pub_identifier"/>
65
					</dc:identifier>
66
					<xsl:variable name="publicationDOI">
67
						<xsl:value-of select="./md:URI"/>
68
					</xsl:variable>
69
					<xsl:choose>
70
						<xsl:when test="string-length($publicationDOI) &gt; 0">
71
							<dc:identifier>
72
								<xsl:value-of select="$publicationDOI"/>
73
							</dc:identifier>
74
						</xsl:when>
75
					</xsl:choose>
76

  
77
					<dc:title>
78
						<xsl:value-of select=".//md:title"/>
79
					</dc:title>
80
					<xsl:for-each select=".//md:author">
81
						<dc:creator>
82
							<xsl:value-of select="concat(./md:lastName,' ', md:firstName)"/>
83
						</dc:creator>
84
					</xsl:for-each>
85
					<dc:source>
86
						<xsl:value-of select="./md:source"/>
87
					</dc:source>
88
					<dr:CobjCategory>0000</dr:CobjCategory>
89
					<dc:language>und</dc:language>
90
					<oaf:journal>
91
						<xsl:value-of select="./md:source"/>
92
					</oaf:journal>
93
					<oaf:accessrights>UNKNOWN</oaf:accessrights>
94
					<xsl:variable name="projectId">
95
						<xsl:value-of select="normalize-space(//*[local-name() ='projectid'])"/>
96
					</xsl:variable>
97
					<xsl:choose>
98
						<xsl:when test="string-length($projectId) &gt; 0">
99
							<oaf:projectid>
100
								<xsl:value-of
101
										select="concat('corda_______::', stringUtils:substringAfterLast($projectId, '/'))"/>
102
							</oaf:projectid>
103
						</xsl:when>
104
					</xsl:choose>
105
					<xsl:variable name="journalName">
106
						<xsl:value-of select="//*[local-name() ='journal']/@name"/>
107
					</xsl:variable>
108
					<xsl:variable name="journalISSN">
109
						<xsl:value-of select="//*[local-name() ='journal']/@issn"/>
110
					</xsl:variable>
111
					<xsl:variable name="journalDSId">
112
						<xsl:value-of select="//*[local-name() ='journal']/@datasourceid"/>
113
					</xsl:variable>
114

  
115
					<xsl:choose>
116
						<xsl:when test="string-length($journalISSN) &gt; 0">
117
							<oaf:journal issn="{$journalISSN}" eissn="">
118
								<xsl:value-of select="$journalName"/>
119
							</oaf:journal>
120
							<oaf:hostedBy>
121
								<xsl:attribute name="id">
122
									<xsl:value-of
123
											select="$journalDSId"/>
124
								</xsl:attribute>
125
								<xsl:attribute name="name">
126
									<xsl:value-of
127
											select="$journalName"/>
128
								</xsl:attribute>
129
							</oaf:hostedBy>
130
						</xsl:when>
131
						<xsl:otherwise>
132
							<oaf:hostedBy
133
									id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18" name="Unknown Repository"/>
134
						</xsl:otherwise>
135
					</xsl:choose>
136

  
137

  
138
					<oaf:collectedFrom>
139
						<xsl:attribute name="id">
140
							<xsl:value-of select="$parentDatasourceId"/>
141
						</xsl:attribute>
142
						<xsl:attribute name="name">
143
							<xsl:value-of select="$dataprovider_name"/>
144
						</xsl:attribute>
145
					</oaf:collectedFrom>
146
					<oaf:about>
147
						<oaf:datainfo>
148
							<oaf:inferred>false</oaf:inferred>
149
							<oaf:deletedbyinference>false</oaf:deletedbyinference>
150
							<oaf:trust>0.9</oaf:trust>
151
							<oaf:inferenceprovenance/>
152
							<oaf:provenanceaction classid="sysimport:crosswalk:datasetarchive"
153
							                      classname="sysimport:crosswalk:datasetarchive" schemeid="dnet:provenanceActions"
154
							                      schemename="dnet:provenanceActions"/>
155
						</oaf:datainfo>
156
					</oaf:about>
157
				</oai:metadata>
158
			</oai:record>
159
		</publication>
160
	</xsl:template>
161
</xsl:stylesheet>
modules/dnet-openaireplus-workflows/trunk/src/main/resources/eu/dnetlib/msro/openaireplus/workflows/repo-hi/xslt-datacite/DatasetsFromPangaeaIngestion.xsl
1
<?xml version="1.0" encoding="UTF-8"?>
2
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:dc="http://purl.org/dc/elements/1.1/"
3
                xmlns:oai="http://www.openarchives.org/OAI/2.0/"
4
                xmlns:datetime="http://exslt.org/dates-and-times"
5
                xmlns:dri="http://www.driver-repository.eu/namespace/dri"
6
                xmlns:oaa="http://namespace.openaire.eu/oaa" xmlns:oaf="http://namespace.openaire.eu/oaf"
7
                xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:dnet="eu.dnetlib.data.transform.xml.AbstractDNetXsltFunctions"
8
                xmlns:stringUtils="org.apache.commons.lang.StringUtils"
9
                version="1.0"
10
                exclude-result-prefixes="xsl dc dnet oaa fn stringUtils datetime">
11

  
12
	<xsl:param name="namespacePrefix"/>
13
	<xsl:param name="dataSourceId"/>
14
	<xsl:param name="dataprovider_id"/>
15

  
16
	<xsl:template match="/">
17
		<xsl:variable name="identifier">
18
			<xsl:value-of
19
					select="stringUtils:substringAfter(/*[local-name()='datasetsRecord']/*[local-name()='metadata']/*[local-name()='MetaData']/*[local-name()='citation']/*[local-name()='URI'],'doi:')"
20
			/>
21
		</xsl:variable>
22
		<oai:record>
23
			<oai:header>
24
				<dri:objIdentifier>
25
					<xsl:value-of select="concat($namespacePrefix,'::', dnet:md5($identifier))"/>
26
				</dri:objIdentifier>
27
				<dri:recordIdentifier>
28
					<xsl:value-of select="$identifier"/>
29
				</dri:recordIdentifier>
30
				<dri:dateOfCollection>
31
					<xsl:value-of select="datetime:dateTime()"/>
32
				</dri:dateOfCollection>
33
				<dri:repositoryId>
34
					<xsl:value-of select="$dataSourceId"/>
35
				</dri:repositoryId>
36
				<oaf:datasourceprefix>
37
					<xsl:value-of select="$namespacePrefix"/>
38
				</oaf:datasourceprefix>
39
				<dri:repositoryId>
40
					<xsl:value-of select="$dataprovider_id"/>
41
				</dri:repositoryId>
42
			</oai:header>
43
			<oai:metadata>
44
				<xsl:copy-of select="."/>
45
			</oai:metadata>
46
		</oai:record>
47

  
48
	</xsl:template>
49
</xsl:stylesheet>

Also available in: Unified diff