Project

General

Profile

1
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="33e8cc88-3b4a-4a68-b332-7cae8baad8dc_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2014-07-17T10:41:08+02:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>xslt_cleaning_zenodo_datacite</TITLE>
14
                <CODE><![CDATA[
15

    
16

    
17
                    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
18
                        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19
                        xmlns:oaf="http://namespace.openaire.eu/oaf"
20
                        xmlns:dr="http://www.driver-repository.eu/namespace/dr"
21
                        xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
22
                        extension-element-prefixes="TransformationFunction"
23
                        exclude-result-prefixes="TransformationFunction">
24

    
25
                        <xsl:param name="varOfficialName"/>
26
                        <xsl:param name="varDsType"/>
27
                        <xsl:param name="varDataSourceId"/>
28
                        <xsl:param name="varFP7" select="'corda_______::'"/>
29
                        <xsl:param name="varH2020" select="'corda__h2020::'"/>
30
                        <xsl:param name="varAKA" select = "'aka_________::'"/>
31
                        <xsl:param name="varARC" select = "'arc_________::'"/>
32
                        <xsl:param name="varCONICYT" select = "'conicytf____::'"/>
33
                        <xsl:param name="varDFG" select = "'dfgf________::'"/>
34
                        <xsl:param name="varFCT" select = "'fct_________::'"/>
35
                        <xsl:param name="varFWF" select = "'fwf_________::'"/>
36
                        <xsl:param name="varGSRT" select = "'gsrt________::'"/>
37
                        <xsl:param name="varHRZZ" select = "'irb_hr______::'"/>    <!-- HRZZ not found -->
38
                        <xsl:param name="varINNOVIRIS" select = "'innoviris___::'"/>
39
                        <xsl:param name="varMESTD" select = "'mestd_______::'"/>
40
                        <xsl:param name="varMIUR" select = "'miur________::'"/>
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="varUKRI" select = "'ukri________::'"/>
47
                        <xsl:param name="varRIF" select = "'rif_________::'"/>
48
                        <xsl:param name="varRSF" select = "'rsf_________::'"/>
49
                        <xsl:param name="varSFI" select ="'sfi_________::'"/>
50
                        <xsl:param name="varSGOV" select = "'sgov________::'"/>     <!-- SGOV to be added, awaiting DOI from Pilar, found project ids not in CSV list? -->
51
                        <xsl:param name="varSNSF" select = "'snsf________::'"/>
52
                        <xsl:param name="varTARA" select = "'taraexp_____::'"/>     <!-- TARA to be added, awaiting DOI from André -->
53
                        <xsl:param name="varTUBITAK" select = "'tubitakf____::'"/>
54
                        <xsl:param name="varWT" select = "'wt__________::'"/>
55

    
56

    
57
                        <xsl:param name="index" select="0"/>
58
                        <xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
59

    
60

    
61
                        <xsl:template match="/">
62
                            <xsl:variable name="datasourcePrefix"
63
                                select="normalize-space(//oaf:datasourceprefix)"/>
64
                            <xsl:call-template name="validRecord"/>
65
                        </xsl:template>
66

    
67

    
68
                        <xsl:template name="validRecord">
69
                            <record>
70
                                <xsl:copy-of select="//*[local-name() = 'header']"/>
71

    
72
                                <metadata>
73

    
74
                                    <!--
75
                    <xsl:copy-of select="//*[local-name() = 'metadata']/*[local-name() = 'resource']" />
76
                    -->
77

    
78
                                    <xsl:for-each
79
                                        select="//*[local-name() = ('metadata', 'payload')]/*[local-name() = 'resource']">
80
                                        <xsl:copy>
81

    
82
                                            <xsl:copy-of
83
                                                select="//*[local-name() = ('metadata', 'payload')]/*[local-name() = 'resource']/*"/>
84

    
85
<!--
86
                                            <xsl:if
87
                                                test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])">
88
                                                <xsl:element name="alternateIdentifiers"
89
                                                  namespace="http://www.openarchives.org/OAI/2.0/">
90
                                                  <xsl:for-each
91
                                                  select="//*[local-name()='resource']/*[local-name()='identifier'][@identifierType='DOI' or @identifierType='Handle' or @identifierType='URN']">
92
                                                  <xsl:element name="alternateIdentifier"
93
                                                  namespace="http://www.openarchives.org/OAI/2.0/">
