1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="111abbda-35fe-4781-b1d5-12197f2a6783_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2020-07-13T19:44:22+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>xslt_cleaning_oaiOpenaire_datacite_ExchangeLandingpagePid</TITLE>
|
14
|
<CODE><![CDATA[ <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
|
15
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
16
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
17
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
18
|
xmlns:datacite="http://datacite.org/schema/kernel-4"
|
19
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
20
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
21
|
xmlns:oaire="http://namespace.openaire.eu/schema/oaire/"
|
22
|
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
23
|
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
|
24
|
extension-element-prefixes="TransformationFunction"
|
25
|
exclude-result-prefixes="TransformationFunction">
|
26
|
|
27
|
<xsl:param name="varOfficialName" />
|
28
|
<xsl:param name="varDsType" />
|
29
|
<xsl:param name="varDataSourceId" />
|
30
|
|
31
|
<xsl:param name="varFP7" select = "'corda_______::'"/>
|
32
|
<xsl:param name="varH2020" select = "'corda__h2020::'"/>
|
33
|
<xsl:param name="varAKA" select = "'aka_________::'"/>
|
34
|
<xsl:param name="varARC" select = "'arc_________::'"/>
|
35
|
<xsl:param name="varCONICYT" select = "'conicytf____::'"/>
|
36
|
<xsl:param name="varDFG" select = "'dfgf________::'"/>
|
37
|
<xsl:param name="varFCT" select = "'fct_________::'"/>
|
38
|
<xsl:param name="varFWF" select = "'fwf_________::'"/>
|
39
|
<xsl:param name="varHRZZ" select = "'irb_hr______::'"/> <!-- HRZZ not found -->
|
40
|
<xsl:param name="varMESTD" select = "'mestd_______::'"/>
|
41
|
<xsl:param name="varMZOS" select = "'irb_hr______::'"/>
|
42
|
<xsl:param name="varNHMRC" select = "'nhmrc_______::'"/>
|
43
|
<xsl:param name="varNIH" select = "'nih_________::'"/>
|
44
|
<xsl:param name="varNSF" select = "'nsf_________::'"/>
|
45
|
<xsl:param name="varNWO" select = "'nwo_________::'"/>
|
46
|
<xsl:param name="varRCUK" select = "'rcuk________::'"/>
|
47
|
<xsl:param name="varSFI" select ="'sfi_________::'"/>
|
48
|
<xsl:param name="varSGOV" select = "'sgov________::'"/> <!-- SGOV to be added, awaiting DOI from Pilar, found project ids not in CSV list? -->
|
49
|
<xsl:param name="varSNSF" select = "'snsf________::'"/>
|
50
|
<xsl:param name="varTARA" select = "'taraexp_____::'"/> <!-- TARA to be added, awaiting DOI from André -->
|
51
|
<xsl:param name="varTUBITAK" select = "'tubitakf____::'"/>
|
52
|
<xsl:param name="varWT" select = "'wt__________::'"/>
|
53
|
|
54
|
<xsl:param name="index" select="0"/>
|
55
|
<xsl:param name="transDate" select="current-dateTime()"/>
|
56
|
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
|
57
|
|
58
|
<!-- several different type statements in Refubium -->
|
59
|
<!-- toDo: apply priority levels -->
|
60
|
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType'][1]/@uri), 'TextTypologies')" />
|
61
|
<xsl:variable name="varSuperType" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
|
62
|
|
63
|
|
64
|
<xsl:template match="/">
|
65
|
<xsl:variable name="datasourcePrefix"
|
66
|
select="normalize-space(//oaf:datasourceprefix)" />
|
67
|
<xsl:call-template name="validRecord" />
|
68
|
</xsl:template>
|
69
|
|
70
|
<xsl:template name="terminate">
|
71
|
<xsl:message terminate="yes">
|
72
|
record is not compliant, transformation is interrupted.
|
73
|
</xsl:message>
|
74
|
</xsl:template>
|
75
|
|
76
|
<xsl:template name="validRecord">
|
77
|
<record>
|
78
|
<xsl:apply-templates select="//*[local-name() = 'header']" />
|
79
|
|
80
|
<metadata>
|
81
|
|
82
|
<!-- drop oaire resource -->
|
83
|
<!--
|
84
|
<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'resource']"/>
|
85
|
-->
|
86
|
|
87
|
<datacite:resource>
|
88
|
|
89
|
<!-- datacite:identifier -->
|
90
|
<xsl:choose>
|
91
|
|
92
|
<!-- cut off DOI resolver prefix to just get the number part -->
|
93
|
<xsl:when test="(//datacite:identifier, //datacite:alternateIdentifier)[@identifierType='DOI' or @alternateIdentifierType='DOI' or contains(., '://dx.doi.org/10.')]">
|
94
|
<datacite:identifier>
|
95
|
<xsl:attribute name="identifierType" select="'DOI'"/>
|
96
|
<xsl:value-of select="//datacite:identifier[@identifierType='DOI'][contains(., '://dx.doi.org/')]/substring-after(., '://dx.doi.org/'),
|
97
|
(//datacite:identifier, //datacite:alternateIdentifier)[@identifierType='DOI' or @alternateIdentifierType='DOI'][not(contains(., '://dx.doi.org/'))],
|
98
|
//datacite:identifier[contains(., '://dx.doi.org/10.')]/substring-after(., '://dx.doi.org/')" />
|
99
|
</datacite:identifier>
|
100
|
</xsl:when>
|
101
|
<xsl:when test="//datacite:identifier[lower-case(@identifierType)='handle'], //datacite:identifier[contains(., '://refubium.fu-berlin.de/handle/')]">
|
102
|
<datacite:identifier>
|
103
|
<xsl:attribute name="identifierType" select="'handle'"/>
|
104
|
<xsl:value-of select="//datacite:identifier[lower-case(@identifierType)='handle'][contains(., '://hdl.handle.net/')]/substring-after(., '://hdl.handle.net/'),
|
105
|
//datacite:identifier[lower-case(@identifierType)='handle'][contains(., 'info:hdl:')]/substring-after(., 'info:hdl:'),
|
106
|
//datacite:identifier[lower-case(@identifierType)='handle'][contains(., '/handle/')]/substring-after(., '/handle/'),
|
107
|
//datacite:identifier[contains(., '://refubium.fu-berlin.de/handle/')]/substring-after(., '/handle/'),
|
108
|
//datacite:identifier[lower-case(@identifierType)='handle'][not(contains(., '://hdl.handle.net/')) and not(contains(., 'info:hdl:')) and not(contains(., '/handle/'))]" />
|
109
|
</datacite:identifier>
|
110
|
</xsl:when>
|
111
|
|
112
|
<xsl:when test="//oaf:datasourceprefix = ('od______4225', 'r3110ae70d66') and not(//datacite:identifier[@identifierType='DOI'] and //datacite:identifier[@identifierType='URL'])">
|
113
|
<datacite:identifier>
|
114
|
<xsl:attribute name="identifierType" select="'URL'"/>
|
115
|
<xsl:value-of select="//datacite:identifier[@identifierType='URL']" />
|
116
|
</datacite:identifier>
|
117
|
</xsl:when>
|
118
|
|
119
|
</xsl:choose>
|
120
|
|
121
|
<!-- specifically for Rothamsted -->
|
122
|
|
123
|
<datacite:alternateIdentifiers>
|
124
|
|
125
|
<xsl:choose>
|
126
|
<xsl:when test="//oaf:datasourceprefix = 'od______4225'">
|
127
|
<datacite:alternateIdentifier>
|
128
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
129
|
<xsl:value-of select="concat('https://repository.rothamsted.ac.uk/item/', substring-after(//dri:recordIdentifier, 'oai:repository.rothamsted.ac.uk:'))"/>
|
130
|
</datacite:alternateIdentifier>
|
131
|
</xsl:when>
|
132
|
<xsl:when test="//oaf:datasourceprefix = 'od______1318'">
|
133
|
<datacite:alternateIdentifier>
|
134
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
135
|
<xsl:value-of select="concat('https://orbi.uliege.be/handle/', substring-after(//dri:recordIdentifier, 'oai:orbi.ulg.ac.be:'))"/>
|
136
|
</datacite:alternateIdentifier>
|
137
|
</xsl:when>
|
138
|
<xsl:when test="//oaf:datasourceprefix = 'od______1514'">
|
139
|
<datacite:alternateIdentifier>
|
140
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
141
|
<xsl:value-of select="concat('http://uvadoc.uva.es/handle/', substring-after(//datacite:identifier, 'http://uvadoc.uva.es/handle/'))"/>
|
142
|
</datacite:alternateIdentifier>
|
143
|
</xsl:when>
|
144
|
<xsl:when test="//oaf:datasourceprefix = 'od______1388'">
|
145
|
<datacite:alternateIdentifier>
|
146
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
147
|
<xsl:value-of select="concat('http://rabida.uhu.es/dspace/handle/', substring-after(//dri:recordIdentifier, 'oai:rabida.uhu.es:'))"/>
|
148
|
</datacite:alternateIdentifier>
|
149
|
</xsl:when>
|
150
|
<xsl:when test="//oaf:datasourceprefix = 'od______1472'">
|
151
|
<datacite:alternateIdentifier>
|
152
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
153
|
<xsl:value-of select="concat('https://gredos.usal.es/handle/', substring-after(//dri:recordIdentifier, 'oai:gredos.usal.es:'))"/>
|
154
|
</datacite:alternateIdentifier>
|
155
|
</xsl:when>
|
156
|
<xsl:when test="contains(//dri:recordIdentifier, 'refubium.fu-berlin.de') or contains(//dri:recordIdentifier, 'www.qeios.com') or //*[local-name() = 'baseURL' and .= 'http://radar.brookes.ac.uk/radar/oai']">
|
157
|
<datacite:alternateIdentifier>
|
158
|
<xsl:attribute name="alternateIdentifierType" select="'landingPage'"/>
|
159
|
<xsl:value-of select="//datacite:identifier[contains(., '://refubium.fu-berlin.de/') or contains(., '://www.qeios.com') or contains(., '://radar.brookes.ac.uk/radar/items/')]"/>
|
160
|
</datacite:alternateIdentifier>
|
161
|
</xsl:when>
|
162
|
</xsl:choose>
|
163
|
|
164
|
|
165
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)
|
166
|
[not($varCobjCategory = '0001' and ./@alternateIdentifierType = ('ISSN', 'EISSN'))]
|
167
|
[not($varCobjCategory = '0013' and ./@alternateIdentifierType = 'ISBN')]
|
168
|
[not(//oaf:datasourceprefix = 'od______4225' and ends-with(., 'pdf'))]
|
169
|
[not(//oaf:datasourceprefix = ('od______1562', 'od______4732'))]
|
170
|
[not(contains(//dri:recordIdentifier, 'www.qeios.com'))]
|
171
|
[not(//*[local-name() = 'baseURL' and . = 'http://radar.brookes.ac.uk/radar/oai'])]
|
172
|
[not(@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = ('doi', 'handle'))]">
|
173
|
<datacite:alternateIdentifier>
|
174
|
<xsl:attribute name="alternateIdentifierType" select="./@*[local-name()=('identifierType', 'alternateIdentifierType')]"/>
|
175
|
<xsl:value-of select="."/>
|
176
|
</datacite:alternateIdentifier>
|
177
|
<!--
|
178
|
<xsl:copy-of select="//datacite:alternateIdentifier[not($varCobjCategory = '0001' and ./@alternateIdentifierType = 'ISSN')][not(//oaf:datasourceprefix = 'od______4225' and ends-with(., 'pdf'))]" copy-namespaces="no"/>
|
179
|
<xsl:copy-of select="//datacite:identifier[not(//oaf:datasourceprefix = 'od______4225' and ends-with(., 'pdf'))]" copy-namespaces="no"/>
|
180
|
-->
|
181
|
</xsl:for-each>
|
182
|
<!-- DOI, handle moved to datacite:identifier
|
183
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[(contains(., '://dx.doi.org/10.')) or (@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'doi')][not(//oaf:datasourceprefix = ('od______1318'))]">
|
184
|
<datacite:alternateIdentifier>
|
185
|
<xsl:attribute name="alternateIdentifierType" select="'DOI'"/>
|
186
|
<xsl:value-of select=".[not(contains(., '://dx.doi.org/') or contains(., '://doi.org'))], .[contains(., '://dx.doi.org/') or contains(., '://doi.org')]/substring-after(., 'doi.org/')" />
|
187
|
</datacite:alternateIdentifier>
|
188
|
</xsl:for-each>
|
189
|
|
190
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'handle'][not(//oaf:datasourceprefix = ('od______1514', 'od______1318'))]">
|
191
|
<datacite:alternateIdentifier>
|
192
|
<xsl:attribute name="alternateIdentifierType" select="'handle'"/>
|
193
|
<xsl:value-of select=".[not(contains(., '://hdl.handle.net/'))], .[contains(., '://hdl.handle.net/')]/substring-after(., '://hdl.handle.net/')" />
|
194
|
</datacite:alternateIdentifier>
|
195
|
</xsl:for-each>
|
196
|
|
197
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'doi'][not(//oaf:datasourceprefix = ('od______1318', 'od______1514', 'od______1388', 'od______4225')) and not(contains(//dri:recordIdentifier, 'www.qeios.com')) and not(//*[local-name() = 'baseURL' and . = 'http://radar.brookes.ac.uk/radar/oai'])]">
|
198
|
<datacite:alternateIdentifier>
|
199
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
200
|
<xsl:value-of select=".[not(contains(., '://dx.doi.org/'))]/concat('http://dx.doi.org/', .), .[contains(., '://dx.doi.org/')]" />
|
201
|
</datacite:alternateIdentifier>
|
202
|
</xsl:for-each>
|
203
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'handle'][not(//oaf:datasourceprefix = ('od______1514', 'od______1318', 'od______1388', 'od______1472'))]">
|
204
|
<datacite:alternateIdentifier>
|
205
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
206
|
<xsl:value-of select=".[not(contains(., '://hdl.handle.net/'))]/concat('http://hdl.handle.net/', .), .[contains(., '://hdl.handle.net/')]" />
|
207
|
</datacite:alternateIdentifier>
|
208
|
</xsl:for-each>
|
209
|
-->
|
210
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'pmid']">
|
211
|
<!--
|
212
|
<datacite:alternateIdentifier>
|
213
|
<xsl:attribute name="alternateIdentifierType" select="'PMID'"/>
|
214
|
<xsl:value-of select="." />
|
215
|
</datacite:alternateIdentifier>
|
216
|
-->
|
217
|
<datacite:alternateIdentifier>
|
218
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
219
|
<xsl:value-of select="concat('https://www.ncbi.nlm.nih.gov/pubmed/', .)" />
|
220
|
</datacite:alternateIdentifier>
|
221
|
</xsl:for-each>
|
222
|
|
223
|
<!--
|
224
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = 'handle'][//oaf:datasourceprefix = 'od______1514']">
|
225
|
<datacite:alternateIdentifier>
|
226
|
<xsl:attribute name="alternateIdentifierType" select="'handle'"/>
|
227
|
<xsl:value-of select="substring-after(., '://uvadoc.uva.es/handle/')" />
|
228
|
</datacite:alternateIdentifier>
|
229
|
<datacite:alternateIdentifier>
|
230
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
231
|
<xsl:value-of select="concat('http://hdl.handle.net/', substring-after(., '://uvadoc.uva.es/handle/'))" />
|
232
|
</datacite:alternateIdentifier>
|
233
|
</xsl:for-each>
|
234
|
-->
|
235
|
|
236
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = ('handle')][//oaf:datasourceprefix = 'od______1318']">
|
237
|
<!-- [@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = ('handle', 'doi')] -->
|
238
|
<!--
|
239
|
<datacite:alternateIdentifier>
|
240
|
<xsl:attribute name="alternateIdentifierType" select="'handle'"/>
|
241
|
<xsl:value-of select="substring-after(., 'info:hdl:')" />
|
242
|
</datacite:alternateIdentifier>
|
243
|
|
244
|
<datacite:alternateIdentifier>
|
245
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
246
|
<xsl:value-of select="concat('https://orbi.uliege.be/handle/', substring-after(., 'info:hdl:'))" />
|
247
|
</datacite:alternateIdentifier>
|
248
|
<datacite:alternateIdentifier>
|
249
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
250
|
<xsl:value-of select="concat('http://hdl.handle.net/', substring-after(., 'info:hdl:'))" />
|
251
|
</datacite:alternateIdentifier>
|
252
|
-->
|
253
|
|
254
|
</xsl:for-each>
|
255
|
<xsl:for-each select="distinct-values(((//datacite:alternateIdentifier, //datacite:identifier)[@*[local-name()=('identifierType', 'alternateIdentifierType')]/lower-case(.) = ('doi')][//oaf:datasourceprefix = 'od______1318']))">
|
256
|
<datacite:alternateIdentifier>
|
257
|
<xsl:attribute name="alternateIdentifierType" select="'DOI'"/>
|
258
|
<xsl:value-of select="substring-after(., 'info:doi:')" />
|
259
|
</datacite:alternateIdentifier>
|
260
|
<datacite:alternateIdentifier>
|
261
|
<xsl:attribute name="alternateIdentifierType" select="'URL'"/>
|
262
|
<xsl:value-of select="concat('http://dx.doi.org/', substring-after(., 'info:doi:'))" />
|
263
|
</datacite:alternateIdentifier>
|
264
|
|
265
|
</xsl:for-each>
|
266
|
|
267
|
|
268
|
</datacite:alternateIdentifiers>
|
269
|
|
270
|
<!--
|
271
|
[$varCobjCategory = '0001' and ./@alternateIdentifierType = 'ISSN'][1]">
|
272
|
-->
|
273
|
<datacite:relatedIdentifiers>
|
274
|
<!--
|
275
|
<xsl:for-each select="//datacite:relatedIdentifier">
|
276
|
<datacite:relatedIdentifier>
|
277
|
<xsl:attribute name="relatedIdentifierType" select="./@relatedIdentifierType"/>
|
278
|
<xsl:attribute name="relationType" select="./@relationType"/>
|
279
|
<xsl:value-of select="." />
|
280
|
</datacite:relatedIdentifier>
|
281
|
</xsl:for-each>
|
282
|
|
283
|
<xsl:copy-of select="//*[local-name() = 'relatedIdentifier']" copy-namespaces="no"/>
|
284
|
-->
|
285
|
<xsl:copy-of select="//datacite:relatedIdentifier" copy-namespaces="no"/>
|
286
|
|
287
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)
|
288
|
[$varCobjCategory = '0001' and ./@alternateIdentifierType = ('ISSN', 'EISSN')]">
|
289
|
<datacite:relatedIdentifier>
|
290
|
<xsl:attribute name="relatedIdentifierType" select="./@alternateIdentifierType"/>
|
291
|
<xsl:attribute name="relationType" select="'isPartOf'"/>
|
292
|
<xsl:value-of select="concat(substring(., 1, 4), '-', substring(., string-length(.)-3, 4))" />
|
293
|
</datacite:relatedIdentifier>
|
294
|
</xsl:for-each>
|
295
|
<xsl:for-each select="(//datacite:alternateIdentifier, //datacite:identifier)
|
296
|
[$varCobjCategory = '0013' and ./@alternateIdentifierType = 'ISBN']">
|
297
|
<datacite:relatedIdentifier>
|
298
|
<xsl:attribute name="relatedIdentifierType" select="'ISBN'"/>
|
299
|
<xsl:attribute name="relationType" select="'isPartOf'"/>
|
300
|
<xsl:value-of select="." />
|
301
|
</datacite:relatedIdentifier>
|
302
|
</xsl:for-each>
|
303
|
</datacite:relatedIdentifiers>
|
304
|
|
305
|
|
306
|
<xsl:for-each select="//dc:description">
|
307
|
<datacite:description>
|
308
|
<xsl:attribute name="descriptionType" select="'Abstract'"/>
|
309
|
<xsl:value-of select="."/>
|
310
|
</datacite:description>
|
311
|
</xsl:for-each>
|
312
|
<xsl:for-each select="//dc:language">
|
313
|
<datacite:language>
|
314
|
<xsl:value-of select="TransformationFunction:convertString($tf, ., 'Languages')"/>
|
315
|
</datacite:language>
|
316
|
</xsl:for-each>
|
317
|
<xsl:if test="//dc:publisher">
|
318
|
<datacite:publisher>
|
319
|
<xsl:value-of select="//dc:publisher"/>
|
320
|
</datacite:publisher>
|
321
|
</xsl:if>
|
322
|
|
323
|
<!-- consider converting COAR version URIs -->
|
324
|
<xsl:if test="//oaire:version">
|
325
|
<datacite:version>
|
326
|
<xsl:value-of select="//oaire:version"/>
|
327
|
</datacite:version>
|
328
|
</xsl:if>
|
329
|
|
330
|
<!-- format -->
|
331
|
<xsl:for-each select="//dc:format">
|
332
|
<datacite:format>
|
333
|
<xsl:value-of select="."/>
|
334
|
</datacite:format>
|
335
|
</xsl:for-each>
|
336
|
|
337
|
<!--
|
338
|
<xsl:copy-of select="//oaire:resource/datacite:*[not(local-name() = 'alternateIdentifiers')]" copy-namespaces="no" />
|
339
|
-->
|
340
|
<xsl:apply-templates select="(//*[local-name()='resource'], //*[local-name() = 'oai_openaire'])/datacite:*[not(local-name() = ('identifier', 'alternateIdentifiers', 'alternateIdentifier', 'relatedIdentifiers', 'relatedIdentifier'))]"/>
|
341
|
|
342
|
<xsl:apply-templates select="//*[local-name()='resource']/titles[//*[contains(., 'radar.brookes.ac.uk')]]"/>
|
343
|
<xsl:copy-of select="//*[local-name()='resource']//*[local-name() = 'title'][//*[contains(., 'radar.brookes.ac.uk')]]" copy-namespaces="no"/>
|
344
|
|
345
|
</datacite:resource>
|
346
|
<!--
|
347
|
<xsl:if test="//oaf:datasourceprefix = 'od______4225'">
|
348
|
<oaf:identifier>
|
349
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
350
|
<xsl:value-of select="concat('https://repository.rothamsted.ac.uk/item/', substring-after(//dri:recordIdentifier, 'oai:repository.rothamsted.ac.uk:'))"/>
|
351
|
</oaf:identifier>
|
352
|
</xsl:if>
|
353
|
|
354
|
<xsl:if test="//oaf:datasourceprefix = 'od______1318'">
|
355
|
<oaf:identifier>
|
356
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
357
|
<xsl:value-of select="concat('https://orbi.uliege.be/handle/', substring-after(//dri:recordIdentifier, 'oai:orbi.ulg.ac.be:'))"/>
|
358
|
</oaf:identifier>
|
359
|
</xsl:if>
|
360
|
|
361
|
<xsl:if test="//oaf:datasourceprefix = 'od______1514'">
|
362
|
<oaf:identifier>
|
363
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
364
|
<xsl:value-of select="concat('http://uvadoc.uva.es/handle/', substring-after(//datacite:identifier, 'http://uvadoc.uva.es/handle/'))"/>
|
365
|
</oaf:identifier>
|
366
|
</xsl:if>
|
367
|
|
368
|
<xsl:if test="//oaf:datasourceprefix = 'od______1388'">
|
369
|
<oaf:identifier>
|
370
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
371
|
<xsl:value-of select="concat('http://rabida.uhu.es/dspace/handle/', substring-after(//dri:recordIdentifier, 'oai:rabida.uhu.es:'))"/>
|
372
|
</oaf:identifier>
|
373
|
</xsl:if>
|
374
|
|
375
|
<xsl:if test="//oaf:datasourceprefix = 'od______1472'">
|
376
|
<oaf:identifier>
|
377
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
378
|
<xsl:value-of select="concat('https://gredos.usal.es/handle/', substring-after(//dri:recordIdentifier, 'oai:gredos.usal.es:'))"/>
|
379
|
</oaf:identifier>
|
380
|
</xsl:if>
|
381
|
|
382
|
<xsl:if test="contains(//dri:recordIdentifier, 'refubium.fu-berlin.de') or contains(//dri:recordIdentifier, 'www.qeios.com') or //*[local-name() = 'baseURL' and .= 'http://radar.brookes.ac.uk/radar/oai']">
|
383
|
<oaf:identifier>
|
384
|
<xsl:attribute name="identifierType" select="'landingPage'"/>
|
385
|
<xsl:value-of select="//datacite:identifier[contains(., '://refubium.fu-berlin.de/') or contains(., '://www.qeios.com') or contains(., '://radar.brookes.ac.uk/radar/items/')]"/>
|
386
|
</oaf:identifier>
|
387
|
</xsl:if>
|
388
|
|
389
|
|
390
|
<xsl:choose>
|
391
|
<xsl:when test="//datacite:identifier[lower-case(./@identifierType) = 'doi'][contains(., '://dx.doi.org/')]">
|
392
|
<oaf:identifier>
|
393
|
<xsl:attribute name="identifierType" select="'doi'"/>
|
394
|
<xsl:value-of select="//datacite:identifier[lower-case(./@identifierType) = 'doi'][contains(., '://dx.doi.org/')]/substring-after(., '://dx.doi.org/')"/>
|
395
|
</oaf:identifier>
|
396
|
</xsl:when>
|
397
|
<xsl:when test="//datacite:identifier[lower-case(./@identifierType) = 'handle'][not(. = '123456789')][contains(., '://hdl.handle.net/')][not(//oaf:datasourceprefix = ('od______1388', 'od______1472'))]">
|
398
|
<oaf:identifier>
|
399
|
<xsl:attribute name="identifierType" select="'handle'"/>
|
400
|
<xsl:value-of select="//datacite:identifier[lower-case(./@identifierType) = 'handle'][not(. = '123456789')][contains(., '://hdl.handle.net/')]/substring-after(., '://hdl.handle.net/')"/>
|
401
|
</oaf:identifier>
|
402
|
</xsl:when>
|
403
|
</xsl:choose>
|
404
|
-->
|
405
|
|
406
|
<!--
|
407
|
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle'][not(. = '123456789')]">
|
408
|
<oaf:identifier>
|
409
|
<xsl:attribute name="identifierType">
|
410
|
<xsl:value-of select="'handle'"/>
|
411
|
</xsl:attribute>
|
412
|
<xsl:value-of select="."/>
|
413
|
</oaf:identifier>
|
414
|
</xsl:for-each>
|
415
|
|
416
|
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
417
|
<oaf:identifier>
|
418
|
<xsl:attribute name="identifierType" select="'doi'"/>
|
419
|
<xsl:if test="contains(., '://dx.doi.org/')">
|
420
|
<xsl:value-of select="substring-after(., '://dx.doi.org/')"/>
|
421
|
</xsl:if>
|
422
|
<xsl:if test="not(contains(., '://dx.doi.org/'))">
|
423
|
<xsl:value-of select="."/>
|
424
|
</xsl:if>
|
425
|
</oaf:identifier>
|
426
|
</xsl:for-each>
|
427
|
|
428
|
|
429
|
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URL'][not(ends-with(., '.pdf'))]">
|
430
|
<oaf:identifier>
|
431
|
<xsl:attribute name="identifierType" select="'URL'"/>
|
432
|
<xsl:value-of select="."/>
|
433
|
</oaf:identifier>
|
434
|
</xsl:for-each>
|
435
|
-->
|
436
|
|
437
|
<xsl:variable name='varEmbargoEndDate' select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/>
|
438
|
<xsl:if test="//*[local-name()='date']/@dateType='Available' and //*[local-name()='datasourceprefix']!='r33ffb097cef'">
|
439
|
<xsl:choose>
|
440
|
<xsl:when test="string-length($varEmbargoEndDate) > 0">
|
441
|
<oaf:embargoenddate>
|
442
|
<xsl:value-of select="$varEmbargoEndDate"/>
|
443
|
</oaf:embargoenddate>
|
444
|
</xsl:when>
|
445
|
<xsl:otherwise>
|
446
|
<xsl:call-template name="terminate"/>
|
447
|
</xsl:otherwise>
|
448
|
</xsl:choose>
|
449
|
</xsl:if>
|
450
|
|
451
|
<xsl:choose>
|
452
|
|
453
|
<xsl:when test="lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'literature', 'other research product')">
|
454
|
|
455
|
<dr:CobjCategory>
|
456
|
<!--
|
457
|
<xsl:attribute name="type" select="//*[local-name()='resourceType']/@resourceTypeGeneral"/>
|
458
|
<xsl:value-of select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@uri), 'TextTypologies')" />
|
459
|
-->
|
460
|
<xsl:attribute name="type" select="//oaf:datasourceprefix[. = '_______qeios' and contains(//dri:recordIdentifier, '/definition/')]/'other', //oaf:datasourceprefix[not(. = '_______qeios' and contains(//dri:recordIdentifier, '/definition/'))]/$varSuperType"/>
|
461
|
<xsl:value-of select="$varCobjCategory" />
|
462
|
</dr:CobjCategory>
|
463
|
|
464
|
</xsl:when>
|
465
|
<xsl:otherwise>
|
466
|
<xsl:call-template name="terminate"/>
|
467
|
</xsl:otherwise>
|
468
|
</xsl:choose>
|
469
|
|
470
|
<!-- review status -->
|
471
|
<!--
|
472
|
<xsl:variable name="varRefereed" select="for $i in (//*[local-name() = 'resource']/*[local-name() = ('resourceType', 'version')]/(., @uri))
|
473
|
return TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/>
|
474
|
-->
|
475
|
<xsl:variable name="varRefereedConvt" select="for $i in (//*[local-name()=('resourceType', 'version')]/(., @uri))
|
476
|
return TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/>
|
477
|
<xsl:variable name="varRefereedIdntf" select="//*[local-name()=('identifier', 'alternateIdentifier', 'file')][matches(lower-case(.), '.*([\s\-\.\\_/:]|%[2-7][0-9A-F])pre([\s\-\.\\_/:]|%[2-7][0-9A-F])?prints?([\s\-\.\\_/:%].*|$)')]/'0002' "/>
|
478
|
<xsl:variable name="varRefereedReltn" select="//*[local-name()='relatedIdentifier'][./@relationType/lower-case(.)='isreviewedby']/'0001' "/>
|
479
|
<xsl:variable name="varRefereedOther" select="(//*[local-name()=('citationTitle', 'publisher')][matches(lower-case(.), '.*[\s\-\.\\_/:%]pre[\s\-\.\\_/:%]?prints?([\s\-\.\\_/:%].*|$)')]/'0002',
|
480
|
//*[local-name()='description'][matches(lower-case(.), '^peer[\s\-\.\\_/:%]?reviewed$')]/'0001',
|
481
|
//*[local-name()='description'][matches(lower-case(.), '^pre[\s\-\.\\_/:%]?prints?$')]/'0002') "/>
|
482
|
<xsl:variable name="varRefereed" select="($varRefereedConvt, $varRefereedIdntf, $varRefereedReltn, $varRefereedOther)"/>
|
483
|
<xsl:choose>
|
484
|
<xsl:when test="count($varRefereed[. = '0001']) > 0">
|
485
|
<oaf:refereed>
|
486
|
<xsl:value-of select="'0001'"/>
|
487
|
</oaf:refereed>
|
488
|
</xsl:when>
|
489
|
<xsl:when test="count($varRefereed[. = '0002']) > 0">
|
490
|
<oaf:refereed>
|
491
|
<xsl:value-of select="'0002'"/>
|
492
|
</oaf:refereed>
|
493
|
</xsl:when>
|
494
|
</xsl:choose>
|
495
|
|
496
|
<oaf:dateAccepted>
|
497
|
<!--
|
498
|
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//datacite:dates/datacite:date[@dateType = 'Issued']), 'DateISO8601')"/>
|
499
|
-->
|
500
|
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//datacite:date[@dateType = 'Issued']), 'DateISO8601')"/>
|
501
|
</oaf:dateAccepted>
|
502
|
|
503
|
|
504
|
<oaf:accessrights>
|
505
|
<xsl:variable name='varAccessRights' select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI, 'AccessRights')" />
|
506
|
<xsl:choose>
|
507
|
<xsl:when test="not($varAccessRights = 'EMBARGO' and not((xs:date( max( ($varEmbargoEndDate, '0001-01-01') ) ) gt current-date())))">
|
508
|
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI, 'AccessRights')"/>
|
509
|
</xsl:when>
|
510
|
<xsl:when test="$varAccessRights = 'EMBARGO' and not((xs:date( max( ($varEmbargoEndDate, '0001-01-01') ) ) gt current-date()))">
|
511
|
<xsl:value-of select="'OPEN'"/>
|
512
|
</xsl:when>
|
513
|
</xsl:choose>
|
514
|
</oaf:accessrights>
|
515
|
|
516
|
<!--
|
517
|
if xpath:"(xs:date( max( ($varEmbargoEnd, '0001-01-01') ) ) gt current-date())" oaf:accessrights = "EMBARGO"; else $var0 = "''";
|
518
|
if xpath:"//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics') and not(starts-with(normalize-space(.), 'info:eu-repo/semantics/embargo')) and not((xs:date( max( ($varEmbargoEnd, '0001-01-01') ) ) gt current-date()))]" oaf:accessrights = Convert(xpath:"//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics')]", AccessRights); else $var0 = "''";
|
519
|
if xpath:"//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics/embargo') and not((xs:date( max( ($varEmbargoEnd, '0001-01-01') ) ) gt current-date()))]" oaf:accessrights = "OPEN"; else $var0 = "''";
|
520
|
if xpath:"count(//dc:rights[starts-with(normalize-space(.), 'info:eu-repo/semantics/')]) eq 0 and not($varDatasourceid = 'opendoar____::3532')" oaf:accessrights = "OPEN"; else $var0 = "''";
|
521
|
-->
|
522
|
|
523
|
<xsl:for-each select="//*[local-name()='licenseCondition']">
|
524
|
<oaf:license>
|
525
|
<xsl:value-of select=".[not(./@uri)][not(contains(., 'copyright')) and not(. = 'other')], .[./@uri]/@uri"/>
|
526
|
</oaf:license>
|
527
|
</xsl:for-each>
|
528
|
|
529
|
<oaf:language>
|
530
|
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
|
531
|
</oaf:language>
|
532
|
|
533
|
<!--
|
534
|
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
|
535
|
<oaf:embargoenddate>
|
536
|
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
|
537
|
</oaf:embargoenddate>
|
538
|
</xsl:if>
|
539
|
-->
|
540
|
|
541
|
<!--
|
542
|
<xsl:if test="not(//*[local-name()='nameIdentifier'][starts-with(., 'info:eu-repo/grant')])">
|
543
|
<xsl:call-template name="terminate"/>
|
544
|
</xsl:if>
|
545
|
-->
|
546
|
|
547
|
<!-- ToDo: drop reference to false fields used by ORBI: oaire:fawardNumber -->
|
548
|
<xsl:for-each select="//oaire:fundingReference[./oaire:awardNumber or ./oaire:fawardNumber]">
|
549
|
<xsl:choose>
|
550
|
<xsl:when test="(./oaire:funderName, ./oaire:funderIdentifier) = ('European Commission', 'http://dx.doi.org/10.13039/501100000780', 'https://doi.org/10.13039/100011102') and ./oaire:fundingStream = ('Framework Programme Seven', 'Seventh Framework Programme')">
|
551
|
<oaf:projectid>
|
552
|
<xsl:value-of select="concat($varFP7, replace((./oaire:awardNumber, ./oaire:fawardNumber)[1], '.*(\d{6}).*', '$1'))"/>
|
553
|
</oaf:projectid>
|
554
|
</xsl:when>
|
555
|
<xsl:when test="(./oaire:funderName, ./oaire:funderIdentifier) = ('European Commission', 'http://dx.doi.org/10.13039/501100000780', '10.13039/100010661') and ./oaire:fundingStream = ('Horizon 2020 Framework Programme')">
|
556
|
<oaf:projectid>
|
557
|
<xsl:value-of select="concat($varH2020, (./oaire:awardNumber, ./oaire:fawardNumber))"/>
|
558
|
</oaf:projectid>
|
559
|
</xsl:when>
|
560
|
</xsl:choose>
|
561
|
</xsl:for-each>
|
562
|
|
563
|
<oaf:hostedBy>
|
564
|
<xsl:attribute name="name">
|
565
|
<xsl:value-of select="$varOfficialName"/>
|
566
|
</xsl:attribute>
|
567
|
<xsl:attribute name="id">
|
568
|
<xsl:value-of select="$varDataSourceId"/>
|
569
|
</xsl:attribute>
|
570
|
</oaf:hostedBy>
|
571
|
<oaf:collectedFrom>
|
572
|
<xsl:attribute name="name">
|
573
|
<xsl:value-of select="$varOfficialName"/>
|
574
|
</xsl:attribute>
|
575
|
<xsl:attribute name="id">
|
576
|
<xsl:value-of select="$varDataSourceId"/>
|
577
|
</xsl:attribute>
|
578
|
</oaf:collectedFrom>
|
579
|
|
580
|
<!-- oaf:journal -->
|
581
|
<!-- ISSN is erroneously stuffed in alternateIdentifier, should be put into relatedIdentifier -->
|
582
|
<!-- check/ensure that oaf:journal is not prepared for a journal itself, perhaps limit to Rothamsted -->
|
583
|
<!-- Huelva marks L, E ISSNs as ISSNs, with mark within field in spaces or after blanc -->
|
584
|
<!-- Qeios declares many records as text, although many seem to be definitions which are also related to 'journal' volumes/issues -->
|
585
|
<xsl:if test="($varCobjCategory = '0001' or contains(//dri:recordIdentifier, 'www.qeios.com')) and (//*[local-name() = 'alternateIdentifier']/@alternateIdentifierType[. = 'ISSN'] or //*[local-name() = 'relatedIdentifier'][lower-case(@relationType) = 'ispartof'][@relatedIdentifierType = 'ISSN'])">
|
586
|
<oaf:journal>
|
587
|
<xsl:attribute name="issn" select="(//*[local-name() = 'alternateIdentifier'][./@alternateIdentifierType = 'ISSN'], //*[local-name() = 'relatedIdentifier'][lower-case(./@relationType) = 'ispartof'][./@relatedIdentifierType = 'ISSN'])[1]/concat(substring(., 1, 4), '-', substring(., string-length(.)-3, 4))"/>
|
588
|
<xsl:if test="//*[local-name() = 'citationVolume']">
|
589
|
<xsl:attribute name="vol" select="//*[local-name() = 'citationVolume']"/>
|
590
|
</xsl:if>
|
591
|
<xsl:if test="//*[local-name() = 'citationIssue']">
|
592
|
<xsl:attribute name="iss" select="//*[local-name() = 'citationIssue']"/>
|
593
|
</xsl:if>
|
594
|
<xsl:if test="//*[local-name() = 'citationStartPage']">
|
595
|
<xsl:attribute name="sp" select="//*[local-name() = 'citationStartPage']"/>
|
596
|
</xsl:if>
|
597
|
<xsl:if test="//*[local-name() = 'citationEndPage']">
|
598
|
<xsl:attribute name="ep" select="//*[local-name() = 'citationEndPage']"/>
|
599
|
</xsl:if>
|
600
|
<xsl:value-of select="((//*[local-name() = 'citationTitle'], //dc:source[//oaf:datasourceprefix[.='od______1514']]))"/>
|
601
|
</oaf:journal>
|
602
|
</xsl:if>
|
603
|
|
604
|
<xsl:if test="$varCobjCategory = '0001' and //*[local-name() = 'relatedIdentifier']/@relatedIdentifierType[. = ('ISSN', 'PISSN', 'EISSN', 'LISSN')]">
|
605
|
<oaf:journal>
|
606
|
<xsl:for-each select="//*[local-name() = 'relatedIdentifier'][@relatedIdentifierType[. = ('ISSN', 'PISSN', 'EISSN', 'LISSN')]][@relationType/lower-case(.) = 'ispartof']">
|
607
|
|
608
|
<xsl:attribute name="{./@relatedIdentifierType}" select="./concat(substring(., 1, 4), '-', substring(., string-length(.)-3, 4))"/>
|
609
|
<!-- -->
|
610
|
</xsl:for-each>
|
611
|
|
612
|
<xsl:if test="//*[local-name() = 'citationVolume']">
|
613
|
<xsl:attribute name="vol" select="//*[local-name() = 'citationVolume']"/>
|
614
|
</xsl:if>
|
615
|
<xsl:if test="//*[local-name() = 'citationIssue']">
|
616
|
<xsl:attribute name="iss" select="//*[local-name() = 'citationIssue']"/>
|
617
|
</xsl:if>
|
618
|
<xsl:if test="//*[local-name() = 'citationStartPage']">
|
619
|
<xsl:attribute name="sp" select="//*[local-name() = 'citationStartPage']"/>
|
620
|
</xsl:if>
|
621
|
<xsl:if test="//*[local-name() = 'citationEndPage']">
|
622
|
<xsl:attribute name="ep" select="//*[local-name() = 'citationEndPage']"/>
|
623
|
</xsl:if>
|
624
|
<xsl:value-of select="((//oaire:citationTitle))"/>
|
625
|
</oaf:journal>
|
626
|
</xsl:if>
|
627
|
|
628
|
<!-- oaf:fulltext-->
|
629
|
<xsl:if test="//*[local-name() = 'file']">
|
630
|
<oaf:fulltext>
|
631
|
<xsl:value-of select="//*[local-name() = 'file']"/>
|
632
|
</oaf:fulltext>
|
633
|
</xsl:if>
|
634
|
|
635
|
</metadata>
|
636
|
<xsl:copy-of select="//*[local-name() = 'about']" />
|
637
|
</record>
|
638
|
</xsl:template>
|
639
|
|
640
|
<xsl:template match="node()|@*">
|
641
|
<xsl:copy copy-namespaces="no">
|
642
|
<xsl:apply-templates select="node()|@*"/>
|
643
|
</xsl:copy>
|
644
|
</xsl:template>
|
645
|
|
646
|
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']">
|
647
|
<xsl:copy>
|
648
|
<xsl:apply-templates select="node()|@*"/>
|
649
|
</xsl:copy>
|
650
|
</xsl:template>
|
651
|
|
652
|
<!--
|
653
|
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']">
|
654
|
<xsl:copy copy-namespaces="no">
|
655
|
<xsl:copy-of select="./*[not($varCobjCategory = '0001' and ./@alternateIdentifierType = 'ISSN')]" copy-namespaces="no"/>
|
656
|
|
657
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][lower-case(@identifierType)='handle']">
|
658
|
<datacite:alternateIdentifier>
|
659
|
<xsl:attribute name="alternateIdentifierType">
|
660
|
<xsl:value-of select="'URL'"/>
|
661
|
</xsl:attribute>
|
662
|
<xsl:value-of
|
663
|
select="//oaire:resource/(datacite:identifier[./@identifierType = 'handle' and not(contains(., '://hdl.handle.net/'))]/concat('http://hdl.handle.net/', .), datacite:identifier[contains(., '://hdl.handle.net/')])" />
|
664
|
</datacite:alternateIdentifier>
|
665
|
</xsl:if>
|
666
|
|
667
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']">
|
668
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
669
|
<xsl:attribute name="alternateIdentifierType">
|
670
|
<xsl:value-of select="'URL'"/>
|
671
|
</xsl:attribute>
|
672
|
<xsl:value-of
|
673
|
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" />
|
674
|
</xsl:element>
|
675
|
</xsl:if>
|
676
|
|
677
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
678
|
<datacite:alternateIdentifier>
|
679
|
<xsl:attribute name="alternateIdentifierType">
|
680
|
<xsl:value-of select="'URL'"/>
|
681
|
</xsl:attribute>
|
682
|
<xsl:value-of
|
683
|
select="//oaire:resource/(datacite:identifier[./@identifierType = 'doi' and not(contains(., '://dx.doi.org/'))]/concat('http://dx.doi.org/', .), datacite:identifier[contains(., '://dx.doi.org/')])" />
|
684
|
</datacite:alternateIdentifier>
|
685
|
</xsl:if>
|
686
|
</xsl:copy>
|
687
|
</xsl:template>
|
688
|
-->
|
689
|
|
690
|
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']">
|
691
|
<!-- cut off DOI resolver prefix to just get the number part -->
|
692
|
<!--
|
693
|
<xsl:if test=".[@identifierType='DOI'][contains(., '://dx.doi.org/')]">
|
694
|
<xsl:copy copy-namespaces="no">
|
695
|
<xsl:attribute name="identifierType">
|
696
|
<xsl:value-of select="'DOI'"/>
|
697
|
</xsl:attribute>
|
698
|
<xsl:value-of
|
699
|
select="substring-after(., '://dx.doi.org/')" />
|
700
|
</xsl:copy>
|
701
|
</xsl:if>
|
702
|
<xsl:if test=".[@identifierType='HANDLE'][contains(., '://hdl.handle.net/')]">
|
703
|
<xsl:copy copy-namespaces="no">
|
704
|
<xsl:attribute name="identifierType">
|
705
|
<xsl:value-of select="'handle'"/>
|
706
|
</xsl:attribute>
|
707
|
<xsl:value-of
|
708
|
select="substring-after(., '://hdl.handle.net/')" />
|
709
|
</xsl:copy>
|
710
|
</xsl:if>
|
711
|
<xsl:copy-of select=".[not(contains(., '://dx.doi.org/') or contains(., 'hdl.handle.net/'))]" copy-namespaces="no"/>
|
712
|
|
713
|
|
714
|
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])">
|
715
|
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/">
|
716
|
<xsl:if test=".[@identifierType='Handle']">
|
717
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
718
|
<xsl:attribute name="alternateIdentifierType">
|
719
|
<xsl:value-of select="'URL'"/>
|
720
|
</xsl:attribute>
|
721
|
<xsl:value-of
|
722
|
select="concat('http://hdl.handle.net/', .)" />
|
723
|
</xsl:element>
|
724
|
</xsl:if>
|
725
|
<xsl:if test=".[@identifierType='URN']">
|
726
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
727
|
<xsl:attribute name="alternateIdentifierType">
|
728
|
<xsl:value-of select="'URL'"/>
|
729
|
</xsl:attribute>
|
730
|
<xsl:value-of
|
731
|
select="concat('http://nbn-resolving.org/', .)" />
|
732
|
</xsl:element>
|
733
|
</xsl:if>
|
734
|
<xsl:if test=".[@identifierType='DOI']">
|
735
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
736
|
<xsl:attribute name="alternateIdentifierType">
|
737
|
<xsl:value-of select="'URL'"/>
|
738
|
</xsl:attribute>
|
739
|
<xsl:value-of
|
740
|
select="concat('http://dx.doi.org/', .)" />
|
741
|
</xsl:element>
|
742
|
</xsl:if>
|
743
|
|
744
|
</xsl:element>
|
745
|
</xsl:if>
|
746
|
-->
|
747
|
|
748
|
|
749
|
|
750
|
<!-- funding -->
|
751
|
<xsl:for-each select="//*[local-name()='fundingReference']">
|
752
|
<!-- FP7 -->
|
753
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004963', '10.13039/100011199') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')">
|
754
|
<oaf:projectid>
|
755
|
<xsl:value-of select="concat($varFP7, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/>
|
756
|
</oaf:projectid>
|
757
|
</xsl:if>
|
758
|
<!-- H2020 -->
|
759
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100010661') and matches(./*[local-name()='awardNumber'], '.*(^|[^\d])\d\d\d\d\d\d($|[^\d]).*')">
|
760
|
<oaf:projectid>
|
761
|
<xsl:value-of select="concat($varH2020, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/>
|
762
|
</oaf:projectid>
|
763
|
</xsl:if>
|
764
|
<!-- AKA -->
|
765
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002341') or contains(./*[local-name()='funderName'], 'Suomen Akatemia') or contains(./*[local-name()='funderName'], 'Academy of Finland')">
|
766
|
<oaf:projectid>
|
767
|
<xsl:value-of select="concat($varAKA, ./*[local-name()='awardNumber'])"/>
|
768
|
</oaf:projectid>
|
769
|
</xsl:if>
|
770
|
<!-- ARC -->
|
771
|
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000923') or contains(./*[local-name()='funderName'], 'Australian Research Council')) and matches(./*[local-name()='awardNumber'], '^\d{6}$')">
|
772
|
<oaf:projectid>
|
773
|
<xsl:value-of select="concat($varAKA, replace(./*[local-name()='awardNumber'], '.*(^\d{6}$).*', '$2'))"/>
|
774
|
</oaf:projectid>
|
775
|
</xsl:if>
|
776
|
<!-- CONICYT -->
|
777
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002848') or contains(./*[local-name()='funderName'], 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(./*[local-name()='funderName'], 'CONICYT')">
|
778
|
<oaf:projectid>
|
779
|
<xsl:value-of select="concat($varCONICYT, ./*[local-name()='awardNumber'])"/>
|
780
|
</oaf:projectid>
|
781
|
</xsl:if>
|
782
|
<!-- DFG -->
|
783
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001659') or contains(./*[local-name()='funderName'], 'Deutsche Forschungsgemeinschaft') or contains(./*[local-name()='funderName'], 'DFG')">
|
784
|
<oaf:projectid>
|
785
|
<xsl:value-of select="concat($varDFG, ./*[local-name()='awardNumber'])"/>
|
786
|
</oaf:projectid>
|
787
|
</xsl:if>
|
788
|
<!-- FCT -->
|
789
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or contains(./*[local-name()='funderName'], 'Fundação para a Ciência e a Tecnologia')">
|
790
|
<oaf:projectid>
|
791
|
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/>
|
792
|
</oaf:projectid>
|
793
|
</xsl:if>
|
794
|
<!-- FWF -->
|
795
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100002428') or contains(./*[local-name()='funderName'], 'Fonds zur Förderung der Wissenschaftlichen Forschung') or contains(./*[local-name()='funderName'], 'Austrian Science Fund')">
|
796
|
<oaf:projectid>
|
797
|
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/>
|
798
|
</oaf:projectid>
|
799
|
</xsl:if>
|
800
|
<!-- MESTD -->
|
801
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001871') or (contains(./*[local-name()='funderName'], 'Ministarstvo Prosvete, Nauke i Tehnolo') and contains(./*[local-name()='funderName'], 'kog Razvoja')) or contains(./*[local-name()='funderName'], 'MESTD')">
|
802
|
<oaf:projectid>
|
803
|
<xsl:value-of select="concat($varMESTD, ./*[local-name()='awardNumber'])"/>
|
804
|
</oaf:projectid>
|
805
|
</xsl:if>
|
806
|
<!-- MZOS -->
|
807
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100006588') or contains(./*[local-name()='funderName'], 'Ministarstvo Znanosti, Obrazovanja i Sporta') or contains(./*[local-name()='funderName'], 'Ministry of Science, Education and Sports')">
|
808
|
<oaf:projectid>
|
809
|
<xsl:value-of select="concat($varMZOS, ./*[local-name()='awardNumber'])"/>
|
810
|
</oaf:projectid>
|
811
|
</xsl:if>
|
812
|
<!-- NHMRC -->
|
813
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000925') or contains(./*[local-name()='funderName'], 'National Health and Medical Research Council') or contains(./*[local-name()='funderName'], 'NHMRC')">
|
814
|
<oaf:projectid>
|
815
|
<xsl:value-of select="concat($varNHMRC, ./*[local-name()='awardNumber'])"/>
|
816
|
</oaf:projectid>
|
817
|
</xsl:if>
|
818
|
<!-- NIH -->
|
819
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100000002') or contains(./*[local-name()='funderName'], 'National Institutes of Health')">
|
820
|
<oaf:projectid>
|
821
|
<xsl:value-of select="concat($varNIH, ./*[local-name()='awardNumber'])"/>
|
822
|
</oaf:projectid>
|
823
|
</xsl:if>
|
824
|
<!-- NSF -->
|
825
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org') = ('10.13039/100000001') or contains(./*[local-name()='funderName'], 'National Science Foundation')">
|
826
|
<oaf:projectid>
|
827
|
<xsl:value-of select="concat($varNSF, ./*[local-name()='awardNumber'])"/>
|
828
|
</oaf:projectid>
|
829
|
</xsl:if>
|
830
|
<!-- NWO -->
|
831
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100003246') or contains(./*[local-name()='funderName'], 'Netherlands Organisation for Scientific Research') or contains(./*[local-name()='funderName'], 'Nederlandse Organisatie voor Wetenschappelijk Onderzoek')">
|
832
|
<oaf:projectid>
|
833
|
<xsl:value-of select="concat($varNWO, ./*[local-name()='awardNumber'])"/>
|
834
|
</oaf:projectid>
|
835
|
</xsl:if>
|
836
|
<!-- RCUK -->
|
837
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100000690') or contains(./*[local-name()='funderName'], 'Research Councils UK') or contains(./*[local-name()='funderName'], 'RCUK')">
|
838
|
<oaf:projectid>
|
839
|
<xsl:value-of select="concat($varRCUK, ./*[local-name()='awardNumber'])"/>
|
840
|
</oaf:projectid>
|
841
|
</xsl:if>
|
842
|
<!-- SFI -->
|
843
|
<xsl:if test="(substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001602') or contains(./*[local-name()='funderName'], 'Science Foundation Ireland')) and matches(./*[local-name()='awardNumber'], '.*([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+.*')">
|
844
|
<oaf:projectid>
|
845
|
<xsl:value-of select="concat($varSFI, replace(./*[local-name()='awardNumber'], '.*(^|\s)(([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+)($|\s).*', '$2'))"/>
|
846
|
</oaf:projectid>
|
847
|
</xsl:if>
|
848
|
<!-- SNSF -->
|
849
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100001711') or contains(./*[local-name()='funderName'], 'Swiss National Science Foundation') or contains(./*[local-name()='funderName'], 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung')">
|
850
|
<oaf:projectid>
|
851
|
<xsl:value-of select="concat($varSNSF, ./*[local-name()='awardNumber'])"/>
|
852
|
</oaf:projectid>
|
853
|
</xsl:if>
|
854
|
<!-- TUBITAK -->
|
855
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/501100004410') or contains(./*[local-name()='funderName'], 'Turkish National Science and Research Council') or (contains(./*[local-name()='funderName'], 'Türkiye Bilimsel ve Teknolojik Ara') and contains(./*[local-name()='funderName'], 'rma Kurumu'))">
|
856
|
<oaf:projectid>
|
857
|
<xsl:value-of select="concat($varTUBITAK, ./*[local-name()='awardNumber'])"/>
|
858
|
</oaf:projectid>
|
859
|
</xsl:if>
|
860
|
<!-- WT -->
|
861
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100004440') or contains(./*[local-name()='funderName'], 'Wellcome Trust')">
|
862
|
<oaf:projectid>
|
863
|
<xsl:value-of select="concat($varWT, ./*[local-name()='awardNumber'])"/>
|
864
|
</oaf:projectid>
|
865
|
</xsl:if>
|
866
|
</xsl:for-each>
|
867
|
|
868
|
</xsl:template>
|
869
|
|
870
|
<!--
|
871
|
<xsl:template match="//*[local-name()='language']">
|
872
|
<oaf:language>
|
873
|
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
|
874
|
</oaf:language>
|
875
|
</xsl:template>
|
876
|
-->
|
877
|
|
878
|
<xsl:template match="//*[local-name() = 'header']">
|
879
|
<xsl:copy>
|
880
|
<xsl:apply-templates select="node()|@*"/>
|
881
|
<xsl:element name="dr:dateOfTransformation">
|
882
|
<xsl:value-of select="$transDate"/>
|
883
|
</xsl:element>
|
884
|
</xsl:copy>
|
885
|
</xsl:template>
|
886
|
|
887
|
<!-- ToDo: drop URLs for DOIs? -->
|
888
|
|
889
|
</xsl:stylesheet>]]></CODE>
|
890
|
</SCRIPT>
|
891
|
</CONFIGURATION>
|
892
|
<STATUS/>
|
893
|
<SECURITY_PARAMETERS/>
|
894
|
</BODY>
|
895
|
</RESOURCE_PROFILE>
|