1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="522cd83c-4177-4401-85ad-3217d5cb7ba0_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2016-03-10T16:03:17+00:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>xslt_rioxx2oaf_core</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="replace(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], '^([^:]*:[^:]*):.*$', '$1')"/>
|
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="oai:usir.salford.ac.uk" value="od_______991" id="opendoar____::991" name="University of Salford Institutional repository"/>
|
42
|
<code key="oai:sro.sussex.ac.uk" value="od______2384" id="opendoar____::2384" name="Sussex Research Online"/>
|
43
|
<code key="oai:eprints.gla.ac.uk" value="od_______162" id="opendoar____::162" name="Enlighten"/>
|
44
|
<code key="oai:researchspace.bathspa.ac.uk" value="od______2694" id="opendoar____::2694" name="ResearchSPace - Bath Spa University"/>
|
45
|
<code key="oai:wrap.warwick.ac.uk" value="od______1288" id="opendoar____::1288" name="Warwick Research Archives Portal Repository"/>
|
46
|
<code key="oai:centaur.reading.ac.uk" value="od______1731" id="opendoar____::1731" name="Central Archive at the University of Reading"/>
|
47
|
<code key="oai:eprints.lse.ac.uk" value="od_______206" id="opendoar____::206" name="LSE Research Online"/>
|
48
|
<code key="oai:westminsterresearch.wmin.ac.uk" value="od_______936" id="opendoar____::936" name="WestminsterResearch"/>
|
49
|
<code key="oai:eprints.soas.ac.uk" value="od_______285" id="opendoar____::285" name="SOAS Research Online"/>
|
50
|
<code key="oai:open.ac.uk.OAI2" value="od_______300" id="opendoar____::300" name="Open Research Online"/>
|
51
|
<code key="oai:nectar.northampton.ac.uk" value="od______1251" id="opendoar____::1251" name="NECTAR"/>
|
52
|
<code key="oai:openaccess.sgul.ac.uk" value="od______2556" id="opendoar____::2556" name="St George's Online Research Archive"/>
|
53
|
<code key="oai:researchrepository.napier.ac.uk" value="od______1334" id="opendoar____::1334" name="Repository@Napier"/>
|
54
|
<code key="oai:roar.uel.ac.uk" value="od______1488" id="opendoar____::1488" name="ROAR at University of East London"/>
|
55
|
<code key="oai:eprints.staffs.ac.uk" value="od______2881" id="opendoar____::2881" name="STORE - Staffordshire Online Repository"/>
|
56
|
<code key="oai:ray.yorksj.ac.uk" value="od______1391" id="opendoar____::1391" name="York St John University Repository"/>
|
57
|
<code key="oai:repository.winchester.ac.uk" value="core________" id="openaire____::d2d51e00-28b0-4f13-b541-7473d104a860" name="CORE"/>
|
58
|
<code key="oai:rhinology.in" value="core________" id="openaire____::d2d51e00-28b0-4f13-b541-7473d104a860" name="CORE"/>
|
59
|
</codes>
|
60
|
</xsl:variable>
|
61
|
<!--
|
62
|
status CORE-ID OpenDOAR-ID repo name
|
63
|
ok 136 1288 Warwick Research Archives Portal Repository
|
64
|
ok 67 206 LSE Research Online
|
65
|
ok 42 162 Enlighten
|
66
|
ok 109 2384 Sussex Research Online
|
67
|
ok 130 991 University of Salford Institutional repository oai:usir.salford.ac.uk
|
68
|
ok 17 1731 Central Archive at the University of Reading
|
69
|
ok 86 300 Open Research Online
|
70
|
ok 103 285 SOAS Research Online
|
71
|
ok 138 936 WestminsterResearch
|
72
|
ok 686 0 !2694 ResearchSPace - Bath Spa University http://researchspace.bathspa.ac.uk/cgi/oai2
|
73
|
ok 78 1251 NECTAR http://nectar.northampton.ac.uk/cgi/oai2?verb=Identify
|
74
|
ok 253 2556 St George's Online Research Archive
|
75
|
ok 92 1334 Repository@Napier
|
76
|
ok 96 1488 ROAR at University of East London
|
77
|
ok 620 2881 STORE - Staffordshire Online Repository
|
78
|
ok ? 694 0 Winchester Research Repository http://repository.winchester.ac.uk/cgi/oai2 oai:repository.winchester.ac.uk
|
79
|
ok 683 0 ! 1391 York St John University Repository http://ray.yorksj.ac.uk/cgi/oai2
|
80
|
? 294 0 Entrepo http://rhinology.in/cgi/oai2 oai:rhinology.in
|
81
|
? no records so far 170 2134 LSE Theses Online http://etheses.lse.ac.uk/cgi/oai2
|
82
|
<code key="oai:eprints.lse.ac.uk" value="od______2134" id="opendoar____::2134" name="LSE Theses Online"/>
|
83
|
|
84
|
-->
|
85
|
<xsl:key name="kCodeByName" match="code" use="string(@key)"/>
|
86
|
|
87
|
|
88
|
<xsl:template name="terminate">
|
89
|
<xsl:message terminate="yes">
|
90
|
record is not compliant, transformation is interrupted.
|
91
|
</xsl:message>
|
92
|
</xsl:template>
|
93
|
|
94
|
<xsl:template match="/">
|
95
|
<record>
|
96
|
<xsl:apply-templates select="//*[local-name() = 'header']" />
|
97
|
<metadata>
|
98
|
<xsl:call-template name="allElements">
|
99
|
<xsl:with-param name="sourceElement" select="//dc:title"/>
|
100
|
<xsl:with-param name="targetElement" select="'dc:title'"/>
|
101
|
</xsl:call-template>
|
102
|
<xsl:call-template name="allElements">
|
103
|
<xsl:with-param name="sourceElement" select="//*[local-name()='author']"/>
|
104
|
<xsl:with-param name="targetElement" select="'dc:creator'"/>
|
105
|
</xsl:call-template>
|
106
|
<xsl:call-template name="allElements">
|
107
|
<xsl:with-param name="sourceElement" select="//*[local-name()='contributor']"/>
|
108
|
<xsl:with-param name="targetElement" select="'dc:contributor'"/>
|
109
|
</xsl:call-template>
|
110
|
<xsl:call-template name="allElements">
|
111
|
<xsl:with-param name="sourceElement" select="//dc:description"/>
|
112
|
<xsl:with-param name="targetElement" select="'dc:description'"/>
|
113
|
</xsl:call-template>
|
114
|
<xsl:call-template name="allElements">
|
115
|
<xsl:with-param name="sourceElement" select="//dc:format"/>
|
116
|
<xsl:with-param name="targetElement" select="'dc:format'"/>
|
117
|
</xsl:call-template>
|
118
|
<xsl:call-template name="allElements">
|
119
|
<xsl:with-param name="sourceElement" select="//dc:subject"/>
|
120
|
<xsl:with-param name="targetElement" select="'dc:subject'"/>
|
121
|
</xsl:call-template>
|
122
|
<xsl:call-template name="allElements">
|
123
|
<xsl:with-param name="sourceElement" select="//dc:publisher"/>
|
124
|
<xsl:with-param name="targetElement" select="'dc:publisher'"/>
|
125
|
</xsl:call-template>
|
126
|
<xsl:call-template name="allElements">
|
127
|
<xsl:with-param name="sourceElement" select="//dc:source"/>
|
128
|
<xsl:with-param name="targetElement" select="'dc:source'"/>
|
129
|
</xsl:call-template>
|
130
|
<dc:language>
|
131
|
<xsl:value-of select="TransformationFunction:convertString($tf, //dc:language, 'Languages')"/>
|
132
|
</dc:language>
|
133
|
<xsl:call-template name="allElements">
|
134
|
<xsl:with-param name="sourceElement" select="//dc:rights"/>
|
135
|
<xsl:with-param name="targetElement" select="'dc:rights'"/>
|
136
|
</xsl:call-template>
|
137
|
<xsl:call-template name="allElements">
|
138
|
<xsl:with-param name="sourceElement" select="//dc:relation"/>
|
139
|
<xsl:with-param name="targetElement" select="'dc:relation'"/>
|
140
|
</xsl:call-template>
|
141
|
<xsl:if test="not(//dc:identifier[starts-with(., 'http')])">
|
142
|
<xsl:call-template name="terminate"/>
|
143
|
</xsl:if>
|
144
|
<xsl:call-template name="allElements">
|
145
|
<xsl:with-param name="sourceElement" select="//dc:identifier[starts-with(., 'http')]"/>
|
146
|
<xsl:with-param name="targetElement" select="'dc:identifier'"/>
|
147
|
</xsl:call-template>
|
148
|
<xsl:if test="//*[local-name()='version_of_record'][starts-with(., 'http://dx.doi.org/')]">
|
149
|
<xsl:element name="oaf:identifier">
|
150
|
<xsl:attribute name="identifierType">
|
151
|
<xsl:text>doi</xsl:text>
|
152
|
</xsl:attribute>
|
153
|
<xsl:value-of select="substring-after(//*[local-name()='version_of_record'], 'http://dx.doi.org/')"/>
|
154
|
</xsl:element>
|
155
|
</xsl:if>
|
156
|
<xsl:for-each select="//*[local-name()='project']">
|
157
|
<xsl:if test="(contains(@funder_name, 'EU FP7') or starts-with(@funder_name, 'Europe') or contains(@funder_id, '10.13039/501100000780') or contains(@funder_id, '10.13039/501100004963') ) and not(contains(., '531245')) and not(contains(lower-case(.), 'lifelong learning programme')) and matches(normalize-space(.), '^.*(\d\d\d\d\d\d).*$', 'i')">
|
158
|
<oaf:projectid>
|
159
|
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '^.*(\d\d\d\d\d\d).*$', '$1', 'i'))"/>
|
160
|
</oaf:projectid>
|
161
|
</xsl:if>
|
162
|
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
|
163
|
<oaf:projectid>
|
164
|
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
165
|
</oaf:projectid>
|
166
|
</xsl:if>
|
167
|
</xsl:for-each>
|
168
|
|
169
|
|
170
|
<!--
|
171
|
<xsl:if test="not(//didl:Component/didl:Resource[@mimeType='application/pdf'])">
|
172
|
<xsl:call-template name="terminate"/>
|
173
|
</xsl:if>
|
174
|
-->
|
175
|
<xsl:choose>
|
176
|
<xsl:when test="//*[local-name()='free_to_read']" >
|
177
|
<oaf:accessrights>
|
178
|
<xsl:text>OPEN</xsl:text>
|
179
|
</oaf:accessrights>
|
180
|
</xsl:when>
|
181
|
<xsl:otherwise>
|
182
|
<oaf:accessrights>
|
183
|
<xsl:text>UNKNOWN</xsl:text>
|
184
|
</oaf:accessrights>
|
185
|
</xsl:otherwise>
|
186
|
</xsl:choose>
|
187
|
<xsl:call-template name="allElements">
|
188
|
<xsl:with-param name="sourceElement" select="//*[local-name()='license_ref']"/>
|
189
|
<xsl:with-param name="targetElement" select="'oaf:license'"/>
|
190
|
</xsl:call-template>
|
191
|
<dr:CobjCategory>
|
192
|
<xsl:value-of
|
193
|
select="TransformationFunction:convertString($tf, //*[local-name()='type'], 'TextTypologies')" />
|
194
|
</dr:CobjCategory>
|
195
|
|
196
|
<oaf:dateAccepted>
|
197
|
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name()='publication_date'], 'DateISO8601')"/>
|
198
|
</oaf:dateAccepted>
|
199
|
|
200
|
|
201
|
<!--
|
202
|
<oaf:fulltext><xsl:value-of select="//didl:Component/didl:Resource[@mimeType='application/pdf']/@ref"/></oaf:fulltext>
|
203
|
-->
|
204
|
<oaf:hostedBy>
|
205
|
<xsl:attribute name="name">
|
206
|
<xsl:value-of select="key('kCodeByName', $repoCode, $vCodes)/@name"/>
|
207
|
</xsl:attribute>
|
208
|
<xsl:attribute name="id">
|
209
|
<xsl:value-of select="key('kCodeByName', $repoCode, $vCodes)/@id"/>
|
210
|
</xsl:attribute>
|
211
|
</oaf:hostedBy>
|
212
|
|
213
|
<!--
|
214
|
<oaf:hostedBy>
|
215
|
<xsl:attribute name="name">
|
216
|
<xsl:value-of select="$varOfficialName"/>
|
217
|
</xsl:attribute>
|
218
|
<xsl:attribute name="id">
|
219
|
<xsl:value-of select="$varDataSourceId"/>
|
220
|
</xsl:attribute>
|
221
|
</oaf:hostedBy>
|
222
|
-->
|
223
|
|
224
|
<oaf:collectedFrom>
|
225
|
<xsl:attribute name="name">
|
226
|
<xsl:value-of select="$varOfficialName"/>
|
227
|
</xsl:attribute>
|
228
|
<xsl:attribute name="id">
|
229
|
<xsl:value-of select="$varDataSourceId"/>
|
230
|
</xsl:attribute>
|
231
|
</oaf:collectedFrom>
|
232
|
</metadata>
|
233
|
<xsl:copy-of select="//*[local-name() = 'about']" />
|
234
|
</record>
|
235
|
|
236
|
</xsl:template>
|
237
|
|
238
|
<xsl:template name="allElements">
|
239
|
<xsl:param name="sourceElement"/>
|
240
|
<xsl:param name="targetElement"/>
|
241
|
<xsl:for-each select="$sourceElement">
|
242
|
<xsl:element name="{$targetElement}">
|
243
|
<xsl:value-of select="normalize-space(.)"/>
|
244
|
</xsl:element>
|
245
|
</xsl:for-each>
|
246
|
</xsl:template>
|
247
|
|
248
|
|
249
|
<xsl:template match="//*[local-name() = 'header']">
|
250
|
<xsl:copy>
|
251
|
<xsl:apply-templates select="node()|@*"/>
|
252
|
<xsl:element name="dr:dateOfTransformation">
|
253
|
<xsl:value-of select="$transDate"/>
|
254
|
</xsl:element>
|
255
|
</xsl:copy>
|
256
|
</xsl:template>
|
257
|
|
258
|
<!--
|
259
|
<xsl:template match="dri:objIdentifier">
|
260
|
<xsl:variable name="objIdentifier" select="substring-after(//*[local-name() = 'header']/*[local-name()='recordIdentifier'], ':')"/>
|
261
|
<xsl:variable name="nsPrefix" select="key('kCodeByName', $repoCode, $vCodes)/@value"/>
|
262
|
<xsl:if test="string-length($nsPrefix) = 0">
|
263
|
<xsl:call-template name="terminate"/>
|
264
|
</xsl:if>
|
265
|
<xsl:copy>
|
266
|
<xsl:value-of select="concat( $nsPrefix , '::', transformExt:md5Hex(string($objIdentifier)))"/>
|
267
|
</xsl:copy>
|
268
|
</xsl:template>
|
269
|
-->
|
270
|
<xsl:template match="node()|@*">
|
271
|
<xsl:copy>
|
272
|
<xsl:apply-templates select="node()|@*"/>
|
273
|
</xsl:copy>
|
274
|
</xsl:template>
|
275
|
</xsl:stylesheet></CODE>
|
276
|
</SCRIPT>
|
277
|
</CONFIGURATION>
|
278
|
<STATUS/>
|
279
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
280
|
</BODY>
|
281
|
</RESOURCE_PROFILE>
|