1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER
|
4
|
value="oaiAndsTransform_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
5
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
6
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
7
|
<RESOURCE_URI value=""/>
|
8
|
<DATE_OF_CREATION value="2014-11-19T11:05:55+01:00"/>
|
9
|
</HEADER>
|
10
|
<BODY>
|
11
|
<CONFIGURATION>
|
12
|
<IMPORTED/>
|
13
|
<SCRIPT>
|
14
|
<TITLE>DLI: OAI_ANDS transform</TITLE>
|
15
|
<CODE><![CDATA[<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
16
|
xmlns:datetime="http://exslt.org/dates-and-times"
|
17
|
xmlns:exslt="http://exslt.org/common" xmlns:oai="http://www.openarchives.org/OAI/2.0/"
|
18
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
19
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
20
|
xmlns:dnet="eu.dnetlib.dli.DLIUtils"
|
21
|
xmlns:oaf="http://namespace.dnet.eu/oaf"
|
22
|
version="2.0"
|
23
|
exclude-result-prefixes="xsl datetime exslt dnet">
|
24
|
<xsl:template match="/">
|
25
|
<xsl:variable name="namespacePrefix" select="//dri:datasourceprefix"/>
|
26
|
<xsl:variable name="pid">
|
27
|
<xsl:value-of
|
28
|
select="dnet:fixPID(//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='identifier'])"/>
|
29
|
</xsl:variable>
|
30
|
<xsl:variable name="pidType">
|
31
|
<xsl:value-of
|
32
|
select="dnet:inferPidType(//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='identifier'],//*[local-name()='source']/*[local-name()='identifier']/*[local-name()='schema'])"/>
|
33
|
</xsl:variable>
|
34
|
|
35
|
|
36
|
<xsl:variable name="relatedPid">
|
37
|
<xsl:value-of
|
38
|
select="dnet:fixPID(//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='identifier'])"/>
|
39
|
</xsl:variable>
|
40
|
<xsl:variable name="relatedPidType">
|
41
|
<xsl:value-of
|
42
|
select="dnet:inferPidType(//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='identifier'],//*[local-name()='target']/*[local-name()='identifier']/*[local-name()='schema'])"/>
|
43
|
</xsl:variable>
|
44
|
|
45
|
<xsl:variable name="relation">
|
46
|
<xsl:value-of select="//*[local-name()='relationship']/*[local-name()='name']"/>
|
47
|
</xsl:variable>
|
48
|
<xsl:variable name="inverseRelation">
|
49
|
<xsl:value-of select="//*[local-name()='relationship']/*[local-name()='inverseRelationship']"/>
|
50
|
</xsl:variable>
|
51
|
|
52
|
<xsl:variable name="targetType">
|
53
|
<xsl:choose>
|
54
|
<xsl:when
|
55
|
test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] ='dataset' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type']= 'collection'">
|
56
|
dataset
|
57
|
</xsl:when>
|
58
|
<xsl:when
|
59
|
test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
|
60
|
publication
|
61
|
</xsl:when>
|
62
|
<xsl:otherwise>unknown</xsl:otherwise>
|
63
|
</xsl:choose>
|
64
|
</xsl:variable>
|
65
|
|
66
|
<xsl:variable name="sourceType">
|
67
|
<xsl:choose>
|
68
|
<xsl:when
|
69
|
test="//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] ='dataset' or //*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type']= 'collection'">
|
70
|
dataset
|
71
|
</xsl:when>
|
72
|
<xsl:when test="//source/objectType/type = 'literature' or //source/objectType/type = 'publication'">
|
73
|
publication
|
74
|
</xsl:when>
|
75
|
<xsl:otherwise>unknown</xsl:otherwise>
|
76
|
</xsl:choose>
|
77
|
</xsl:variable>
|
78
|
<xsl:variable name="dnetSourceId">
|
79
|
<xsl:value-of
|
80
|
select="concat($namespacePrefix, '::', dnet:generateIdentifier(concat($pid, '::', $relatedPid), concat($pidType, '::', $relatedPidType)))"/>
|
81
|
</xsl:variable>
|
82
|
<xsl:variable name="dnetTargetId">
|
83
|
<xsl:value-of
|
84
|
select="concat($namespacePrefix, '::', dnet:generateIdentifier(concat($relatedPid, '::', $pid), concat($relatedPidType, '::', $pidType)))"/>
|
85
|
</xsl:variable>
|
86
|
<pack>
|
87
|
<xsl:choose>
|
88
|
<xsl:when
|
89
|
test=".//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'dataset' or .//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'collection'">
|
90
|
<oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
91
|
xmlns="http://namespace.openaire.eu/">
|
92
|
<oai:header>
|
93
|
<dri:objIdentifier>
|
94
|
<xsl:value-of select="$dnetSourceId"/>
|
95
|
</dri:objIdentifier>
|
96
|
<dri:recordIdentifier>
|
97
|
<xsl:value-of select="concat($pid, '::', $pidType)"/>
|
98
|
</dri:recordIdentifier>
|
99
|
<dri:dateOfCollection>
|
100
|
<xsl:value-of select="//dri:dateOfCollection"/>
|
101
|
</dri:dateOfCollection>
|
102
|
<dri:repositoryId>
|
103
|
<xsl:value-of select="//dri:repositoryId"/>
|
104
|
</dri:repositoryId>
|
105
|
<dri:datasourceprefix>
|
106
|
<xsl:value-of select="$namespacePrefix"/>
|
107
|
</dri:datasourceprefix>
|
108
|
</oai:header>
|
109
|
<metadata>
|
110
|
<resource xmlns="http://datacite.org/schema/kernel-3"
|
111
|
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
|
112
|
<identifier identifierType="{$pidType}">
|
113
|
<xsl:value-of select="$pid"/>
|
114
|
</identifier>
|
115
|
<titles>
|
116
|
<xsl:for-each
|
117
|
select="//*[local-name()='source']/*[local-name()='title']">
|
118
|
<title>
|
119
|
<xsl:value-of select="."/>
|
120
|
</title>
|
121
|
</xsl:for-each>
|
122
|
</titles>
|
123
|
<publisher>
|
124
|
<xsl:value-of select="//*[local-name()='publisher']/*[local-name()='name']"/>
|
125
|
</publisher>
|
126
|
<dates>
|
127
|
<xsl:for-each select="//*[local-name()='source']/*[local-name()='publicationDate']">
|
128
|
<date dateType="Collected">
|
129
|
<xsl:value-of select="."/>
|
130
|
</date>
|
131
|
</xsl:for-each>
|
132
|
</dates>
|
133
|
<creators>
|
134
|
<xsl:for-each select="//*[local-name()='source']//*[local-name()='creatorName']">
|
135
|
<creator>
|
136
|
<creatorName>
|
137
|
<xsl:value-of select="."/>
|
138
|
</creatorName>
|
139
|
</creator>
|
140
|
</xsl:for-each>
|
141
|
</creators>
|
142
|
<resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
|
143
|
<relatedIdentifiers>
|
144
|
<relatedIdentifier xmlns:oaf="http://namespace.dnet.eu/oaf"
|
145
|
inverseRelationType="{$inverseRelation}"
|
146
|
relationType="{$relation}"
|
147
|
entityType="{$targetType}" relatedIdentifierType="dnet">
|
148
|
<xsl:value-of select="$dnetTargetId"/>
|
149
|
</relatedIdentifier>
|
150
|
</relatedIdentifiers>
|
151
|
</resource>
|
152
|
</metadata>
|
153
|
<oaf:about>
|
154
|
<oaf:datainfo>
|
155
|
<oaf:collectedFrom completionStatus="complete">
|
156
|
<xsl:attribute name="id">
|
157
|
<xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
|
158
|
</xsl:attribute>
|
159
|
<xsl:attribute name="name">
|
160
|
<xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
|
161
|
</xsl:attribute>
|
162
|
</oaf:collectedFrom>
|
163
|
<oaf:completionStatus>complete</oaf:completionStatus>
|
164
|
<oaf:provisionMode>collected</oaf:provisionMode>
|
165
|
</oaf:datainfo>
|
166
|
</oaf:about>
|
167
|
</oai:record>
|
168
|
</xsl:when>
|
169
|
<xsl:when
|
170
|
test=".//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or .//*[local-name()='source']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
|
171
|
<oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
172
|
xmlns="http://namespace.openaire.eu/">
|
173
|
<oai:header>
|
174
|
<dri:objIdentifier>
|
175
|
<xsl:value-of select="$dnetSourceId"/>
|
176
|
</dri:objIdentifier>
|
177
|
<dri:recordIdentifier>
|
178
|
<xsl:value-of select="concat($pid, '::', $pidType)"/>
|
179
|
</dri:recordIdentifier>
|
180
|
<dri:dateOfCollection>
|
181
|
<xsl:value-of select="//dri:dateOfCollection"/>
|
182
|
</dri:dateOfCollection>
|
183
|
<dri:repositoryId>
|
184
|
<xsl:value-of select="//dri:repositoryId"/>
|
185
|
</dri:repositoryId>
|
186
|
<dri:datasourceprefix>
|
187
|
<xsl:value-of select="$namespacePrefix"/>
|
188
|
</dri:datasourceprefix>
|
189
|
</oai:header>
|
190
|
<metadata>
|
191
|
<oaf:pid type="{$pidType}">
|
192
|
<xsl:value-of select="$pid"/>
|
193
|
</oaf:pid>
|
194
|
<dc:identifier>
|
195
|
<xsl:value-of select="$pid"/>
|
196
|
</dc:identifier>
|
197
|
<dc:title>
|
198
|
<xsl:value-of select="//*[local-name()='source']/*[local-name()='title']"/>
|
199
|
</dc:title>
|
200
|
<xsl:for-each select="//*[local-name()='source']//*[local-name()='creatorName']">
|
201
|
<dc:creator>
|
202
|
<xsl:value-of select="."/>
|
203
|
</dc:creator>
|
204
|
</xsl:for-each>
|
205
|
<dc:type>publication</dc:type>
|
206
|
<!--<oaf:relatedIdentifier inverseRelationType="{$inverseRelation}" relationType="{$relation}"-->
|
207
|
<!--entityType="{$targetType}" relatedIdentifierType="dnet">-->
|
208
|
<!--<xsl:value-of select="$dnetTargetId"/>-->
|
209
|
<!--</oaf:relatedIdentifier>-->
|
210
|
</metadata>
|
211
|
<oaf:about>
|
212
|
<oaf:datainfo>
|
213
|
<oaf:collectedFrom completionStatus="complete">
|
214
|
<xsl:attribute name="id">
|
215
|
<xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
|
216
|
</xsl:attribute>
|
217
|
<xsl:attribute name="name">
|
218
|
<xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
|
219
|
</xsl:attribute>
|
220
|
</oaf:collectedFrom>
|
221
|
<oaf:completionStatus>complete</oaf:completionStatus>
|
222
|
<oaf:provisionMode>collected</oaf:provisionMode>
|
223
|
</oaf:datainfo>
|
224
|
</oaf:about>
|
225
|
</oai:record>
|
226
|
</xsl:when>
|
227
|
</xsl:choose>
|
228
|
<xsl:choose>
|
229
|
<xsl:when
|
230
|
test="//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'literature' or //*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'publication'">
|
231
|
<oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
232
|
xmlns="http://namespace.openaire.eu/">
|
233
|
<oai:header>
|
234
|
<dri:objIdentifier>
|
235
|
<xsl:value-of select="$dnetTargetId"/>
|
236
|
</dri:objIdentifier>
|
237
|
<dri:recordIdentifier>
|
238
|
<xsl:value-of select="concat($relatedPid, '::', $relatedPidType)"/>
|
239
|
</dri:recordIdentifier>
|
240
|
<dri:dateOfCollection>
|
241
|
<xsl:value-of select="//dri:dateOfCollection"/>
|
242
|
</dri:dateOfCollection>
|
243
|
<dri:repositoryId>
|
244
|
<xsl:value-of select="//dri:repositoryId"/>
|
245
|
</dri:repositoryId>
|
246
|
<dri:datasourceprefix>
|
247
|
<xsl:value-of select="$namespacePrefix"/>
|
248
|
</dri:datasourceprefix>
|
249
|
</oai:header>
|
250
|
<metadata>
|
251
|
<oaf:pid type="{$relatedPidType}">
|
252
|
<xsl:value-of select="$relatedPid"/>
|
253
|
</oaf:pid>
|
254
|
<dc:identifier>
|
255
|
<xsl:value-of select="$relatedPid"/>
|
256
|
</dc:identifier>
|
257
|
<dc:title>
|
258
|
<xsl:value-of select="//*[local-name()='target']/*[local-name()='title']"/>
|
259
|
</dc:title>
|
260
|
<xsl:for-each select="//*[local-name()='target']//*[local-name()='creatorName']">
|
261
|
<dc:creator>
|
262
|
<xsl:value-of select="."/>
|
263
|
</dc:creator>
|
264
|
</xsl:for-each>
|
265
|
<dc:type>publication</dc:type>
|
266
|
<!--<oaf:relatedIdentifier inverseRelationType="{$relation}" relationType="{$inverseRelation}"-->
|
267
|
<!--entityType="{$sourceType}" relatedIdentifierType="dnet">-->
|
268
|
<!--<xsl:value-of select="$dnetSourceId"/>-->
|
269
|
<!--</oaf:relatedIdentifier>-->
|
270
|
</metadata>
|
271
|
<oaf:about>
|
272
|
<oaf:datainfo>
|
273
|
<oaf:collectedFrom completionStatus="complete">
|
274
|
<xsl:attribute name="id">
|
275
|
<xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
|
276
|
</xsl:attribute>
|
277
|
<xsl:attribute name="name">
|
278
|
<xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
|
279
|
</xsl:attribute>
|
280
|
</oaf:collectedFrom>
|
281
|
<oaf:completionStatus>complete</oaf:completionStatus>
|
282
|
<oaf:provisionMode>collected</oaf:provisionMode>
|
283
|
</oaf:datainfo>
|
284
|
</oaf:about>
|
285
|
</oai:record>
|
286
|
</xsl:when>
|
287
|
<xsl:when
|
288
|
test=".//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'dataset' or .//*[local-name()='target']/*[local-name()='objectType']/*[local-name()='type'] = 'collection'">
|
289
|
<oai:record xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
290
|
xmlns="http://namespace.openaire.eu/">
|
291
|
<oai:header>
|
292
|
<dri:objIdentifier>
|
293
|
<xsl:value-of select="$dnetTargetId"/>
|
294
|
</dri:objIdentifier>
|
295
|
<dri:recordIdentifier>
|
296
|
<xsl:value-of select="concat($relatedPid, '::', $relatedPidType)"/>
|
297
|
</dri:recordIdentifier>
|
298
|
<dri:dateOfCollection>
|
299
|
<xsl:value-of select="//dri:dateOfCollection"/>
|
300
|
</dri:dateOfCollection>
|
301
|
<dri:repositoryId>
|
302
|
<xsl:value-of select="//dri:repositoryId"/>
|
303
|
</dri:repositoryId>
|
304
|
<dri:datasourceprefix>
|
305
|
<xsl:value-of select="$namespacePrefix"/>
|
306
|
</dri:datasourceprefix>
|
307
|
</oai:header>
|
308
|
<metadata>
|
309
|
<resource xmlns="http://datacite.org/schema/kernel-3"
|
310
|
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
|
311
|
<identifier identifierType="{$relatedPidType}">
|
312
|
<xsl:value-of select="$relatedPid"/>
|
313
|
</identifier>
|
314
|
<titles>
|
315
|
<xsl:for-each
|
316
|
select="//*[local-name()='target']/*[local-name()='title']">
|
317
|
<title>
|
318
|
<xsl:value-of select="."/>
|
319
|
</title>
|
320
|
</xsl:for-each>
|
321
|
</titles>
|
322
|
<publisher>
|
323
|
<xsl:value-of select="//*[local-name()='publisher']/*[local-name()='name']"/>
|
324
|
</publisher>
|
325
|
<dates>
|
326
|
<xsl:for-each select="//*[local-name()='target']/*[local-name()='publicationDate']">
|
327
|
<date dateType="Collected">
|
328
|
<xsl:value-of select="."/>
|
329
|
</date>
|
330
|
</xsl:for-each>
|
331
|
</dates>
|
332
|
<creators>
|
333
|
<xsl:for-each select="//*[local-name()='target']//*[local-name()='creatorName']">
|
334
|
<creator>
|
335
|
<creatorName>
|
336
|
<xsl:value-of select="."/>
|
337
|
</creatorName>
|
338
|
</creator>
|
339
|
</xsl:for-each>
|
340
|
</creators>
|
341
|
<resourceType resourceTypeGeneral="Dataset">Dataset</resourceType>
|
342
|
<relatedIdentifiers>
|
343
|
<relatedIdentifier xmlns:oaf="http://namespace.dnet.eu/oaf"
|
344
|
inverseRelationType="{$relation}"
|
345
|
relationType="{$inverseRelation}"
|
346
|
entityType="{$sourceType}" relatedIdentifierType="dnet">
|
347
|
<xsl:value-of select="$dnetSourceId"/>
|
348
|
</relatedIdentifier>
|
349
|
</relatedIdentifiers>
|
350
|
</resource>
|
351
|
</metadata>
|
352
|
<oaf:about>
|
353
|
<oaf:datainfo>
|
354
|
<oaf:collectedFrom completionStatus="complete">
|
355
|
<xsl:attribute name="id">
|
356
|
<xsl:value-of select="dnet:getIdFromDataSourcePrefix($namespacePrefix)"/>
|
357
|
</xsl:attribute>
|
358
|
<xsl:attribute name="name">
|
359
|
<xsl:value-of select="dnet:getNameFromDataSourcePrefix($namespacePrefix)"/>
|
360
|
</xsl:attribute>
|
361
|
</oaf:collectedFrom>
|
362
|
<oaf:completionStatus>complete</oaf:completionStatus>
|
363
|
<oaf:provisionMode>collected</oaf:provisionMode>
|
364
|
</oaf:datainfo>
|
365
|
</oaf:about>
|
366
|
</oai:record>
|
367
|
</xsl:when>
|
368
|
</xsl:choose>
|
369
|
</pack>
|
370
|
</xsl:template>
|
371
|
</xsl:stylesheet>]]>
|
372
|
</CODE>
|
373
|
</SCRIPT>
|
374
|
</CONFIGURATION>
|
375
|
<STATUS/>
|
376
|
<SECURITY_PARAMETERS/>
|
377
|
</BODY>
|
378
|
</RESOURCE_PROFILE>
|