94
                                                  <xsl:attribute name="alternateIdentifierType">
95
                                                  <xsl:value-of select="'URL'"/>
96
                                                  </xsl:attribute>
97
                                                  <xsl:if test=".[@identifierType='DOI']">
98
                                                  <xsl:value-of
99
                                                  select="concat('http://dx.doi.org/', .)"/>
100
                                                  </xsl:if>
101
                                                  <xsl:if test=".[@identifierType='Handle']">
102
                                                  <xsl:value-of
103
                                                  select="concat('http://hdl.handle.net/', .)"/>
104
                                                  </xsl:if>
105
                                                  <xsl:if test=".[@identifierType='URN']">
106
                                                  <xsl:value-of
107
                                                  select="concat('http://nbn-resolving.org/', .)"/>
108
                                                  </xsl:if>
109
                                                  </xsl:element>
110
                                                  </xsl:for-each>
111
                                                </xsl:element>
112
                                            </xsl:if>
113
-->
114

    
115
                                        </xsl:copy>
116
                                    </xsl:for-each>
117

    
118

    
119

    
120
                                    <xsl:if test="//*[local-name()='date']/@dateType='Available'">
121
                                        <xsl:variable name="varEmbargoEndDate"
122
                                            select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/>
123
                                        <xsl:choose>
124
                                            <xsl:when test="string-length($varEmbargoEndDate) > 0">
125
                                                <oaf:embargoenddate>
126
                                                  <xsl:value-of select="$varEmbargoEndDate"/>
127
                                                </oaf:embargoenddate>
128
                                            </xsl:when>
129
                                            <xsl:otherwise>
130
                                                <oaf:skip>
131
                                                  <xsl:value-of
132
                                                  select="TransformationFunction:skipRecord($tf, $index)"
133
                                                  />
134
                                                </oaf:skip>
135
                                            </xsl:otherwise>
136
                                        </xsl:choose>
137
                                    </xsl:if>
138

    
139
                                    <dr:CobjCategory>
140
                                         <xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, //*[local-name()='resourceType']/@resourceTypeGeneral, 'TextTypologies')"/>
141
                                         <xsl:variable name="varSuperType" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/>
142
                                         <!--
143
                                        <xsl:value-of
144
                                            select="TransformationFunction:convertString($tf, //*[local-name()='resourceType']/@resourceTypeGeneral, 'TextTypologies')"
145
                                        />
146
                                        -->
147
                                         <xsl:attribute name="type">
148
                                                  <xsl:value-of select="$varSuperType"/>
149
                                         </xsl:attribute>
150
                                        <xsl:value-of select="$varCobjCategory"/>
151
                                    </dr:CobjCategory>
152

    
153
<!-- review status -->
154
<!-- Zenodo  -->
155
<xsl:variable name="varRefereedConvt" select="for $i in (//*[local-name()='resourceType']/(., @resourceTypeGeneral), //*[local-name()='version'])
156
                                                                           return TransformationFunction:convertString($tf, normalize-space($i), 'ReviewLevels')"/>
157
<xsl:variable name="varRefereedIdntf" select="//*[local-name()=('identifier', 'alternateIdentifier')][matches(lower-case(.), '.*([\s\-\.\\_/:]|%[2-7][0-9A-F])pre([\s\-\.\\_/:]|%[2-7][0-9A-F])?prints?([\s\-\.\\_/:%].*|$)')]/'0002' "/>
158
<xsl:variable name="varRefereedReltn" select="//*[local-name()='relatedIdentifier'][./@relationType/lower-case(.)='isreviewedby']/'0001' "/>
159

    
160
<xsl:variable name="varRefereedVersn" select="(//*[local-name()='version'][matches(lower-case(.), '.*peer[\s\-\.\\_/:%]?reviewed.*')]/'0001',
161
                                                                 //*[local-name()='version'][matches(normalize-space(lower-case(.)), '^(v|vs|version|rel|release)?[\s\.\-_]*0$')]/'0002',
162
                                                                 //*[local-name()='version'][matches(lower-case(.), '(^|[\s\-\.\\_/:%].*)(beta|draft|trial|test)([\s\-\.\\_/:%].*|$)')]/'0002',
163
                                                                 //*[local-name()='version'][matches(lower-case(.), '.*submi(tted|ssion|ttal).*')]/'0002') "/>
