1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER
|
4
|
value="oaf2oaidatacite_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU=" />
|
5
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType" />
|
6
|
<RESOURCE_KIND value="TransformationRuleDSResources" />
|
7
|
<RESOURCE_URI value="" />
|
8
|
<DATE_OF_CREATION value="2001-12-31T12:00:00" />
|
9
|
</HEADER>
|
10
|
<BODY>
|
11
|
<CONFIGURATION>
|
12
|
<SOURCE_METADATA_FORMAT name="oaf" layout="index"
|
13
|
interpretation="openaire" />
|
14
|
<SINK_METADATA_FORMAT name="oai_datacite" />
|
15
|
<IMPORTED />
|
16
|
<SCRIPT>
|
17
|
<TITLE>OAF to OAI_DATACITE</TITLE>
|
18
|
<CODE>
|
19
|
<!-- (M): Mandatory (R): Reccomended (M w A): Mandatory when Applicable -->
|
20
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
21
|
xmlns:datacite="http://datacite.org/schema/kernel-3" xmlns:oaf="http://namespace.openaire.eu/oaf"
|
22
|
version="1.0" exclude-result-prefixes="oaf">
|
23
|
|
24
|
<xsl:output method="xml" indent="yes"
|
25
|
omit-xml-declaration="yes" />
|
26
|
|
27
|
<xsl:variable name="openaireNamespace" select="string('oai:dnet:')" />
|
28
|
|
29
|
<xsl:template match="//oaf:entity">
|
30
|
<datacite:resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
31
|
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
|
32
|
<xsl:apply-templates />
|
33
|
<datacite:titles>
|
34
|
<xsl:for-each select="oaf:result/title/text()">
|
35
|
<datacite:title>
|
36
|
<xsl:value-of select="normalize-space(.)" />
|
37
|
</datacite:title>
|
38
|
</xsl:for-each>
|
39
|
</datacite:titles>
|
40
|
<datacite:descriptions>
|
41
|
<xsl:for-each select="oaf:result/description/text()">
|
42
|
<datacite:description descriptionType="Abstract">
|
43
|
<xsl:value-of select="normalize-space(.)" />
|
44
|
</datacite:description>
|
45
|
</xsl:for-each>
|
46
|
</datacite:descriptions>
|
47
|
<datacite:subjects>
|
48
|
<xsl:for-each select="oaf:result/subject[./text()]">
|
49
|
<xsl:choose>
|
50
|
<xsl:when test="@classname='keyword'">
|
51
|
<datacite:subject>
|
52
|
<xsl:value-of select="normalize-space(./text())" />
|
53
|
</datacite:subject>
|
54
|
</xsl:when>
|
55
|
<xsl:otherwise>
|
56
|
<datacite:subject subjectScheme="{@classid}">
|
57
|
<xsl:value-of select="normalize-space(./text())" />
|
58
|
</datacite:subject>
|
59
|
</xsl:otherwise>
|
60
|
</xsl:choose>
|
61
|
</xsl:for-each>
|
62
|
</datacite:subjects>
|
63
|
<!-- Dates are mandatory but we do not always have them... -->
|
64
|
<datacite:dates>
|
65
|
<datacite:date dateType="Issued">
|
66
|
<xsl:value-of select="oaf:result/dateofacceptance/text()" />
|
67
|
</datacite:date>
|
68
|
<xsl:variable name="embargoEndDate">
|
69
|
<xsl:value-of select="oaf:result/embargoenddate/text()" />
|
70
|
</xsl:variable>
|
71
|
<xsl:if test="$embargoEndDate != ''">
|
72
|
<datacite:date dateType="Available">
|
73
|
<xsl:value-of select="$embargoEndDate" />
|
74
|
</datacite:date>
|
75
|
</xsl:if>
|
76
|
</datacite:dates>
|
77
|
<!-- Size (O) -->
|
78
|
<datacite:sizes>
|
79
|
<xsl:for-each select="oaf:result/size/text()">
|
80
|
<datacite:size>
|
81
|
<xsl:value-of select="." />
|
82
|
</datacite:size>
|
83
|
</xsl:for-each>
|
84
|
</datacite:sizes>
|
85
|
|
86
|
</datacite:resource>
|
87
|
</xsl:template>
|
88
|
|
89
|
|
90
|
<!--Identifier (M) -->
|
91
|
<xsl:template match="oaf:result//webresource/url ">
|
92
|
<datacite:identifier identifierType="URL">
|
93
|
<xsl:value-of select="./text()" />
|
94
|
</datacite:identifier>
|
95
|
</xsl:template>
|
96
|
|
97
|
<!-- Alt id : we know it's only one because we do not deduplicate dataset -->
|
98
|
<xsl:template match="oaf:result/pid/text()">
|
99
|
<datacite:alternateIdentifiers>
|
100
|
<datacite:alternateIdentifier
|
101
|
alternateIdentifierType="{@classid}">
|
102
|
<xsl:value-of select="." />
|
103
|
</datacite:alternateIdentifier>
|
104
|
</datacite:alternateIdentifiers>
|
105
|
</xsl:template>
|
106
|
|
107
|
<!-- Handling relationships -->
|
108
|
<xsl:template match="oaf:result/rels">
|
109
|
<!-- Creators (M) -->
|
110
|
<datacite:creators>
|
111
|
<xsl:apply-templates select="./rel[./to/@class='hasAuthor']" />
|
112
|
</datacite:creators>
|
113
|
<datacite:contributors>
|
114
|
<!-- person contributors: not yet available in openaire -->
|
115
|
<xsl:apply-templates select="./rel[./to/@class='hasContributor']" />
|
116
|
<!-- contributor fields is also used to model funding information -->
|
117
|
<xsl:apply-templates select="./rel[./to/@class='isProducedBy']" />
|
118
|
</datacite:contributors>
|
119
|
<datacite:relatedIdentifiers>
|
120
|
<!-- Links to publications -->
|
121
|
<xsl:apply-templates
|
122
|
select="./rel[./resulttype/@classid='publication']" />
|
123
|
</datacite:relatedIdentifiers>
|
124
|
|
125
|
</xsl:template>
|
126
|
|
127
|
<!--Creator template -->
|
128
|
<xsl:template match="rel[./to/@class='hasAuthor']">
|
129
|
<datacite:creator>
|
130
|
<datacite:creatorName>
|
131
|
<xsl:value-of select="./fullname" />
|
132
|
</datacite:creatorName>
|
133
|
</datacite:creator>
|
134
|
</xsl:template>
|
135
|
|
136
|
<!-- Person Contributor template -->
|
137
|
<xsl:template match="rel[./to/@class='hasContributor']">
|
138
|
<datacite:contributor>
|
139
|
<datacite:contributorName>
|
140
|
<xsl:value-of select="./fullname" />
|
141
|
</datacite:contributorName>
|
142
|
</datacite:contributor>
|
143
|
</xsl:template>
|
144
|
|
145
|
<!-- Funding template, goes into contributors -->
|
146
|
<xsl:template match="rel[./to/@class='isProducedBy']">
|
147
|
<xsl:variable name="funder">
|
148
|
<xsl:choose>
|
149
|
<xsl:when test="./contracttype/@schemeid = 'ec:FP7contractTypes'">
|
150
|
<xsl:value-of select="string('EC')" />
|
151
|
</xsl:when>
|
152
|
<xsl:when test="./contracttype/@schemeid = 'wt:contractTypes'">
|
153
|
<xsl:value-of select="string('WT')" />
|
154
|
</xsl:when>
|
155
|
<xsl:when test="./contracttype/@schemeid = 'fct:contractTypes'">
|
156
|
<xsl:value-of select="string('FCT')" />
|
157
|
</xsl:when>
|
158
|
</xsl:choose>
|
159
|
</xsl:variable>
|
160
|
<xsl:variable name="fundingProgramme">
|
161
|
<xsl:choose>
|
162
|
<xsl:when test="$funder = 'EC'">
|
163
|
<xsl:value-of select="./funding/funding_level_0" />
|
164
|
</xsl:when>
|
165
|
<xsl:when test="$funder = 'WT'">
|
166
|
<xsl:value-of
|
167
|
select="substring-after(./funding_level_1/text(), 'WT::')" />
|
168
|
</xsl:when>
|
169
|
<xsl:when test="$funder = 'FCT'">
|
170
|
<xsl:value-of
|
171
|
select="substring-after(./funding_level_1/text(), 'FCT::')" />
|
172
|
</xsl:when>
|
173
|
</xsl:choose>
|
174
|
</xsl:variable>
|
175
|
<xsl:variable name="jurisdiction">
|
176
|
<xsl:choose>
|
177
|
<xsl:when test="$funder = 'EC'">
|
178
|
<xsl:value-of select="string('EU')" />
|
179
|
</xsl:when>
|
180
|
<xsl:when test="$funder = 'WT'">
|
181
|
<xsl:value-of select="string('')" />
|
182
|
</xsl:when>
|
183
|
<xsl:when test="$funder = 'FCT'">
|
184
|
<xsl:value-of select="string('PT')" />
|
185
|
</xsl:when>
|
186
|
<xsl:otherwise />
|
187
|
</xsl:choose>
|
188
|
</xsl:variable>
|
189
|
<datacite:contributor contributorType="Funder">
|
190
|
<datacite:contributorName>
|
191
|
<xsl:value-of select="$funder" />
|
192
|
</datacite:contributorName>
|
193
|
<datacite:nameIdentifier
|
194
|
nameIdentifierScheme="info">
|
195
|
<xsl:value-of
|
196
|
select="concat('info:eu-repo/grantAgreement/', $funder, '/', $fundingProgramme, '/', ./code, '/', $jurisdiction, '/' , ./title, '/', ./acronym)" />
|
197
|
</datacite:nameIdentifier>
|
198
|
</datacite:contributor>
|
199
|
</xsl:template>
|
200
|
|
201
|
<!-- Links to publication. The related id should be a DOI or similar,
|
202
|
but we only have the openaire id for now... -->
|
203
|
<xsl:template match="rel[./resulttype/@classid='publication']">
|
204
|
<datacite:relatedIdentifier
|
205
|
relatedIdentifierType="openaire" relationType="IsReferencedBy">
|
206
|
<xsl:value-of select="concat($openaireNamespace, ./to/text())" />
|
207
|
</datacite:relatedIdentifier>
|
208
|
</xsl:template>
|
209
|
|
210
|
<!--publisher (M) from publisher -->
|
211
|
<xsl:template match="oaf:result/publisher/text()">
|
212
|
<datacite:publisher>
|
213
|
<xsl:value-of select="normalize-space(.)" />
|
214
|
</datacite:publisher>
|
215
|
</xsl:template>
|
216
|
|
217
|
<!-- Publication year (M) -->
|
218
|
<xsl:template match="oaf:result/dateofacceptance/text()">
|
219
|
<datacite:publicationYear>
|
220
|
<xsl:value-of select="normalize-space(substring-before(.,'-'))" />
|
221
|
</datacite:publicationYear>
|
222
|
</xsl:template>
|
223
|
|
224
|
<!-- Language (R) from language@classid -->
|
225
|
<xsl:template match="oaf:result/language/@classid">
|
226
|
<datacite:language>
|
227
|
<xsl:value-of select="." />
|
228
|
</datacite:language>
|
229
|
</xsl:template>
|
230
|
|
231
|
<!-- ResourceType (R) -->
|
232
|
<xsl:template
|
233
|
match="oaf:result/children/instance/instancetype[./@classname!='Unknown'] | oaf:result/resourcetype[./@classname != '']">
|
234
|
<datacite:resourceType resourceTypeGeneral="{./@classname}" />
|
235
|
</xsl:template>
|
236
|
|
237
|
<!-- Version (O) -->
|
238
|
<xsl:template match="oaf:result/version/text()">
|
239
|
<datacite:version>
|
240
|
<xsl:value-of select="." />
|
241
|
</datacite:version>
|
242
|
</xsl:template>
|
243
|
|
244
|
|
245
|
<!-- Rights list (M) -->
|
246
|
<xsl:template match="oaf:result/bestlicense">
|
247
|
<xsl:variable name="license">
|
248
|
<xsl:choose>
|
249
|
<xsl:when test="@classid='OPEN'">
|
250
|
<xsl:value-of select="string('info:eu-repo/semantics/openAccess')" />
|
251
|
</xsl:when>
|
252
|
<xsl:when test="@classid='CLOSED'">
|
253
|
<xsl:value-of select="string('info:eu-repo/semantics/closedAccess')" />
|
254
|
</xsl:when>
|
255
|
<xsl:when test="@classid='RESTRICTED'">
|
256
|
<xsl:value-of
|
257
|
select="string('info:eu-repo/semantics/restrictedAccess')" />
|
258
|
</xsl:when>
|
259
|
<xsl:when test="@classid='EMBARGO'">
|
260
|
<xsl:value-of
|
261
|
select="string('info:eu-repo/semantics/embargoedAccess')" />
|
262
|
</xsl:when>
|
263
|
<xsl:otherwise>
|
264
|
<xsl:value-of select="string('info:eu-repo/semantics/unknownAccess')" />
|
265
|
</xsl:otherwise>
|
266
|
</xsl:choose>
|
267
|
</xsl:variable>
|
268
|
<datacite:rightsList>
|
269
|
<datacite:rights rightsURI="{$license}">
|
270
|
<xsl:value-of select="./@classname" />
|
271
|
</datacite:rights>
|
272
|
</datacite:rightsList>
|
273
|
</xsl:template>
|
274
|
|
275
|
<!-- Override default template -->
|
276
|
<xsl:template match="text()|@*" />
|
277
|
</xsl:stylesheet>
|
278
|
</CODE>
|
279
|
</SCRIPT>
|
280
|
</CONFIGURATION>
|
281
|
<STATUS />
|
282
|
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS>
|
283
|
</BODY>
|
284
|
</RESOURCE_PROFILE>
|