1 |
41660
|
jochen.sch
|
<RESOURCE_PROFILE>
|
2 |
|
|
<HEADER>
|
3 |
|
|
<RESOURCE_IDENTIFIER value="9cb0ed27-005c-4355-beff-f8e9a23c5a08_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4 |
|
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5 |
|
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6 |
|
|
<RESOURCE_URI value=""/>
|
7 |
|
|
<DATE_OF_CREATION value="2016-02-17T15:54:56+00:00"/>
|
8 |
|
|
</HEADER>
|
9 |
|
|
<BODY>
|
10 |
|
|
<CONFIGURATION>
|
11 |
|
|
<IMPORTED/>
|
12 |
|
|
<SCRIPT>
|
13 |
|
|
<TITLE>xslt_dc2oaf_narcis</TITLE>
|
14 |
|
|
<CODE><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1"
|
15 |
|
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
16 |
|
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
17 |
|
|
xmlns:oaf="http://namespace.openaire.eu/oaf"
|
18 |
|
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
19 |
|
|
xmlns:transformExt="http://namespace.openaire.eu/java/org.apache.commons.codec.digest.DigestUtils"
|
20 |
|
|
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy"
|
21 |
|
|
extension-element-prefixes="transformExt TransformationFunction"
|
22 |
|
|
exclude-result-prefixes="transformExt TransformationFunction" >
|
23 |
|
|
<xsl:output indent="yes" omit-xml-declaration="yes"/>
|
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 |
|
|
|
31 |
|
|
<xsl:param name="repoCode" select="substring-before(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], ':')"/>
|
32 |
|
|
|
33 |
|
|
<xsl:param name="index" select="0"/>
|
34 |
|
|
<xsl:param name="transDate" select="current-dateTime()"/>
|
35 |
|
|
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
|
36 |
|
|
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
<xsl:variable name="vCodes">
|
40 |
|
|
<codes>
|
41 |
|
|
<code key="uva" value="od_______323" id="opendoar____::323" name="Universiteit van Amsterdam Digital Academic Repository"/>
|
42 |
|
|
<code key="uvapub" value="od_______323" id="opendoar____::323" name="Universiteit van Amsterdam Digital Academic Repository"/>
|
43 |
|
|
<code key="cwi" value="od______2358" id="opendoar____::2358" name="Repository CWI Amsterdam"/> <!-- CWI -->
|
44 |
|
|
<code key="eur" value="od______1113" id="opendoar____::1113" name="Erasmus University Institutional Repository"/>
|
45 |
|
|
<code key="wur" value="od_______370" id="opendoar____::370" name="Wageningen Yield"/>
|
46 |
|
|
<code key="uu" value="od_______101" id="opendoar____::101" name="Utrecht University Repository"/>
|
47 |
|
|
<code key="ru" value="od______1236" id="opendoar____::1236" name="Radboud Repository"/> <!-- Radboud -->
|
48 |
|
|
<code key="run" value="od______1236" id="opendoar____::1236" name="Radboud Repository"/> <!-- Radboud -->
|
49 |
|
|
<code key="uvt" value="od_______550" id="opendoar____::550" name="Tilburg University Repository"/> <!-- Tilburg -->
|
50 |
|
|
<code key="aup" value="od________19" id="opendoar____::19" name="Amsterdam University Press Publications"/> <!-- amsterdam univ. press -->
|
51 |
|
|
<code key="rug" value="od_______189" id="opendoar____::189" name="University of Groningen Digital Archive"/> <!-- groningen -->
|
52 |
|
|
<code key="dans" value="r384e1237760" id="re3data_____::r3d100010214" name="EASY"/> <!--easy -->
|
53 |
|
|
<code key="differ" value="differ______" id="openaire____::75ee19e2-ff9e-47f7-bed6-2e3ee23e2b49" name="Dutch Institute for Fundamental Energy Research"/>
|
54 |
|
|
<code key="kit" value="od______1423" id="opendoar____::1423" name="Search4Dev"/> <!-- search4dev -->
|
55 |
|
|
<code key="ul" value="od_______202" id="opendoar____::202" name="Leiden University Repository"/> <!-- leiden -->
|
56 |
|
|
<code key="um" value="od________83" id="opendoar____::83" name="UM Publications"/>
|
57 |
|
|
<code key="knaw" value="od______1476" id="opendoar____::1476" name="KNAW Repository"/>
|
58 |
|
|
<code key="vu" value="od_______369" id="opendoar____::369" name="DSpace at VU"/>
|
59 |
|
|
<code key="ut" value="od_______354" id="opendoar____::354" name="Universiteit Twente Repository"/>
|
60 |
|
|
<code key="hbo" value="hbo_________" id="openaire____::79c8217f-00ee-4902-9743-9e11b4970c60" name="HBO Kennisbank"/>
|
61 |
|
|
<code key="kim" value="kim_________" id="openaire____::b1b15b72-bf0b-4f91-9f95-dab2e43d3eaa" name="Publicaties KiM"/>
|
62 |
|
|
<code key="nivel" value="nivel_____nl" id="driver______::daf0542d-1ef5-4f9d-80f1-62849b92aefa" name="NIVEL publications"/>
|
63 |
|
|
<code key="ntrl" value="od_______913" id="opendoar____::913" name="Naturalis Publications"/>
|
64 |
|
|
<code key="nyenrode" value="nyenrode____" id="openaire____::e57352f3-516b-42cb-b666-2480233c6513" name="Publications of the University Nyenrode"/>
|
65 |
|
|
<code key="ou" value="od_______233" id="opendoar____::233" name="DSpace at Open Universiteit Nederland "/>
|
66 |
|
|
<code key="ptu" value="ptu_________" id="openaire____::openaire____::f834f1fe-8198-4929-ac0b-b1c1bf166f38" name="Protestantse Theologische Universiteit"/>
|
67 |
|
|
<code key="rivm" value="od_______881" id="opendoar____::881" name="Web-based Archive of RIVM Publications"/>
|
68 |
|
|
<code key="scp" value="scp_________" id="openaire____::088a0087-4bc6-4c38-a052-b446c3b225a7" name="Sociaal en Cultureel Planbureau"/>
|
69 |
|
|
<code key="swov" value="swov________" id="openaire____::06d89df2-b613-4989-9dc3-f60f2fc593f6" name="Stichting Wetenschappelijk Onderzoek Verkeersveiligheid (SWOV) Library Repository"/>
|
70 |
|
|
<code key="tno" value="tno_________" id="openaire____::58fd0ad2-c476-11e5-80b3-0021e9e777ac" name="TNO Repository - hosted by TU Delft Library"/>
|
71 |
|
|
<code key="tue" value="od_______567" id="opendoar____::567" name="Repository TU/e"/>
|
72 |
|
|
<code key="tuk" value="tuk_________" id="openaire____::df55d991-1ebb-459c-aed6-559bcbb1d277::" name="Theological University Kampen"/>
|
73 |
|
|
<code key="uvh" value="uvh_______nl" id="driver______::a422c38b-73de-44bf-a340-a4fd5f0817ea" name="Universiteit voor Humanistiek"/>
|
74 |
|
|
<code key="tua" value="tua_________" id="openaire____::cd073e1e-2fe9-4ea7-aea5-dc6855c347f7" name="Theological University Apeldoorn"/>
|
75 |
|
|
<code key="tud" value="od_______571" id="opendoar____::571" name="TU Delft Repository"/>
|
76 |
|
|
<code key="wodc" value="wodc______nl" id="driver______::03c60250-9d65-44fe-85d3-23503b3303af" name="WODC Repository Ministerie van Veiligheid en Justitie"/>
|
77 |
|
|
<code key="unesco" value="unesco___ihe" id="2877c7c4-b57a-4f62-9c16-d7faa5b0b98b" name="UNESCO-IHE Institute for Water Education"/>
|
78 |
|
|
</codes>
|
79 |
|
|
</xsl:variable>
|
80 |
|
|
<!-- not considered
|
81 |
|
|
hbo added
|
82 |
|
|
tno added
|
83 |
|
|
differ added
|
84 |
|
|
nyenrode added
|
85 |
|
|
beeldengeluis todo, not yet found in metadata
|
86 |
|
|
philips todo, not yet found in metadata
|
87 |
|
|
scp added
|
88 |
|
|
swov added
|
89 |
|
|
tuk added
|
90 |
|
|
tua added
|
91 |
|
|
ptu added
|
92 |
|
|
ut_restricted ? merge with ut?
|
93 |
|
|
nda
|
94 |
|
|
neyenrode
|
95 |
|
|
-->
|
96 |
|
|
<xsl:key name="kCodeByName" match="code" use="string(@key)"/>
|
97 |
|
|
|
98 |
|
|
|
99 |
|
|
<xsl:template name="terminate">
|
100 |
|
|
<xsl:message terminate="yes">
|
101 |
|
|
record is not compliant, transformation is interrupted.
|
102 |
|
|
</xsl:message>
|
103 |
|
|
</xsl:template>
|
104 |
|
|
|
105 |
|
|
<xsl:template match="/">
|
106 |
|
|
<record>
|
107 |
|
|
<xsl:apply-templates select="//*[local-name() = 'header']" />
|
108 |
|
|
<metadata>
|
109 |
|
|
<xsl:call-template name="allElements">
|
110 |
|
|
<xsl:with-param name="sourceElement" select="//dc:title"/>
|
111 |
|
|
<xsl:with-param name="targetElement" select="'dc:title'"/>
|
112 |
|
|
</xsl:call-template>
|
113 |
|
|
<xsl:call-template name="allElements">
|
114 |
|
|
<xsl:with-param name="sourceElement" select="//dc:creator"/>
|
115 |
|
|
<xsl:with-param name="targetElement" select="'dc:creator'"/>
|
116 |
|
|
</xsl:call-template>
|
117 |
|
|
<xsl:call-template name="allElements">
|
118 |
|
|
<xsl:with-param name="sourceElement" select="//dc:contributor"/>
|
119 |
|
|
<xsl:with-param name="targetElement" select="'dc:contributor'"/>
|
120 |
|
|
</xsl:call-template>
|
121 |
|
|
<xsl:call-template name="allElements">
|
122 |
|
|
<xsl:with-param name="sourceElement" select="//dc:description"/>
|
123 |
|
|
<xsl:with-param name="targetElement" select="'dc:description'"/>
|
124 |
|
|
</xsl:call-template>
|
125 |
|
|
<xsl:call-template name="allElements">
|
126 |
|
|
<xsl:with-param name="sourceElement" select="//dc:subject"/>
|
127 |
|
|
<xsl:with-param name="targetElement" select="'dc:subject'"/>
|
128 |
|
|
</xsl:call-template>
|
129 |
|
|
<xsl:call-template name="allElements">
|
130 |
|
|
<xsl:with-param name="sourceElement" select="//dc:publisher"/>
|
131 |
|
|
<xsl:with-param name="targetElement" select="'dc:publisher'"/>
|
132 |
|
|
</xsl:call-template>
|
133 |
|
|
<xsl:call-template name="allElements">
|
134 |
|
|
<xsl:with-param name="sourceElement" select="//dc:source"/>
|
135 |
|
|
<xsl:with-param name="targetElement" select="'dc:source'"/>
|
136 |
|
|
</xsl:call-template>
|
137 |
|
|
<dc:language>
|
138 |
|
|
<xsl:value-of select="TransformationFunction:convertString($tf, //dc:language, 'Languages')"/>
|
139 |
|
|
</dc:language>
|
140 |
|
|
<xsl:call-template name="allElements">
|
141 |
|
|
<xsl:with-param name="sourceElement" select="//dc:rights"/>
|
142 |
|
|
<xsl:with-param name="targetElement" select="'dc:rights'"/>
|
143 |
|
|
</xsl:call-template>
|
144 |
|
|
<xsl:call-template name="allElements">
|
145 |
|
|
<xsl:with-param name="sourceElement" select="//dc:relation"/>
|
146 |
|
|
<xsl:with-param name="targetElement" select="'dc:relation'"/>
|
147 |
|
|
</xsl:call-template>
|
148 |
|
|
<xsl:if test="not(//dc:identifier[starts-with(., 'http')])">
|
149 |
|
|
<xsl:call-template name="terminate"/>
|
150 |
|
|
</xsl:if>
|
151 |
|
|
<xsl:call-template name="allElements">
|
152 |
|
|
<xsl:with-param name="sourceElement" select="//dc:identifier[starts-with(., 'http')]"/>
|
153 |
|
|
<xsl:with-param name="targetElement" select="'dc:identifier'"/>
|
154 |
|
|
</xsl:call-template>
|
155 |
|
|
<xsl:for-each select="//dc:relation">
|
156 |
|
|
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
|
157 |
|
|
<oaf:projectid>
|
158 |
|
|
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
159 |
|
|
</oaf:projectid>
|
160 |
|
|
</xsl:if>
|
161 |
|
|
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
|
162 |
|
|
<oaf:projectid>
|
163 |
|
|
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
164 |
|
|
</oaf:projectid>
|
165 |
|
|
</xsl:if>
|
166 |
|
|
</xsl:for-each>
|
167 |
|
|
|
168 |
|
|
|
169 |
|
|
<!--
|
170 |
|
|
<xsl:if test="not(//didl:Component/didl:Resource[@mimeType='application/pdf'])">
|
171 |
|
|
<xsl:call-template name="terminate"/>
|
172 |
|
|
</xsl:if>
|
173 |
|
|
-->
|
174 |
|
|
|
175 |
|
|
<oaf:accessrights>
|
176 |
|
|
<xsl:value-of select="TransformationFunction:convert($tf, //dc:rights, 'AccessRights')"/>
|
177 |
|
|
</oaf:accessrights>
|
178 |
|
|
<dr:CobjCategory>
|
179 |
|
|
<xsl:value-of
|
180 |
|
|
select="TransformationFunction:convertString($tf, //dc:type, 'TextTypologies')" />
|
181 |
|
|
</dr:CobjCategory>
|
182 |
|
|
|
183 |
|
|
<oaf:dateAccepted>
|
184 |
|
|
<xsl:value-of select="TransformationFunction:convertString($tf, //dc:date, 'DateISO8601')"/>
|
185 |
|
|
</oaf:dateAccepted>
|
186 |
|
|
|
187 |
|
|
|
188 |
|
|
<!--
|
189 |
|
|
<oaf:fulltext><xsl:value-of select="//didl:Component/didl:Resource[@mimeType='application/pdf']/@ref"/></oaf:fulltext>
|
190 |
|
|
-->
|
191 |
|
|
<oaf:hostedBy>
|
192 |
|
|
<xsl:attribute name="name">
|
193 |
|
|
<xsl:value-of select="key('kCodeByName', $repoCode, $vCodes)/@name"/>
|
194 |
|
|
</xsl:attribute>
|
195 |
|
|
<xsl:attribute name="id">
|
196 |
|
|
<xsl:value-of select="key('kCodeByName', $repoCode, $vCodes)/@id"/>
|
197 |
|
|
</xsl:attribute>
|
198 |
|
|
</oaf:hostedBy>
|
199 |
|
|
<oaf:collectedFrom>
|
200 |
|
|
<xsl:attribute name="name">
|
201 |
|
|
<xsl:value-of select="$varOfficialName"/>
|
202 |
|
|
</xsl:attribute>
|
203 |
|
|
<xsl:attribute name="id">
|
204 |
|
|
<xsl:value-of select="$varDataSourceId"/>
|
205 |
|
|
</xsl:attribute>
|
206 |
|
|
</oaf:collectedFrom>
|
207 |
|
|
</metadata>
|
208 |
|
|
<xsl:copy-of select="//*[local-name() = 'about']" />
|
209 |
|
|
</record>
|
210 |
|
|
|
211 |
|
|
</xsl:template>
|
212 |
|
|
|
213 |
|
|
<xsl:template name="allElements">
|
214 |
|
|
<xsl:param name="sourceElement"/>
|
215 |
|
|
<xsl:param name="targetElement"/>
|
216 |
|
|
<xsl:for-each select="$sourceElement">
|
217 |
|
|
<xsl:element name="{$targetElement}">
|
218 |
|
|
<xsl:value-of select="normalize-space(.)"/>
|
219 |
|
|
</xsl:element>
|
220 |
|
|
</xsl:for-each>
|
221 |
|
|
</xsl:template>
|
222 |
|
|
|
223 |
|
|
|
224 |
|
|
<xsl:template match="//*[local-name() = 'header']">
|
225 |
|
|
<xsl:copy>
|
226 |
|
|
<xsl:apply-templates select="node()|@*"/>
|
227 |
|
|
<xsl:element name="dr:dateOfTransformation">
|
228 |
|
|
<xsl:value-of select="$transDate"/>
|
229 |
|
|
</xsl:element>
|
230 |
|
|
</xsl:copy>
|
231 |
|
|
</xsl:template>
|
232 |
|
|
|
233 |
|
|
<!--
|
234 |
|
|
<xsl:template match="dri:objIdentifier">
|
235 |
|
|
<xsl:variable name="objIdentifier" select="substring-after(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], ':')"/>
|
236 |
|
|
<xsl:variable name="nsPrefix" select="key('kCodeByName', $repoCode, $vCodes)/@value"/>
|
237 |
|
|
<xsl:if test="string-length($nsPrefix) = 0">
|
238 |
|
|
<xsl:call-template name="terminate"/>
|
239 |
|
|
</xsl:if>
|
240 |
|
|
<xsl:copy>
|
241 |
|
|
<xsl:value-of select="concat( $nsPrefix , '::', transformExt:md5Hex(string($objIdentifier)))"/>
|
242 |
|
|
</xsl:copy>
|
243 |
|
|
</xsl:template>
|
244 |
|
|
-->
|
245 |
|
|
<xsl:template match="node()|@*">
|
246 |
|
|
<xsl:copy>
|
247 |
|
|
<xsl:apply-templates select="node()|@*"/>
|
248 |
|
|
</xsl:copy>
|
249 |
|
|
</xsl:template>
|
250 |
|
|
</xsl:stylesheet></CODE>
|
251 |
|
|
</SCRIPT>
|
252 |
|
|
</CONFIGURATION>
|
253 |
|
|
<STATUS/>
|
254 |
|
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
255 |
|
|
</BODY>
|
256 |
|
|
</RESOURCE_PROFILE>
|