164

    
165
<xsl:variable name="varRefereedOther" select="(//*[local-name()='publisher'][matches(lower-case(.), '.*[\s\-\.\\_/:%]pre[\s\-\.\\_/:%]?prints?([\s\-\.\\_/:%].*|$)')]/'0002',
166
                                                  //*[local-name()='description'][matches(lower-case(.), '^peer[\s\-\.\\_/:%]?reviewed$')]/'0001',
167
                                                  //*[local-name()='description'][matches(lower-case(.), '^pre[\s\-\.\\_/:%]?prints?$')]/'0002') "/>
168
<xsl:variable name="varRefereed" select="($varRefereedConvt, $varRefereedIdntf, $varRefereedReltn, $varRefereedVersn, $varRefereedOther)"/>
169
<xsl:choose>
170
     <xsl:when test="count($varRefereed[. = '0001']) > 0">
171
          <oaf:refereed>
172
               <xsl:value-of select="'0001'"/>
173
          </oaf:refereed>
174
     </xsl:when>
175
     <xsl:when test="count($varRefereed[. = '0002']) > 0">
176
               <oaf:refereed>
177
                    <xsl:value-of select="'0002'"/>
178
               </oaf:refereed>
179
     </xsl:when>
180
</xsl:choose>
181

    
182

    
183
                                    <oaf:dateAccepted>
184
                                        <xsl:value-of
185
                                            select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"
186
                                        />
187
                                    </oaf:dateAccepted>
188
                                    <xsl:choose>
189

    
190
                                        <xsl:when
191
                                            test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')]">
192
                                            <oaf:accessrights>
193
                                                <xsl:value-of
194
                                                  select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"
195
                                                />
196
                                            </oaf:accessrights>
197
                                        </xsl:when>
198
                                        <xsl:when
199
                                            test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]">
200
                                            <oaf:accessrights>
201
                                                <xsl:value-of
202
                                                  select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"
203
                                                />
204
                                            </oaf:accessrights>
205
                                        </xsl:when>
206
                                        <xsl:otherwise>
207
                                            <xsl:choose>
208
                                                <xsl:when
209
                                                  test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org')]">
210
                                                  <oaf:accessrights>
211
                                                  <xsl:text>OPEN</xsl:text>
212
                                                  </oaf:accessrights>
213
                                                </xsl:when>
214
                                                <xsl:otherwise>
215
                                                  <oaf:accessrights>
216
                                                  <xsl:text>CLOSED</xsl:text>
217
                                                  </oaf:accessrights>
218
                                                </xsl:otherwise>
219
                                            </xsl:choose>
220
                                        </xsl:otherwise>
221
                                    </xsl:choose>
222

    
223
                                    <oaf:language>
224
                                        <xsl:value-of
225
                                            select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')"
226
                                        />
227
                                    </oaf:language>
228

    
229
                     <!--
230
                    <xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
231
                    <oaf:embargoenddate>
232
                    <xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
233
                    </oaf:embargoenddate>
234
                    </xsl:if>
235
                    -->
236

    
237
                                    <xsl:for-each select="//*[local-name()='nameIdentifier'][contains(., 'info:eu-repo/grantAgreement/')], //*[local-name()='fundingReference']/*[local-name()='awardNumber']">
238
                    <xsl:choose>
239
                    <!--
240
                                        <xsl:when
241
                                            test="string-length(substring-after(normalize-space(.), 'info:eu-repo/grantAgreement/EC/FP7/')) = 6">
242
                                            <oaf:projectid>
243
                                                <xsl:value-of
244
                                                  select="TransformationFunction:regExpr($tf, normalize-space(.), $varFP7, 's/^(.*info:eu-repo\/grantAgreement\/EC\/FP7\/)//gm')"
245
                                                />
246
                                            </oaf:projectid>
247
                                        </xsl:when>
248
            -->
249
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/ec/fp7/\d\d\d\d\d\d.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/100011102']">
250
                <oaf:projectid>
251
                    <xsl:value-of select="concat($varFP7, replace(normalize-space(.), 'info:eu-repo/grantagreement/ec/fp7/(\d\d\d\d\d\d).*$', '$1', 'i'))"/>
252
                </oaf:projectid>
253
            </xsl:when>
254
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/ec/h2020/(\d\d\d\d\d\d).*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100000780']">
255
                <oaf:projectid>
256
                    <xsl:value-of select="concat($varH2020, replace(normalize-space(.), 'info:eu-repo/grantagreement/ec/h2020/(\d\d\d\d\d\d).*$', '$1', 'i'))"/>
