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