1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="72ced451-f4eb-4efb-ad77-06194e43bf5b_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2020-09-19T18:24:53+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>xslt_cleaning_datarepo_datacite</TITLE>
|
14
|
<CODE><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:oai="http://www.openarchives.org/OAI/2.0/"
|
19
|
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
|
20
|
extension-element-prefixes="TransformationFunction"
|
21
|
exclude-result-prefixes="TransformationFunction">
|
22
|
|
23
|
<xsl:param name="varOfficialName" />
|
24
|
<xsl:param name="varDsType" />
|
25
|
<xsl:param name="varDataSourceId" />
|
26
|
|
27
|
<xsl:param name="varFP7" select = "'corda_______::'"/>
|
28
|
<xsl:param name="varH2020" select = "'corda__h2020::'"/>
|
29
|
<xsl:param name="varAKA" select = "'aka_________::'"/>
|
30
|
<xsl:param name="varARC" select = "'arc_________::'"/>
|
31
|
<xsl:param name="varCONICYT" select = "'conicytf____::'"/>
|
32
|
<xsl:param name="varDFG" select = "'dfgf________::'"/>
|
33
|
<xsl:param name="varFCT" select = "'fct_________::'"/>
|
34
|
<xsl:param name="varFWF" select = "'fwf_________::'"/>
|
35
|
<xsl:param name="varHRZZ" select = "'irb_hr______::'"/> <!-- HRZZ not found -->
|
36
|
<xsl:param name="varMESTD" select = "'mestd_______::'"/>
|
37
|
<xsl:param name="varMZOS" select = "'irb_hr______::'"/>
|
38
|
<xsl:param name="varNHMRC" select = "'nhmrc_______::'"/>
|
39
|
<xsl:param name="varNIH" select = "'nih_________::'"/>
|
40
|
<xsl:param name="varNSF" select = "'nsf_________::'"/>
|
41
|
<xsl:param name="varNWO" select = "'nwo_________::'"/>
|
42
|
<xsl:param name="varRCUK" select = "'rcuk________::'"/>
|
43
|
<xsl:param name="varSFI" select ="'sfi_________::'"/>
|
44
|
<xsl:param name="varSGOV" select = "'sgov________::'"/> <!-- SGOV to be added, awaiting DOI from Pilar, found project ids not in CSV list? -->
|
45
|
<xsl:param name="varSNSF" select = "'snsf________::'"/>
|
46
|
<xsl:param name="varTARA" select = "'taraexp_____::'"/> <!-- TARA to be added, awaiting DOI from André -->
|
47
|
<xsl:param name="varTUBITAK" select = "'tubitakf____::'"/>
|
48
|
<xsl:param name="varWT" select = "'wt__________::'"/>
|
49
|
|
50
|
<xsl:param name="index" select="0"/>
|
51
|
<xsl:param name="transDate" select="current-dateTime()"/>
|
52
|
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
|
53
|
|
54
|
|
55
|
<xsl:template match="/">
|
56
|
<xsl:variable name="datasourcePrefix"
|
57
|
select="normalize-space(//oaf:datasourceprefix)" />
|
58
|
<xsl:call-template name="validRecord" />
|
59
|
</xsl:template>
|
60
|
|
61
|
<xsl:template name="terminate">
|
62
|
<xsl:message terminate="yes">
|
63
|
record is not compliant, transformation is interrupted.
|
64
|
</xsl:message>
|
65
|
</xsl:template>
|
66
|
|
67
|
<xsl:template name="validRecord">
|
68
|
<record>
|
69
|
<xsl:apply-templates select="//*[local-name() = 'header']" />
|
70
|
|
71
|
<metadata>
|
72
|
|
73
|
<xsl:apply-templates select="//*[local-name() = 'metadata']//*[local-name() = 'resource']"/>
|
74
|
|
75
|
<!-- for CoCoON many deleted records appeared among the transformed records -->
|
76
|
<xsl:if test="//oai:header/@status='deleted'">
|
77
|
<xsl:call-template name="terminate"/>
|
78
|
</xsl:if>
|
79
|
|
80
|
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle'][not(. = '123456789')]">
|
81
|
<oaf:identifier>
|
82
|
<xsl:attribute name="identifierType">
|
83
|
<xsl:value-of select="'handle'"/>
|
84
|
</xsl:attribute>
|
85
|
<xsl:if test="contains(., '://hdl.handle.net/')">
|
86
|
<xsl:value-of select="substring-after(., '://hdl.handle.net/')"/>
|
87
|
</xsl:if>
|
88
|
<xsl:if test="not(contains(., '://hdl.handle.net/'))">
|
89
|
<xsl:value-of select="."/>
|
90
|
</xsl:if>
|
91
|
</oaf:identifier>
|
92
|
</xsl:for-each>
|
93
|
|
94
|
<xsl:for-each select="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
95
|
<oaf:identifier>
|
96
|
<xsl:attribute name="identifierType">
|
97
|
<xsl:value-of select="'doi'"/>
|
98
|
</xsl:attribute>
|
99
|
<!--
|
100
|
<xsl:value-of select="."/>
|
101
|
-->
|
102
|
<xsl:if test="contains(., '://dx.doi.org/')">
|
103
|
<xsl:value-of select="substring-after(., '://dx.doi.org/')"/>
|
104
|
</xsl:if>
|
105
|
<xsl:if test="not(contains(., '://dx.doi.org/'))">
|
106
|
<xsl:value-of select="."/>
|
107
|
</xsl:if>
|
108
|
</oaf:identifier>
|
109
|
</xsl:for-each>
|
110
|
|
111
|
<xsl:if test="//*[local-name()='date']/@dateType='Available' and //*[local-name()='datasourceprefix']!='r33ffb097cef'">
|
112
|
<xsl:variable name='varEmbargoEndDate'
|
113
|
select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/>
|
114
|
<xsl:choose>
|
115
|
<xsl:when test="string-length($varEmbargoEndDate) > 0">
|
116
|
<oaf:embargoenddate>
|
117
|
<xsl:value-of select="$varEmbargoEndDate"/>
|
118
|
</oaf:embargoenddate>
|
119
|
</xsl:when>
|
120
|
<xsl:otherwise>
|
121
|
<xsl:call-template name="terminate"/>
|
122
|
</xsl:otherwise>
|
123
|
</xsl:choose>
|
124
|
</xsl:if>
|
125
|
|
126
|
<!--
|
127
|
<xsl:choose>
|
128
|
|
129
|
or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='software' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='software' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Film' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Sound' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='PhysicalObject' or //*[local-name()='resourceType']/@resourceTypeGeneral/lower-case()='Audiovisual'">
|
130
|
<xsl:when test="lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual')">
|
131
|
|
132
|
<xsl:when test="lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual', 'model', 'workflow', 'service', 'image') or //*[local-name()='resourceType'][lower-case(@resourceTypeGeneral)='other' and lower-case(.)=('study', 'research data', 'image', 'photos et images')] or //*[local-name()='resourceType'][lower-case(.)='article'] or (//*[local-name()='resourceType'][lower-case(./@resourceTypeGeneral)='other' and lower-case(.)=('study', 'egi virtual appliance')])">
|
133
|
|
134
|
</xsl:when>
|
135
|
<xsl:otherwise>
|
136
|
<xsl:call-template name="terminate"/>
|
137
|
</xsl:otherwise>
|
138
|
</xsl:choose>
|
139
|
-->
|
140
|
|
141
|
<!--
|
142
|
<dr:CobjCategory>
|
143
|
<xsl:value-of
|
144
|
select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')" />
|
145
|
</dr:CobjCategory>
|
146
|
|
147
|
<dr:CobjCategory>
|
148
|
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, distinct-values(//*[local-name()='resourceType']/@resourceTypeGeneral), 'TextTypologies')" />
|
149
|
<xsl:attribute name="type" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
|
150
|
<xsl:value-of select="$varCobjCategory" />
|
151
|
</dr:CobjCategory>
|
152
|
-->
|
153
|
|
154
|
|
155
|
|
156
|
<xsl:variable name='varTypLst' select="distinct-values((//*[local-name()='resourceType']/(., @resourceTypeGeneral)))"/>
|
157
|
<xsl:variable name='varCobjCatLst' select="distinct-values((for $i in $varTypLst
|
158
|
return TransformationFunction:convertString($tf, normalize-space($i), 'TextTypologies')))" />
|
159
|
<xsl:variable name='varCobjSupLst' select="for $i in $varCobjCatLst
|
160
|
return concat($i, '###', TransformationFunction:convertString($tf, normalize-space($i), 'SuperTypes'))" />
|
161
|
|
162
|
<dr:CobjCategory>
|
163
|
<xsl:choose>
|
164
|
<xsl:when test="count($varCobjSupLst[not(substring-after(., '###') = 'other') and not(substring-before(., '###') = ('0038', '0039', '0040'))]) > 0">
|
165
|
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-after(., '###') = 'other') and not(substring-before(., '###') = ('0038', '0039', '0040'))][1]" />
|
166
|
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/>
|
167
|
<xsl:value-of select="substring-before($varCobjSup, '###')" />
|
168
|
</xsl:when>
|
169
|
<xsl:when test="count($varCobjSupLst[not(substring-after(., '###') = 'other')]) > 0">
|
170
|
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-after(., '###') = 'other')][1]" />
|
171
|
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/>
|
172
|
<xsl:value-of select="substring-before($varCobjSup, '###')" />
|
173
|
</xsl:when>
|
174
|
<xsl:when test="count($varCobjSupLst[not(substring-before(., '###') = ('0020', '0000'))]) > 0">
|
175
|
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-before(., '###') = ('0020', '0000'))][1]" />
|
176
|
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/>
|
177
|
<xsl:value-of select="substring-before($varCobjSup, '###')" />
|
178
|
</xsl:when>
|
179
|
<xsl:when test="count($varCobjSupLst[not(substring-before(., '###') = ('0000'))]) > 0">
|
180
|
<xsl:variable name='varCobjSup' select="$varCobjSupLst[not(substring-before(., '###') = ('0000'))][1]" />
|
181
|
<xsl:attribute name="type" select="substring-after($varCobjSup, '###')"/>
|
182
|
<xsl:value-of select="substring-before($varCobjSup, '###')" />
|
183
|
</xsl:when>
|
184
|
<xsl:otherwise>
|
185
|
<xsl:attribute name="type" select="'other'"/>
|
186
|
<xsl:value-of select="'0000'" />
|
187
|
</xsl:otherwise>
|
188
|
</xsl:choose>
|
189
|
</dr:CobjCategory>
|
190
|
|
191
|
<!-- review status -->
|
192
|
<!-- no review hints found in resource type declarations, no version declarations found -->
|
193
|
<xsl:variable name="varRefereedConvt" select="for $i in (
|
194
|
//*[local-name()='resourceType']/(., @resourceTypeGeneral), //oai:setSpec, //*[local-name()='description'])
|
195
|
return TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/>
|
196
|
<!--
|
197
|
//<xsl:variable name="varRefereedIdntf" select="//*[local-name()=('identifier', 'alternateIdentifier')][matches(lower-case(.), '.*[\s\-\.\\_/:]preprints?[\s\-\.\\_/:].*')]/'0002' "/>
|
198
|
-->
|
199
|
<xsl:variable name="varRefereedIdntf" select="(
|
200
|
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '(^|.*[\.\-_\\/\s\(\)%\d#:])pre[\.\-_\\/\s\(\)%\d#:]?prints?([\.\-_\\/\s\(\)%\d#:].*)?$')]/'0002',
|
201
|
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '(^|.*[\.\-_\\/\s\(\)%\d#:])refereed([\.\-_\\/\s\(\)%\d#:].*)?$')]/'0001',
|
202
|
//*[local-name()=('identifier', 'alternateIdentifier')][count(//*[local-name()=('metadata', 'resource')]//*[local-name()=('identifier', 'alternateIdentifier')]) = 1][matches(lower-case(.), '.*-peer-reviewed-(fulltext-)?article-.*')]/'0001')"/>
|
203
|
<xsl:variable name="varRefereedVersn" select="(//*[local-name()='version'][matches(lower-case(.), '.*peer[\s\-\.\\_/:%]?reviewed.*')]/'0001',
|
204
|
//*[local-name()='version'][matches(normalize-space(lower-case(.)), '^(v|vs|version|rel|release)?[\s\.\-_]*0$')]/'0002',
|
205
|
//*[local-name()='version'][matches(lower-case(.), '(^|[\s\-\.\\_/:%].*)(beta|draft|trial|test)([\s\-\.\\_/:%].*|$)')]/'0002',
|
206
|
//*[local-name()='version'][matches(lower-case(.), '.*submi(tted|ssion|ttal).*')]/'0002') "/>
|
207
|
<xsl:variable name="varRefereedOther" select="(//*[local-name()='publisher'][matches(lower-case(.), '.*[\s\-\.\\_/:%]pre[\s\-\.\\_/:%]?prints?([\s\-\.\\_/:%].*|$)')]/'0002',
|
208
|
//*[local-name()='description'][matches(lower-case(.), '^peer[\s\-\.\\_/:%]?reviewed$')]/'0001',
|
209
|
//*[local-name()='description'][matches(lower-case(.), '^pre[\s\-\.\\_/:%]?prints?$')]/'0002') "/>
|
210
|
<xsl:variable name="varRefereedReltn" select="//*[local-name() = 'relatedIdentifier'][./@relationType/lower-case(.)='isreviewedby']/'0001'"/>
|
211
|
<xsl:variable name="varRefereedDesct" select="(//*[local-name() = 'description']
|
212
|
[matches(lower-case(.), '.*(this\s*book|this\s*volume|it)\s*constitutes\s*the\s*(thoroughly\s*)?refereed') or
|
213
|
matches(lower-case(.), '.*peer[\.\-_/\s\(\)]?review\s*under\s*responsibility\s*of.*') or
|
214
|
matches(lower-case(.), '(this|a)\s*(article|preprint)\s*(has\s*been\s*)?(peer[\-\s]*)?reviewed\s*and\s*recommended\s*by\s*peer[\-\s]*community')]/'0001')"/>
|
215
|
<xsl:variable name="varRefereed" select="($varRefereedConvt, $varRefereedIdntf, $varRefereedReltn, $varRefereedVersn, $varRefereedOther, $varRefereedReltn, $varRefereedDesct)"/>
|
216
|
<xsl:choose>
|
217
|
<xsl:when test="count($varRefereed[. = '0001']) > 0">
|
218
|
<oaf:refereed>
|
219
|
<xsl:value-of select="'0001'"/>
|
220
|
</oaf:refereed>
|
221
|
</xsl:when>
|
222
|
<xsl:when test="count($varRefereed[. = '0002']) > 0">
|
223
|
<oaf:refereed>
|
224
|
<xsl:value-of select="'0002'"/>
|
225
|
</oaf:refereed>
|
226
|
</xsl:when>
|
227
|
</xsl:choose>
|
228
|
|
229
|
<oaf:dateAccepted>
|
230
|
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"/>
|
231
|
</oaf:dateAccepted>
|
232
|
<xsl:choose>
|
233
|
|
234
|
<!--
|
235
|
<xsl:if test="//*[local-name() = 'datasourceprefix'][.='r310e4cd113d'] and not(boolean(//*[local-name() = 'rights']/@rightsURI ) )]">
|
236
|
<oaf:skip>
|
237
|
<xsl:value-of select="TransformationFunction:skipRecord($tf, $index)"/>
|
238
|
</oaf:skip>
|
239
|
</xsl:if>
|
240
|
-->
|
241
|
|
242
|
<!-- <xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')]">
|
243
|
<oaf:accessrights>
|
244
|
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/>
|
245
|
</oaf:accessrights>
|
246
|
</xsl:when>
|
247
|
-->
|
248
|
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]">
|
249
|
<oaf:accessrights>
|
250
|
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/>
|
251
|
</oaf:accessrights>
|
252
|
</xsl:when>
|
253
|
|
254
|
<xsl:otherwise>
|
255
|
<xsl:choose>
|
256
|
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'Creative Commons') or starts-with(normalize-space(.), 'GNU LESSER GENERAL PUBLIC LICENSE')]">
|
257
|
<oaf:accessrights>
|
258
|
<xsl:text>OPEN</xsl:text>
|
259
|
</oaf:accessrights>
|
260
|
</xsl:when>
|
261
|
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'http://opendatacommons.org')]">
|
262
|
<oaf:accessrights>
|
263
|
<xsl:text>OPEN</xsl:text>
|
264
|
</oaf:accessrights>
|
265
|
</xsl:when>
|
266
|
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'Open access data at least for academic use')]">
|
267
|
<oaf:accessrights>
|
268
|
<xsl:text>RESTRICTED</xsl:text>
|
269
|
</oaf:accessrights>
|
270
|
</xsl:when>
|
271
|
<xsl:otherwise>
|
272
|
<oaf:accessrights>
|
273
|
<xsl:text>UNKNOWN</xsl:text>
|
274
|
</oaf:accessrights>
|
275
|
</xsl:otherwise>
|
276
|
</xsl:choose>
|
277
|
</xsl:otherwise>
|
278
|
</xsl:choose>
|
279
|
|
280
|
<xsl:for-each select="//*[local-name()='rights']/@rightsURI[starts-with(normalize-space(.), 'http') and matches(., '.*(/licenses|/publicdomain|unlicense.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*')]">
|
281
|
<oaf:license>
|
282
|
<xsl:value-of select="."/>
|
283
|
</oaf:license>
|
284
|
</xsl:for-each>
|
285
|
|
286
|
<oaf:language>
|
287
|
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
|
288
|
</oaf:language>
|
289
|
|
290
|
<!--
|
291
|
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
|
292
|
<oaf:embargoenddate>
|
293
|
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
|
294
|
</oaf:embargoenddate>
|
295
|
</xsl:if>
|
296
|
-->
|
297
|
|
298
|
<!--
|
299
|
<xsl:if test="not(//*[local-name()='nameIdentifier'][starts-with(., 'info:eu-repo/grant')])">
|
300
|
<xsl:call-template name="terminate"/>
|
301
|
</xsl:if>
|
302
|
-->
|
303
|
|
304
|
<xsl:for-each select="//*[local-name()='nameIdentifier']">
|
305
|
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
|
306
|
<oaf:projectid>
|
307
|
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
308
|
</oaf:projectid>
|
309
|
</xsl:if>
|
310
|
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
|
311
|
<oaf:projectid>
|
312
|
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
313
|
</oaf:projectid>
|
314
|
</xsl:if>
|
315
|
</xsl:for-each>
|
316
|
|
317
|
<oaf:hostedBy>
|
318
|
<xsl:attribute name="name">
|
319
|
<xsl:value-of select="$varOfficialName"/>
|
320
|
</xsl:attribute>
|
321
|
<xsl:attribute name="id">
|
322
|
<xsl:value-of select="$varDataSourceId"/>
|
323
|
</xsl:attribute>
|
324
|
</oaf:hostedBy>
|
325
|
<oaf:collectedFrom>
|
326
|
<xsl:attribute name="name">
|
327
|
<xsl:value-of select="$varOfficialName"/>
|
328
|
</xsl:attribute>
|
329
|
<xsl:attribute name="id">
|
330
|
<xsl:value-of select="$varDataSourceId"/>
|
331
|
</xsl:attribute>
|
332
|
</oaf:collectedFrom>
|
333
|
</metadata>
|
334
|
<xsl:copy-of select="//*[local-name() = 'about']" />
|
335
|
</record>
|
336
|
</xsl:template>
|
337
|
|
338
|
<xsl:template match="node()|@*">
|
339
|
<xsl:copy>
|
340
|
<xsl:apply-templates select="node()|@*"/>
|
341
|
</xsl:copy>
|
342
|
</xsl:template>
|
343
|
|
344
|
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']">
|
345
|
<xsl:copy>
|
346
|
<xsl:apply-templates select="node()|@*"/>
|
347
|
</xsl:copy>
|
348
|
</xsl:template>
|
349
|
|
350
|
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']">
|
351
|
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/">
|
352
|
|
353
|
<xsl:copy-of select="./*"/>
|
354
|
|
355
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']">
|
356
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
357
|
<xsl:attribute name="alternateIdentifierType">
|
358
|
<xsl:value-of select="'URL'"/>
|
359
|
</xsl:attribute>
|
360
|
<xsl:value-of
|
361
|
select="concat('http://hdl.handle.net/', //*[local-name() = 'resource']/*[local-name()='identifier'])" />
|
362
|
</xsl:element>
|
363
|
</xsl:if>
|
364
|
|
365
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']">
|
366
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
367
|
<xsl:attribute name="alternateIdentifierType">
|
368
|
<xsl:value-of select="'URL'"/>
|
369
|
</xsl:attribute>
|
370
|
<xsl:value-of
|
371
|
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" />
|
372
|
</xsl:element>
|
373
|
</xsl:if>
|
374
|
|
375
|
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
376
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
377
|
<xsl:attribute name="alternateIdentifierType">
|
378
|
<xsl:value-of select="'URL'"/>
|
379
|
</xsl:attribute>
|
380
|
<!--
|
381
|
<xsl:value-of
|
382
|
select="concat('http://dx.doi.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" />
|
383
|
-->
|
384
|
<xsl:value-of
|
385
|
select="//*[local-name() = 'resource']/(*[local-name()='identifier'][not(contains(., '://dx.doi.org/'))]/concat('http://dx.doi.org/', .), *[local-name()='identifier'][contains(., '://dx.doi.org/')])" />
|
386
|
</xsl:element>
|
387
|
</xsl:if>
|
388
|
|
389
|
</xsl:element>
|
390
|
|
391
|
</xsl:template>
|
392
|
|
393
|
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']">
|
394
|
<!-- cut off DOI resolver prefix to just get the number part -->
|
395
|
<xsl:if test=".[@identifierType='DOI'][contains(., '://dx.doi.org/')]">
|
396
|
<xsl:element name="identifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
397
|
<xsl:attribute name="identifierType">
|
398
|
<xsl:value-of select="'DOI'"/>
|
399
|
</xsl:attribute>
|
400
|
<xsl:value-of
|
401
|
select="substring-after(., '://dx.doi.org/')" />
|
402
|
</xsl:element>
|
403
|
</xsl:if>
|
404
|
<xsl:copy-of select=".[not(contains(., '://dx.doi.org/'))]"/>
|
405
|
<!--
|
406
|
<xsl:copy-of select="."/>
|
407
|
-->
|
408
|
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])">
|
409
|
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/">
|
410
|
<xsl:if test=".[@identifierType='Handle']">
|
411
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
412
|
<xsl:attribute name="alternateIdentifierType">
|
413
|
<xsl:value-of select="'URL'"/>
|
414
|
</xsl:attribute>
|
415
|
<xsl:value-of
|
416
|
select="concat('http://hdl.handle.net/', .)" />
|
417
|
</xsl:element>
|
418
|
</xsl:if>
|
419
|
<xsl:if test=".[@identifierType='URN']">
|
420
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
421
|
<xsl:attribute name="alternateIdentifierType">
|
422
|
<xsl:value-of select="'URL'"/>
|
423
|
</xsl:attribute>
|
424
|
<xsl:value-of
|
425
|
select="concat('http://nbn-resolving.org/', .)" />
|
426
|
</xsl:element>
|
427
|
</xsl:if>
|
428
|
<xsl:if test=".[@identifierType='DOI']">
|
429
|
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
430
|
<xsl:attribute name="alternateIdentifierType">
|
431
|
<xsl:value-of select="'URL'"/>
|
432
|
</xsl:attribute>
|
433
|
<xsl:value-of
|
434
|
select="concat('http://dx.doi.org/', .)" />
|
435
|
</xsl:element>
|
436
|
</xsl:if>
|
437
|
|
438
|
</xsl:element>
|
439
|
</xsl:if>
|
440
|
|
441
|
|
442
|
|
443
|
<!-- funding -->
|
444
|
<xsl:for-each select="//*[local-name()='fundingReference']">
|
445
|
<!-- FP7 -->
|
446
|
<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]).*')">
|
447
|
<oaf:projectid>
|
448
|
<xsl:value-of select="concat($varFP7, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/>
|
449
|
</oaf:projectid>
|
450
|
</xsl:if>
|
451
|
<!-- H2020 -->
|
452
|
<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]).*')">
|
453
|
<oaf:projectid>
|
454
|
<xsl:value-of select="concat($varH2020, replace(./*[local-name()='awardNumber'], '.*(^|[^\d])(\d\d\d\d\d\d)($|[^\d]).*', '$2'))"/>
|
455
|
</oaf:projectid>
|
456
|
</xsl:if>
|
457
|
<!-- AKA -->
|
458
|
<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')">
|
459
|
<oaf:projectid>
|
460
|
<xsl:value-of select="concat($varAKA, ./*[local-name()='awardNumber'])"/>
|
461
|
</oaf:projectid>
|
462
|
</xsl:if>
|
463
|
<!-- ARC -->
|
464
|
<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}$')">
|
465
|
<oaf:projectid>
|
466
|
<xsl:value-of select="concat($varAKA, replace(./*[local-name()='awardNumber'], '.*(^\d{6}$).*', '$2'))"/>
|
467
|
</oaf:projectid>
|
468
|
</xsl:if>
|
469
|
<!-- CONICYT -->
|
470
|
<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')">
|
471
|
<oaf:projectid>
|
472
|
<xsl:value-of select="concat($varCONICYT, ./*[local-name()='awardNumber'])"/>
|
473
|
</oaf:projectid>
|
474
|
</xsl:if>
|
475
|
<!-- DFG -->
|
476
|
<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')">
|
477
|
<oaf:projectid>
|
478
|
<xsl:value-of select="concat($varDFG, ./*[local-name()='awardNumber'])"/>
|
479
|
</oaf:projectid>
|
480
|
</xsl:if>
|
481
|
<!-- FCT -->
|
482
|
<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')">
|
483
|
<oaf:projectid>
|
484
|
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/>
|
485
|
</oaf:projectid>
|
486
|
</xsl:if>
|
487
|
<!-- FWF -->
|
488
|
<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')">
|
489
|
<oaf:projectid>
|
490
|
<xsl:value-of select="concat($varFCT, ./*[local-name()='awardNumber'])"/>
|
491
|
</oaf:projectid>
|
492
|
</xsl:if>
|
493
|
<!-- MESTD -->
|
494
|
<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')">
|
495
|
<oaf:projectid>
|
496
|
<xsl:value-of select="concat($varMESTD, ./*[local-name()='awardNumber'])"/>
|
497
|
</oaf:projectid>
|
498
|
</xsl:if>
|
499
|
<!-- MZOS -->
|
500
|
<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')">
|
501
|
<oaf:projectid>
|
502
|
<xsl:value-of select="concat($varMZOS, ./*[local-name()='awardNumber'])"/>
|
503
|
</oaf:projectid>
|
504
|
</xsl:if>
|
505
|
<!-- NHMRC -->
|
506
|
<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')">
|
507
|
<oaf:projectid>
|
508
|
<xsl:value-of select="concat($varNHMRC, ./*[local-name()='awardNumber'])"/>
|
509
|
</oaf:projectid>
|
510
|
</xsl:if>
|
511
|
<!-- NIH -->
|
512
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100000002') or contains(./*[local-name()='funderName'], 'National Institutes of Health')">
|
513
|
<oaf:projectid>
|
514
|
<xsl:value-of select="concat($varNIH, ./*[local-name()='awardNumber'])"/>
|
515
|
</oaf:projectid>
|
516
|
</xsl:if>
|
517
|
<!-- NSF -->
|
518
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org') = ('10.13039/100000001') or contains(./*[local-name()='funderName'], 'National Science Foundation')">
|
519
|
<oaf:projectid>
|
520
|
<xsl:value-of select="concat($varNSF, ./*[local-name()='awardNumber'])"/>
|
521
|
</oaf:projectid>
|
522
|
</xsl:if>
|
523
|
<!-- NWO -->
|
524
|
<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')">
|
525
|
<oaf:projectid>
|
526
|
<xsl:value-of select="concat($varNWO, ./*[local-name()='awardNumber'])"/>
|
527
|
</oaf:projectid>
|
528
|
</xsl:if>
|
529
|
<!-- RCUK -->
|
530
|
<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')">
|
531
|
<oaf:projectid>
|
532
|
<xsl:value-of select="concat($varRCUK, ./*[local-name()='awardNumber'])"/>
|
533
|
</oaf:projectid>
|
534
|
</xsl:if>
|
535
|
<!-- SFI -->
|
536
|
<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\.\-]+.*')">
|
537
|
<oaf:projectid>
|
538
|
<xsl:value-of select="concat($varSFI, replace(./*[local-name()='awardNumber'], '.*(^|\s)(([\dA-Za-z\.\-]+/)+[\dA-Za-z\.\-]+)($|\s).*', '$2'))"/>
|
539
|
</oaf:projectid>
|
540
|
</xsl:if>
|
541
|
<!-- SNSF -->
|
542
|
<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')">
|
543
|
<oaf:projectid>
|
544
|
<xsl:value-of select="concat($varSNSF, ./*[local-name()='awardNumber'])"/>
|
545
|
</oaf:projectid>
|
546
|
</xsl:if>
|
547
|
<!-- TUBITAK -->
|
548
|
<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'))">
|
549
|
<oaf:projectid>
|
550
|
<xsl:value-of select="concat($varTUBITAK, ./*[local-name()='awardNumber'])"/>
|
551
|
</oaf:projectid>
|
552
|
</xsl:if>
|
553
|
<!-- WT -->
|
554
|
<xsl:if test="substring-after(normalize-space(./*[local-name()='funderIdentifier']), 'doi.org/') = ('10.13039/100004440') or contains(./*[local-name()='funderName'], 'Wellcome Trust')">
|
555
|
<oaf:projectid>
|
556
|
<xsl:value-of select="concat($varWT, ./*[local-name()='awardNumber'])"/>
|
557
|
</oaf:projectid>
|
558
|
</xsl:if>
|
559
|
</xsl:for-each>
|
560
|
|
561
|
</xsl:template>
|
562
|
|
563
|
<!--
|
564
|
<xsl:template match="//*[local-name()='language']">
|
565
|
<oaf:language>
|
566
|
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
|
567
|
</oaf:language>
|
568
|
</xsl:template>
|
569
|
-->
|
570
|
|
571
|
<xsl:template match="//*[local-name() = 'header']">
|
572
|
<xsl:copy>
|
573
|
<xsl:apply-templates select="node()|@*"/>
|
574
|
<xsl:element name="dr:dateOfTransformation">
|
575
|
<xsl:value-of select="$transDate"/>
|
576
|
</xsl:element>
|
577
|
</xsl:copy>
|
578
|
</xsl:template>
|
579
|
|
580
|
</xsl:stylesheet></CODE>
|
581
|
</SCRIPT>
|
582
|
</CONFIGURATION>
|
583
|
<STATUS/>
|
584
|
<SECURITY_PARAMETERS/>
|
585
|
</BODY>
|
586
|
</RESOURCE_PROFILE>
|