257
                </oaf:projectid>
258
            </xsl:when>
259
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/aka/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100002341']">
260
                <oaf:projectid>
261
                    <xsl:value-of select="concat($varAKA, replace(normalize-space(.), 'info:eu-repo/grantagreement/aka/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
262
                </oaf:projectid>
263
            </xsl:when>
264
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/arc/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100000923']">
265
                <oaf:projectid>
266
                    <xsl:value-of select="concat($varARC, replace(normalize-space(.), 'info:eu-repo/grantagreement/arc/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
267
                </oaf:projectid>
268
            </xsl:when>
269
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/conicyt/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100002848']">
270
                <oaf:projectid>
271
                    <xsl:value-of select="concat($varCONICYT, replace(normalize-space(.), 'info:eu-repo/grantagreement/conicyt/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
272
                </oaf:projectid>
273
            </xsl:when>
274
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/dfg/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100001659']">
275
                <oaf:projectid>
276
                    <xsl:value-of select="concat($varDFG, replace(normalize-space(.), 'info:eu-repo/grantagreement/dfg/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
277
                </oaf:projectid>
278
            </xsl:when>
279
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/fct/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100001871']">
280
                <oaf:projectid>
281
                    <xsl:value-of select="concat($varFCT, replace(normalize-space(.), 'info:eu-repo/grantagreement/fct/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
282
                </oaf:projectid>
283
            </xsl:when>
284
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/fwf/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100002428']">
285
                <oaf:projectid>
286
                    <xsl:value-of select="concat($varFWF, replace(normalize-space(.), 'info:eu-repo/grantagreement/fwf/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
287
                </oaf:projectid>
288
            </xsl:when>
289

    
290
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/gsrt/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100003448']">
291
                <oaf:projectid>
292
                    <xsl:value-of select="concat($varGSRT, replace(normalize-space(.), 'info:eu-repo/grantagreement/gsrt/.*?/([^/]*)[/$]', '$1', 'i'))"/>
293
                </oaf:projectid>
294
            </xsl:when>
295

    
296
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/hrzz/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100004488']">
297
                <oaf:projectid>
298
                    <xsl:value-of select="concat($varHRZZ, replace(normalize-space(.), 'info:eu-repo/grantagreement/hrzz/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
299
                </oaf:projectid>
300
            </xsl:when>
301
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/mestd/.*', 'i')">
302
                <oaf:projectid>
303
                    <xsl:value-of select="concat($varMESTD, replace(normalize-space(.), 'info:eu-repo/grantagreement/mestd/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
304
                </oaf:projectid>
305
            </xsl:when>
306
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/mzos/.*', 'i')">
307
                <oaf:projectid>
308
                    <xsl:value-of select="concat($varMZOS, replace(normalize-space(.), 'info:eu-repo/grantagreement/mzos/.*?/([^/]*)(/.*)?$', '$1', 'i'))"/>
309
                </oaf:projectid>
310
            </xsl:when>
311
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/nhmrc/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100000925']">
312
                <oaf:projectid>
313
                    <xsl:value-of select="concat($varNHMRC, replace(normalize-space(.), '(info:eu-repo/grantagreement/nhmrc/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
314
                </oaf:projectid>
315
            </xsl:when>
316
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/nih/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/100000002']">
317
                <oaf:projectid>
318
                    <xsl:value-of select="concat($varNIH, replace(normalize-space(.), '(info:eu-repo/grantagreement/nih/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
319
                </oaf:projectid>
320
            </xsl:when>
321
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/nsf/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/100000001']">
322
                <oaf:projectid>
323
                    <xsl:value-of select="concat($varNSF, replace(normalize-space(.), '(info:eu-repo/grantagreement/nsf/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
324
                </oaf:projectid>
325
            </xsl:when>
326
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/nwo/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100003246']">
327
                <oaf:projectid>
328
                    <xsl:value-of select="concat($varNWO, replace(normalize-space(.), '(info:eu-repo/grantagreement/nwo/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
329
                </oaf:projectid>
330
            </xsl:when>
331
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/rcuk/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100000690']">
332
                <oaf:projectid>
333
                    <xsl:value-of select="concat($varUKRI, replace(normalize-space(.), '(info:eu-repo/grantagreement/rcuk/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
334
                </oaf:projectid>
335
            </xsl:when>
