Project

General

Profile

« Previous | Next » 

Revision 60652

TR for publication downloaded from datacite. Datacite API: "https://api.datacite.org/dois/" returned metadata in json format

View differences:

modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/DatacitePub JSON
1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="ce4fd867-e1f3-4cdb-b3a6-be28d27671fa_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2021-03-16T12:29:06+00:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>DatacitePub JSON</TITLE>
14
                <CODE>
15
                <![CDATA[
16
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2"
17
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
18
    xmlns:oaf="http://namespace.openaire.eu/oaf"
19
    xmlns:dr="http://www.driver-repository.eu/namespace/dr"
20
    xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
21
    extension-element-prefixes="TransformationFunction"
22
    exclude-result-prefixes="TransformationFunction">
23
    <xsl:param name="varOfficialName"/>
24
    <xsl:param name="varDsType"/>
25
    <xsl:param name="varDataSourceId"/>
26
    <xsl:param name="varFP7" select="'corda_______::'"/>
27
    <xsl:param name="varH2020" select="'corda__h2020::'"/>
28
    <xsl:param name="varHostedByOfficialName" select="'Unknown Repository'"/>
29
    <xsl:param name="varHostedByDataSourceId"
30
        select="'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'"/>
31

  
32
    <xsl:param name="index" select="0"/>
33
    <xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
34

  
35
    <xsl:variable name="validationDate">
36
        <xsl:value-of select="//*[local-name() = 'dateOfCollection']"/>
37
    </xsl:variable>
38
    <xsl:variable name="identifier" select="//attributes/doi"/>
39
    <xsl:variable name="creators" select="//attributes/creators"/>
40
    <xsl:variable name="titles" select="//attributes/titles"/>
41
    <xsl:variable name="publisher" select="//attributes/publisher"/>
42
    <xsl:variable name="publicationYear" select="//attributes/publicationYear"/>
43
    <xsl:variable name="subjects" select="//attributes/subjects"/>
44
    <xsl:variable name="contributors" select="//attributes/contributors"/>
45
    <xsl:variable name="dates" select="//attributes/dates"/>
46
    <xsl:variable name="language" select="//attributes/language"/>
47
    <xsl:variable name="types" select="//attributes/types"/>
48
    <xsl:variable name="alternateIdentifiers" select="//attributes/alternateIdentifiers"/>
49
    <xsl:variable name="relatedIdentifiers" select="//attributes/relatedIdentifiers"/>
50
    <xsl:variable name="rights" select="//attributes/rightsList"/>
51
    <xsl:variable name="descriptions" select="//attributes/descriptions"/>
52

  
53

  
54

  
55
    <xsl:template match="/">
56
        <xsl:variable name="datasourcePrefix" select="normalize-space(//oaf:datasourceprefix)"/>
57
        <xsl:call-template name="validRecord"/>
58
    </xsl:template>
59

  
60
    <xsl:template name="terminate">
61
        <xsl:message terminate="yes"> record is not compliant, transformation is interrupted.
62
        </xsl:message>
63
    </xsl:template>
64

  
65
    <xsl:template name="creator">
66
        <xsl:param name="author"/>
67
        <creator>
68
            <xsl:if test="$author/name">
69
                <creatorName>
70
                    <xsl:value-of select="$author/name"/>
71
                </creatorName>
72
            </xsl:if>
73
            <xsl:if test="$author/affiliation">
74
                <affiliation>
75
                    <xsl:value-of select="$author/affiliation"/>
76
                </affiliation>
77
            </xsl:if>
78
            <xsl:for-each select="$author/nameIdentifiers">
79
                <nameIdentifier>
80
                    <xsl:attribute name="nameIdentifierScheme">
81
                        <xsl:value-of select="./nameIdentifierScheme"/>
82
                    </xsl:attribute>
83
                    <xsl:if test="./schemeURI">
84
                        <xsl:attribute name="schemeURI">
85
                            <xsl:value-of select="./schemeURI"/>
86
                        </xsl:attribute>
87
                    </xsl:if>
88
                    <xsl:value-of select="./nameIdentifier"/>
89
                </nameIdentifier>
90
            </xsl:for-each>
91
        </creator>
92

  
93
    </xsl:template>
94

  
95
    <xsl:template name="validRecord">
96
        <record xmlns="http://datacite.org/schema/kernel-4">
97
            <xsl:copy-of select="//*[local-name() = 'header']"/>
98

  
99
            <metadata>
100
                <resource>
101
                    <xsl:choose>
102
                        <xsl:when
103
                            test="not($identifier) or count($creators) = 0 or count($titles) = 0 or not($publisher) or not($publicationYear) or count($dates) = 0">
104
                            <xsl:call-template name="terminate"/>
105
                        </xsl:when>
106
                        <xsl:otherwise>
107

  
108
                            <identifier identifierType="DOI">
109
                                <xsl:value-of select="$identifier"/>
110
                            </identifier>
111

  
112
                            <creators>
113
                                <xsl:for-each select="$creators">
114
                                    <xsl:call-template name="creator">
115
                                        <xsl:with-param name="author" select="."/>
116
                                    </xsl:call-template>
117
                                </xsl:for-each>
118
                            </creators>
119

  
120
                            <titles>
121
                                <xsl:for-each select="$titles">
122
                                    <title>
123
                                        <xsl:if test="./lang">
124
                                            <xsl:attribute name="xml:lang" select="./lang"/>
125
                                        </xsl:if>
126
                                        <xsl:value-of select="."/>
127

  
128
                                    </title>
129
                                </xsl:for-each>
130
                            </titles>
131

  
132
                            <publisher>
133
                                <xsl:value-of select="$publisher"/>
134
                            </publisher>
135

  
136
                            <publicationYear>
137
                                <xsl:value-of select="$publicationYear"/>
138
                            </publicationYear>
139

  
140
                            <xsl:if test="count($subjects) > 0">
141
                                <subjects>
142
                                    <xsl:for-each select="$subjects">
143
                                        <subject>
144
                                            <xsl:if test="./subjectScheme">
145
                                                <xsl:attribute name="subjectScheme">
146
                                                  <xsl:value-of select="./subjectScheme"/>
147
                                                </xsl:attribute>
148
                                            </xsl:if>
149
                                            <xsl:if test="./schemeURI">
150
                                                <xsl:attribute name="schemeURI">
151
                                                  <xsl:value-of select="./schemeURI"/>
152
                                                </xsl:attribute>
153
                                            </xsl:if>
154
                                            <xsl:value-of select="./subject"/>
155
                                        </subject>
156
                                    </xsl:for-each>
157

  
158
                                </subjects>
159
                            </xsl:if>
160

  
161
                            <xsl:if test="count($contributors) > 0">
162
                                <contributors>
163
                                    <xsl:for-each select="$contributors">
164
                                        <contributor>
165
                                            <xsl:if test="./contributorType">
166
                                                <xsl:attribute name="contributorType">
167
                                                  <xsl:value-of select="./contributorType"/>
168
                                                </xsl:attribute>
169
                                            </xsl:if>
170
                                            <contributorName>
171
                                                <xsl:value-of select="./name"/>
172
                                            </contributorName>
173
                                        </contributor>
174
                                    </xsl:for-each>
175
                                </contributors>
176
                            </xsl:if>
177

  
178
                            <dates>
179
                                <xsl:for-each select="$dates">
180
                                    <date>
181
                                        <xsl:attribute name="dateType" select="./dateType"/>
182
                                        <xsl:value-of select="./date"/>
183
                                    </date>
184
                                </xsl:for-each>
185
                            </dates>
186

  
187
                            <xsl:if test="$language">
188
                                <language>
189
                                    <xsl:value-of select="$language"/>
190
                                </language>
191
                            </xsl:if>
192

  
193
                            <xsl:if test="$alternateIdentifiers">
194
                                <alternateIdentifiers>
195
                                    <xsl:for-each select="$alternateIdentifiers">
196
                                        <alternateIdentifier>
197
                                            <xsl:attribute name="alternateIdentifierType">
198
                                                <xsl:value-of select="./identifierType"/>
199
                                            </xsl:attribute>
200
                                            <xsl:value-of select="./identifier"/>
201
                                        </alternateIdentifier>
202
                                    </xsl:for-each>
203
                                </alternateIdentifiers>
204
                            </xsl:if>
205

  
206
                            <xsl:if test="$relatedIdentifiers or //relatedPubs/doi">
207
                                <relatedIdentifiers>
208
                                    <xsl:for-each select="$relatedIdentifiers">
209
                                        <relatedIdentifier>
210
                                            <xsl:attribute name="relatedIdentifierType">
211
                                                <xsl:value-of select="./relatedIdentifierType"/>
212
                                            </xsl:attribute>
213
                                            <xsl:if test="./relatedMetadataScheme">
214
                                                <xsl:attribute name="relatedMetadataScheme">
215
                                                  <xsl:value-of select="./relatedMetadataScheme"/>
216
                                                </xsl:attribute>
217
                                            </xsl:if>
218
                                            <xsl:attribute name="relationType">
219
                                                <xsl:value-of select="./relationType"/>
220
                                            </xsl:attribute>
221
                                            <xsl:if test="./schemeType">
222
                                                <xsl:attribute name="schemeType">
223
                                                  <xsl:value-of select="./schemeType"/>
224
                                                </xsl:attribute>
225
                                            </xsl:if>
226
                                            <xsl:if test="./schemeURI">
227
                                                <xsl:attribute name="schemeURI">
228
                                                  <xsl:value-of select="./schemeURI"/>
229
                                                </xsl:attribute>
230
                                            </xsl:if>
231
                                            <xsl:value-of select="./relatedIdentifier"/>
232
                                        </relatedIdentifier>
233
                                    </xsl:for-each>
234
                                </relatedIdentifiers>
235
                            </xsl:if>
236

  
237
                            <xsl:if test="$rights">
238
                                <rightsList>
239
                                    <xsl:for-each select="$rights">
240
                                        <rights>
241
                                            <xsl:if test="./rightsUri">
242
                                                <xsl:attribute name="rightsURI">
243
                                                  <xsl:value-of select="./rightsUri"/>
244
                                                </xsl:attribute>
245
                                            </xsl:if>
246
                                            <xsl:if test="./rights">
247
                                                <xsl:value-of select="./rights"/>
248
                                            </xsl:if>
249
                                        </rights>
250
                                    </xsl:for-each>
251
                                </rightsList>
252
                            </xsl:if>
253

  
254
                            <xsl:if test="$descriptions">
255
                                <descriptions>
256
                                    <xsl:for-each select="$descriptions">
257
                                        <description>
258
                                            <xsl:if test="./descriptionType">
259
                                                <xsl:attribute name="descriptionType">
260
                                                  <xsl:value-of select="./descriptionType"/>
261
                                                </xsl:attribute>
262
                                            </xsl:if>
263
                                            <xsl:if test="./lang">
264
                                                <xsl:attribute name="xml:lang">
265
                                                  <xsl:value-of select="./lang"/>
266
                                                </xsl:attribute>
267
                                            </xsl:if>
268
                                            <xsl:if test="./description">
269
                                                <xsl:value-of select="./description"/>
270
                                            </xsl:if>
271
                                        </description>
272
                                    </xsl:for-each>
273
                                </descriptions>
274
                            </xsl:if>
275

  
276
                            <xsl:for-each select="$dates">
277
                                <xsl:if test="./dateType = 'Available'">
278
                                    <xsl:variable name="varEmbargoEndDate"
279
                                        select="TransformationFunction:convertString($tf, normalize-space(./date), 'DateISO8601')"/>
280
                                    <xsl:if test="string-length($varEmbargoEndDate) > 0">
281
                                        <oaf:embargoenddate>
282
                                            <xsl:value-of select="$varEmbargoEndDate"/>
283
                                        </oaf:embargoenddate>
284
                                    </xsl:if>
285
                                </xsl:if>
286
                            </xsl:for-each>
287

  
288
                            <dr:CobjCategory>
289
                                <xsl:choose>
290
                                    <xsl:when test="$types">
291
                                        <xsl:choose>
292
                                            <xsl:when
293
                                                test="$types/schemaOrg = 'ScholarlyArticle' or $types/schemaOrg = 'Book' or $types/schemaOrg = 'Thesis' or $types/schemaOrg = 'Chapter' or $types/schemaOrg = 'PublicationIssue' or $types/schemaOrg = 'PublicationVolume'">
294
                                                <xsl:attribute name="type">
295
                                                  <xsl:value-of select="string('publication')"/>
296
                                                </xsl:attribute>
297
                                                <xsl:choose>
298
                                                  <xsl:when test="$types/bibtex = 'techreport'">
299
                                                  <xsl:value-of select="string('0017')"/>
300
                                                  </xsl:when>
301
                                                  <xsl:when
302
                                                  test="$types/schemaOrg = 'ScholarlyArticle'">
303
                                                  <xsl:value-of select="string('0001')"/>
304
                                                  </xsl:when>
305
                                                  <xsl:when test="$types/schemaOrg = 'Book'">
306
                                                  <xsl:value-of select="string('0002')"/>
307
                                                  </xsl:when>
308
                                                  <xsl:when test="$types/schemaOrg = 'Thesis'">
309
                                                  <xsl:value-of select="string('0041')"/>
310
                                                  </xsl:when>
311
                                                  <xsl:when test="$types/schemaOrg = 'Chapter'">
312
                                                  <xsl:value-of select="string('0013')"/>
313
                                                  </xsl:when>
314
                                                  <xsl:otherwise>
315
                                                  <xsl:value-of select="string('0038')"/>
316
                                                  </xsl:otherwise>
317
                                                </xsl:choose>
318
                                            </xsl:when>
319
                                            <xsl:when
320
                                                test="$types/schemaOrg = 'ImageObject' or $types/schemaOrg = 'MediaObject' or $types/schemaOrg = 'AudioObject' or $types/resourceTypeGeneral = 'Film' or $types/schemaOrg = 'Dataset'">
321
                                                <xsl:attribute name="type">
322
                                                  <xsl:value-of select="string('dataset')"/>
323
                                                </xsl:attribute>
324
                                                <xsl:choose>
325
                                                  <xsl:when test="$types/schemaOrg = 'ImageObject'">
326
                                                  <xsl:value-of select="string('0025')"/>
327
                                                  </xsl:when>
328
                                                  <xsl:when test="$types/schemaOrg = 'MediaObject'">
329
                                                  <xsl:value-of select="string('0033')"/>
330
                                                  </xsl:when>
331
                                                  <xsl:when test="$types/schemaOrg = 'AudioObject'">
332
                                                  <xsl:value-of select="string('0030')"/>
333
                                                  </xsl:when>
334
                                                  <xsl:when
335
                                                  test="$types/resourceTypeGeneral = 'Film'">
336
                                                  <xsl:value-of select="string('0024')"/>
337
                                                  </xsl:when>
338
                                                  <xsl:when test="$types/schemaOrg = 'Dataset'">
339
                                                  <xsl:value-of select="string('0021')"/>
340
                                                  </xsl:when>
341
                                                </xsl:choose>
342
                                            </xsl:when>
343
                                            <xsl:when test="$types/schemaOrg = 'SoftwareSourceCode'">
344
                                                <xsl:attribute name="type">
345
                                                  <xsl:value-of select="software"/>
346
                                                </xsl:attribute>
347
                                                <xsl:value-of select="string('0029')"/>
348
                                            </xsl:when>
349
                                            <xsl:when
350
                                                test="$types/schemaOrg = 'Event' or $types/resourceTypeGeneral = 'Model' or $types/schemaOrg = 'Collection'">
351
                                                <xsl:attribute name="type">
352
                                                  <xsl:value-of select="other"/>
353
                                                </xsl:attribute>
354
                                                <xsl:choose>
355
                                                  <xsl:when test="$types/schemaOrg = 'Event'">
356
                                                  <xsl:value-of select="string('0023')"/>
357
                                                  </xsl:when>
358
                                                  <xsl:when
359
                                                  test="$types/resourceTypeGeneral = 'Model'">
360
                                                  <xsl:value-of select="string('0027')"/>
361
                                                  </xsl:when>
362
                                                  <xsl:when test="$types/schemaOrg = 'Collection'">
363
                                                  <xsl:value-of select="string('0022')"/>
364
                                                  </xsl:when>
365
                                                </xsl:choose>
366
                                            </xsl:when>
367
                                            <xsl:otherwise>
368
                                                <xsl:attribute name="type">
369
                                                  <xsl:value-of select="'other'"/>
370
                                                </xsl:attribute>
371
                                                <xsl:value-of select="string('0020')"/>
372
                                            </xsl:otherwise>
373
                                        </xsl:choose>
374
                                    </xsl:when>
375
                                    <xsl:otherwise>
376
                                        <xsl:attribute name="type">
377
                                            <xsl:value-of select="string('publication')"/>
378
                                        </xsl:attribute>
379
                                        <xsl:value-of select="string('0038')"/>
380
                                    </xsl:otherwise>
381
                                </xsl:choose>
382
                            </dr:CobjCategory>
383

  
384
                            <xsl:variable name="varRefereed"
385
                                select="
386
                                    for $i in $types/*[local-name() = ('resourceTypeGeneral', 'schemaOrg', 'citeproc', 'bibtex', 'ris')]
387
                                    return
388
                                        TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/>
389
                            <xsl:choose>
390
                                <xsl:when test="count($varRefereed[. = '0001']) > 0">
391
                                    <oaf:refereed>
392
                                        <xsl:value-of select="'0001'"/>
393
                                    </oaf:refereed>
394
                                </xsl:when>
395
                                <xsl:when test="count($varRefereed[. = '0002']) > 0">
396
                                    <oaf:refereed>
397
                                        <xsl:value-of select="'0002'"/>
398
                                    </oaf:refereed>
399
                                </xsl:when>
400
                            </xsl:choose>
401

  
402

  
403
                            <oaf:dateAccepted>
404
                                <xsl:value-of
405
                                    select="TransformationFunction:convertString($tf, normalize-space($publicationYear), 'DateISO8601')"
406
                                />
407
                            </oaf:dateAccepted>
408

  
409

  
410

  
411
                            <!-- avoiding to check access rights 'synonyms' which are listed in dnet:access_modes  -->
412
                       <!--     <xsl:choose>
413
                                <xsl:when test="//awards/awardUri">
414
                                    <oaf:accessrights>OPEN</oaf:accessrights>
415
                                </xsl:when>
416
                                <xsl:otherwise> -->
417
                                    <oaf:accessrights>
418
                                        <xsl:choose>
419
                                            <xsl:when
420
                                                test="//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('OPEN', 'OPEN SOURCE')]">
421
                                                <xsl:value-of
422
                                                  select="TransformationFunction:convertString($tf, subsequence(//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('OPEN', 'OPEN SOURCE')], 1, 1), 'AccessRights')"
423
                                                />
424
                                            </xsl:when>
425
                                            <xsl:when
426
                                                test="//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('EMBARGO', '6MONTHS', '12MONTHS')]">
427
                                                <xsl:value-of
428
                                                  select="TransformationFunction:convertString($tf, subsequence(//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('EMBARGO', '6MONTHS', '12MONTHS')], 1, 1), 'AccessRights')"
429
                                                />
430
                                            </xsl:when>
431
                                            <xsl:when
432
                                                test="//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('RESTRICTED')]">
433
                                                <xsl:value-of
434
                                                  select="TransformationFunction:convertString($tf, subsequence(//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('RESTRICTED')], 1, 1), 'AccessRights')"
435
                                                />
436
                                            </xsl:when>
437
                                            <xsl:when
438
                                                test="//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('CLOSED', 'OTHER')]">
439
                                                <xsl:value-of
440
                                                  select="TransformationFunction:convertString($tf, subsequence(//rights/(., ../rightsUri)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('CLOSED', 'OTHER')], 1, 1), 'AccessRights')"
441
                                                />
442
                                            </xsl:when>
443
                                            <xsl:otherwise>
444
                                                <xsl:value-of
445
                                                  select="TransformationFunction:convertString($tf, subsequence(//rights/(., ../rightsUri), 1, 1), 'AccessRights')"
446
                                                />
447
                                            </xsl:otherwise>
448
                                        </xsl:choose>
449

  
450
                                    </oaf:accessrights>
451
                             <!--   </xsl:otherwise>
452
                            </xsl:choose>-->
453

  
454
                            <xsl:for-each
455
                                select="//rightsUri[starts-with(normalize-space(.), 'http') and matches(., '.*(/licenses|/publicdomain|unlicense.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*')]">
456
                                <oaf:license>
457
                                    <xsl:copy-of select="normalize-space(.)"/>
458
                                </oaf:license>
459
                            </xsl:for-each>
460

  
461
                            <oaf:language>
462
                                <xsl:value-of
463
                                    select="TransformationFunction:convert($tf, $language, 'Languages')"
464
                                />
465
                            </oaf:language>
466

  
467

  
468
                            <xsl:variable name="awards" select="//metadata/awards/award"/>
469
                            <xsl:variable name="varAKA" select="'aka_________::'"/>
470
                            <xsl:variable name="varARC" select="'arc_________::'"/>
471
                            <xsl:variable name="varCONICYT" select="'conicytf____::'"/>
472
                            <xsl:variable name="varDFG" select="'dfgf________::'"/>
473
                            <xsl:variable name="varFCT" select="'fct_________::'"/>
474
                            <xsl:variable name="varFWF" select="'fwf_________::'"/>
475
                            <xsl:variable name="varHRZZ" select="'irb_hr______::'"/>
476
                            <xsl:variable name="varMESTD" select="'mestd_______::'"/>
477
                            <xsl:variable name="varMIUR" select="'miur________::'"/>
478
                            <xsl:variable name="varMZOS" select="'irb_hr______::'"/>
479
                            <xsl:variable name="varNHMRC" select="'nhmrc_______::'"/>
480
                            <xsl:variable name="varNIH" select="'nih_________::'"/>
481
                            <xsl:variable name="varNSF" select="'nsf_________::'"/>
482
                            <xsl:variable name="varNWO" select="'nwo_________::'"/>
483
                            <xsl:variable name="varRCUK" select="'rcuk________::'"/>
484
                            <xsl:variable name="varUKRI" select="'ukri________::'"/>
485
                            <xsl:variable name="varSFI" select="'sfi_________::'"/>
486
                            <xsl:variable name="varSGOV" select="'sgov________::'"/>
487
                            <xsl:variable name="varSNSF" select="'snsf________::'"/>
488
                            <xsl:variable name="varTARA" select="'taraexp_____::'"/>
489
                            <xsl:variable name="varTUBITAK" select="'tubitakf____::'"/>
490
                            <xsl:variable name="varWT" select="'wt__________::'"/>
491
                            <xsl:variable name="varANR" select="'anr_________::'"/>
492
                            <xsl:for-each select="//attributes/fundingReferences">
493
                                <xsl:choose>
494
                                    <xsl:when
495
                                        test="ends-with(./funderIdentifier, '10.13039/501100000780') or starts-with(normalize-space(./awardUri), 'info:eu-repo/grantAgreement/EC/H2020')">
496
                                        <!--H2020-->
497

  
498

  
499
                                        <oaf:projectid>
500
                                            <xsl:value-of select="concat($varH2020, ./awardNumber)"
501
                                            />
502
                                        </oaf:projectid>
503

  
504
                                    </xsl:when>
505
                                    <xsl:when
506
                                        test="ends-with(./funderIdentifier, '10.13039/100011102') or starts-with(normalize-space(./awardUri), 'info:eu-repo/grantAgreement/EC/FP7')">
507
                                        <!-- FP7 -->
508

  
509
                                        <oaf:projectid>
510
                                            <xsl:value-of select="concat($varFP7, ./awardNumber)"/>
511
                                        </oaf:projectid>
512

  
513

  
514
                                    </xsl:when>
515
                                    <xsl:when
516
                                        test="ends-with(./funderIdentifier, '10.13039/501100001665') or contains(./funderName, 'Agence Nationale de la Recherche') or contains(./funderName, 'ANR')">
517
                                        <!-- ANR -->
518
                                        <oaf:projectId>
519
                                            <xsl:value-of select="concat($varANR, ./awardNumber)"/>
520
                                        </oaf:projectId>
521
                                    </xsl:when>
522
                                    <xsl:when
523
                                        test="ends-with(./funderIdentifier, '10.13039/501100002341') or contains(./funderName, 'Suomen Akatemia') or contains(./funderName, 'Academy of Finland')">
524
                                        <!-- AKA -->
525
                                        <oaf:projectId>
526
                                            <xsl:value-of select="concat($varAKA, ./awardNumber)"/>
527
                                        </oaf:projectId>
528
                                    </xsl:when>
529
                                    <xsl:when
530
                                        test="ends-with(./funderIdentifier, '10.13039/501100000923') or contains(./funderName, 'Australian Research Council')">
531
                                        <!-- ARC -->
532
                                        <oaf:projectId>
533
                                            <xsl:value-of select="concat($varARC, ./awardNumber)"/>
534
                                        </oaf:projectId>
535
                                    </xsl:when>
536
                                    <xsl:when
537
                                        test="ends-with(./funderIdentifier, '10.13039/501100002848') or contains(./funderName, 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(./funderName, 'CONICYT')">
538
                                        <!-- CONICYT -->
539
                                        <oaf:projectId>
540
                                            <xsl:value-of
541
                                                select="concat($varCONICYT, ./awardNumber)"/>
542
                                        </oaf:projectId>
543
                                    </xsl:when>
544
                                    <xsl:when
545
                                        test="ends-with(./funderIdentifier, '10.13039/501100001659') or contains(./funderName, 'Deutsche Forschungsgemeinschaft') or contains(./funderName, 'DFGH')">
546
                                        <!-- DFG -->
547
                                        <oaf:projectId>
548
                                            <xsl:value-of select="concat($varDFG, ./awardNumber)"/>
549
                                        </oaf:projectId>
550
                                    </xsl:when>
551
                                    <xsl:when
552
                                        test="ends-with(./funderIdentifier, '10.13039/501100000690') or contains(./funderName, 'Research Councils UK') or contains(./funderName, 'RCUK')">
553
                                        <!-- RCUK -->
554
                                        <oaf:projectId>
555
                                            <xsl:value-of select="concat($varUKRI, ./awardNumber)"/>
556
                                        </oaf:projectId>
557
                                    </xsl:when>
558
                                    <xsl:when
559
                                        test="ends-with(./funderIdentifier, '10.13039/100014013') or contains(./funderName, 'UK Research and Innovation') or contains(./funderName, 'UKRI')">
560
                                        <!-- RCUK -->
561
                                        <oaf:projectId>
562
                                            <xsl:value-of select="concat($varUKRI, ./awardNumber)"/>
563
                                        </oaf:projectId>
564
                                    </xsl:when>
565
                                    <xsl:when
566
                                        test="contains(./funderName, 'Ministerio de Economía y Competitividad') or contains(./funderName, 'Gobierno de Espana') or contains(./funderName, 'Ministry of Economy and Competitiveness')">
567
                                        <!-- SGOV -->
568
                                        <oaf:projectId>
569
                                            <xsl:value-of select="concat($varSGOV, ./awardNumber)"/>
570
                                        </oaf:projectId>
571
                                    </xsl:when>
572
                                    <xsl:when
573
                                        test="ends-with(./funderIdentifier, '10.13039/501100001711') or contains(./funderName, 'Swiss National Science Foundation') or contains(./funderName, 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung')">
574
                                        <!-- SNSF -->
575
                                        <oaf:projectId>
576
                                            <xsl:value-of select="concat($varSNSF, ./awardNumber)"/>
577
                                        </oaf:projectId>
578
                                    </xsl:when>
579
                                    <xsl:when
580
                                        test="ends-with(./funderIdentifier, '10.13039/501100004410') or contains(./funderName, 'Turkish National Science and Research Council') or (contains(./funderName, 'Türkiye Bilimsel ve Teknolojik Ara') and contains(./funderName, 'rma Kurumu'))">
581
                                        <!-- TUBITAK -->
582
                                        <oaf:projectId>
583
                                            <xsl:value-of
584
                                                select="concat($varTUBITAK, ./awardNumber)"/>
585
                                        </oaf:projectId>
586
                                    </xsl:when>
587
                                </xsl:choose>
588
                            </xsl:for-each>
589

  
590

  
591
                            <xsl:for-each select="distinct-values(//awards/awardUri)">
592
                                <xsl:if
593
                                    test="starts-with(normalize-space(.), 'info:eu-repo/grantAgreement/EC/H2020')">
594
                                    <xsl:variable name="projectId"
595
                                        select="substring-after(., 'info:eu-repo/grantAgreement/EC/H2020/')"/>
596
                                    <oaf:projectid>
597
                                        <xsl:attribute name="validationDate">
598
                                            <xsl:value-of select="$validationDate"/>
599
                                        </xsl:attribute>
600
                                        <xsl:value-of select="concat($varH2020, $projectId)"/>
601
                                    </oaf:projectid>
602
                                </xsl:if>
603

  
604
                                <xsl:if
605
                                    test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
606
                                    <oaf:projectid>
607
                                        <xsl:value-of
608
                                            select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"
609
                                        />
610
                                    </oaf:projectid>
611
                                </xsl:if>
612
                            </xsl:for-each>
613

  
614

  
615
                            <oaf:hostedBy>
616
                                <xsl:attribute name="name">
617
                                    <xsl:value-of select="$varHostedByOfficialName"/>
618
                                </xsl:attribute>
619
                                <xsl:attribute name="id">
620
                                    <xsl:value-of select="$varHostedByDataSourceId"/>
621
                                </xsl:attribute>
622
                            </oaf:hostedBy>
623
                            <oaf:collectedFrom>
624
                                <xsl:attribute name="name">
625
                                    <xsl:value-of select="$varOfficialName"/>
626
                                </xsl:attribute>
627
                                <xsl:attribute name="id">
628
                                    <xsl:value-of select="$varDataSourceId"/>
629
                                </xsl:attribute>
630
                            </oaf:collectedFrom>
631

  
632
                        </xsl:otherwise>
633
                    </xsl:choose>
634
                </resource>
635
            </metadata>
636
            <xsl:copy-of select="//*[local-name() = 'about']"/>
637
        </record>
638
    </xsl:template>
639

  
640

  
641

  
642
</xsl:stylesheet>
643
]]>
644

  
645
</CODE>
646
            </SCRIPT>
647
        </CONFIGURATION>
648
        <STATUS/>
649
        <SECURITY_PARAMETERS/>
650
    </BODY>
651
</RESOURCE_PROFILE>

Also available in: Unified diff