336
<xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/ukri/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/100014013']">
337
                <oaf:projectid>
338
                    <xsl:value-of select="concat($varUKRI, replace(normalize-space(.), '(info:eu-repo/grantagreement/ukri/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
339
                </oaf:projectid>
340
            </xsl:when>
341
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/sfi/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100001602']">
342
                <oaf:projectid>
343
                    <xsl:value-of select="concat($varSFI, replace(normalize-space(.), '(info:eu-repo/grantagreement/sfi/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
344
                </oaf:projectid>
345
            </xsl:when>
346
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/sgov/.*', 'i')">
347
                <oaf:projectid>
348
                    <xsl:value-of select="concat($varSGOV, replace(normalize-space(.), '(info:eu-repo/grantagreement/sgov/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
349
                </oaf:projectid>
350
            </xsl:when>
351
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/snsf/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100001711']">
352
                <oaf:projectid>
353
                    <xsl:value-of select="concat($varSNSF, replace(normalize-space(.), '(info:eu-repo/grantagreement/snsf/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
354
                </oaf:projectid>
355
            </xsl:when>
356
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/tara/.*', 'i')">
357
                <oaf:projectid>
358
                    <xsl:value-of select="concat($varTARA, replace(normalize-space(.), '(info:eu-repo/grantagreement/tara/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
359
                </oaf:projectid>
360
            </xsl:when>
361
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/tubitak/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/501100004410']">
362
                <oaf:projectid>
363
                    <xsl:value-of select="concat($varTUBITAK, replace(normalize-space(.), '(info:eu-repo/grantagreement/tubitak/.*?/)([^/]*)(/.*)*', '$2', 'i'))"/>
364
                </oaf:projectid>
365
            </xsl:when>
366
            <xsl:when test="matches(normalize-space(.), 'info:eu-repo/grantagreement/wt/.*', 'i') or ../*[local-name() = 'funderIdentifier' and . = '10.13039/100004440']">
367
                <oaf:projectid>
368
                    <xsl:value-of select="concat($varWT, replace(normalize-space(.), '(info:eu-repo/grantagreement/wt/.*?/)([^/]*)(/.*)?', '$2', 'i'))"/>
369
                </oaf:projectid>
370
            </xsl:when>
371
                    </xsl:choose>
372
                                    </xsl:for-each>
373

    
374
                                    <xsl:for-each select="//*[local-name()='relatedIdentifier']">
375
                                        <xsl:if
376
                                            test="starts-with(./text(), 'https://zenodo.org/communities/')">
377
                                            <oaf:concept>
378
                                               <xsl:attribute name="id">
379
                                                  <xsl:value-of select="./text()"/>
380
                                               </xsl:attribute>
381
                                            </oaf:concept>
382
                                        </xsl:if>
383
                                    </xsl:for-each>
384

    
385
                                    <oaf:hostedBy>
386
                                        <xsl:attribute name="name">
387
                                            <xsl:value-of select="$varOfficialName"/>
388
                                        </xsl:attribute>
389
                                        <xsl:attribute name="id">
390
                                            <xsl:value-of select="$varDataSourceId"/>
391
                                        </xsl:attribute>
392
                                    </oaf:hostedBy>
393
                                    <oaf:collectedFrom>
394
                                        <xsl:attribute name="name">
395
                                            <xsl:value-of select="$varOfficialName"/>
396
                                        </xsl:attribute>
397
                                        <xsl:attribute name="id">
398
                                            <xsl:value-of select="$varDataSourceId"/>
399
                                        </xsl:attribute>
400
                                    </oaf:collectedFrom>
401
                                </metadata>
402
                                <xsl:copy-of select="//*[local-name() = 'about']"/>
403
                            </record>
404
                            <!--  </xsl:template> -->
405

    
406

    
407

    
408

    
409

    
410
                        </xsl:template>
411

    
412

    
413

    
414

    
415

    
416
                        <!--
417
                    <xsl:template match="//*[local-name()='language']">
418
                    <oaf:language>
419
                    <xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
420
                    </oaf:language>
421
                    </xsl:template>
422
                    -->
423
                    </xsl:stylesheet>
424

    
425
]]></CODE>
426
            </SCRIPT>
427
        </CONFIGURATION>
428
        <STATUS/>
429
        <SECURITY_PARAMETERS/>
430
    </BODY>
431
</RESOURCE_PROFILE>
(60-60/62)