1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="42569418-ac28-4e77-a38f-78b168def51a_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2017-06-30T17:01:32+02:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>claims_datacite_2_ODF</TITLE>
|
14
|
<CODE><![CDATA[
|
15
|
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
|
16
|
xmlns:oai="http://www.openarchives.org/OAI/2.0/" xmlns:oaf="http://namespace.openaire.eu/oaf"
|
17
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri"
|
18
|
xmlns:dr="http://www.driver-repository.eu/namespace/dr"
|
19
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
20
|
xmlns:date="http://exslt.org/dates-and-times" extension-element-prefixes="date"
|
21
|
exclude-result-prefixes="xsl">
|
22
|
|
23
|
<xsl:output indent="yes"/>
|
24
|
|
25
|
<xsl:template match="/">
|
26
|
<xsl:choose>
|
27
|
<xsl:when test="string-length(//*[local-name() ='objIdentifier']) = 46 and matches(//*[local-name() ='objIdentifier'], '\w{12}')">
|
28
|
<xsl:call-template name="createRecord"/>
|
29
|
</xsl:when>
|
30
|
<xsl:otherwise>
|
31
|
<xsl:call-template name="skipRecord"/>
|
32
|
</xsl:otherwise>
|
33
|
</xsl:choose>
|
34
|
|
35
|
</xsl:template>
|
36
|
|
37
|
<xsl:template name="skipRecord">
|
38
|
<oai:record>
|
39
|
<oai:header>
|
40
|
<xsl:copy-of select="//*[local-name() = 'header']/dri:dateOfCollection"
|
41
|
copy-namespaces="no"/>
|
42
|
<xsl:copy-of select="//*[local-name() = 'header']/oaf:datasourceprefix"
|
43
|
copy-namespaces="no"/>
|
44
|
<dri:recordIdentifier>
|
45
|
<xsl:value-of select="//*[local-name() = 'header']/dri:objIdentifier"/>
|
46
|
</dri:recordIdentifier>
|
47
|
<dr:dateOfTransformation>
|
48
|
<xsl:value-of select="date:date-time()"/>
|
49
|
</dr:dateOfTransformation>
|
50
|
</oai:header>
|
51
|
<oai:metadata>
|
52
|
<xsl:copy-of select="//*[local-name() = 'metadata']/*"/>
|
53
|
</oai:metadata>
|
54
|
</oai:record>
|
55
|
</xsl:template>
|
56
|
|
57
|
<xsl:template name="createRecord">
|
58
|
<oai:record>
|
59
|
<oai:header>
|
60
|
<xsl:copy-of select="//*[local-name() = 'header']/dri:recordIdentifier" copy-namespaces="no"/>
|
61
|
<xsl:copy-of select="//*[local-name() = 'header']/dri:dateOfCollection" copy-namespaces="no"/>
|
62
|
<xsl:copy-of select="//*[local-name() = 'header']/oaf:datasourceprefix" copy-namespaces="no"/>
|
63
|
<dri:objIdentifier><xsl:value-of select="//*[local-name() = 'header']/*[local-name() ='objIdentifier']"/></dri:objIdentifier>
|
64
|
<dr:dateOfTransformation>
|
65
|
<xsl:value-of select="date:date-time()"/>
|
66
|
</dr:dateOfTransformation>
|
67
|
</oai:header>
|
68
|
<oai:metadata>
|
69
|
<resource xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
70
|
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd"
|
71
|
xmlns="http://datacite.org/schema/kernel-3">
|
72
|
<identifier identifierType="URL">
|
73
|
<xsl:value-of select="//metadata/data/id"/>
|
74
|
</identifier>
|
75
|
<alternateIdentifiers>
|
76
|
<alternateIdentifier alternateIdentifierType="doi">
|
77
|
<xsl:value-of select="//metadata/data/attributes/doi"/>
|
78
|
</alternateIdentifier>
|
79
|
</alternateIdentifiers>
|
80
|
<creators>
|
81
|
<xsl:for-each select="//metadata/data/attributes/author">
|
82
|
<creator>
|
83
|
<creatorName><xsl:value-of select="concat(./family, ', ', ./given)"/></creatorName>
|
84
|
</creator>
|
85
|
</xsl:for-each>
|
86
|
</creators>
|
87
|
<titles>
|
88
|
<xsl:for-each select="//metadata/data/attributes/title">
|
89
|
<title><xsl:value-of select="./text()"/></title>
|
90
|
</xsl:for-each>
|
91
|
</titles>
|
92
|
<publisher><xsl:value-of select="//metadata/data/attributes/container-title"/></publisher>
|
93
|
<dates>
|
94
|
<date dateType="Accepted"><xsl:value-of select="//metadata/data/attributes/deposited"/></date>
|
95
|
</dates>
|
96
|
<resourceType resourceTypeGeneral="Dataset">dataset</resourceType>
|
97
|
<!-- No description for now -->
|
98
|
<descriptions>
|
99
|
<xsl:for-each select="//metadata/data/attributes/description">
|
100
|
<description descriptionType="Abstract"><xsl:value-of select="./text()"/></description>
|
101
|
</xsl:for-each>
|
102
|
</descriptions>
|
103
|
</resource>
|
104
|
<oaf:accessrights>
|
105
|
<xsl:choose>
|
106
|
<xsl:when test="//*[local-name() = 'metadata']/oaf:accessrights/text() != ''"><xsl:value-of select="//*[local-name() = 'metadata']/oaf:accessrights/text()"/></xsl:when>
|
107
|
<xsl:otherwise><xsl:value-of select="string('UNKNOWN')"/></xsl:otherwise>
|
108
|
</xsl:choose>
|
109
|
</oaf:accessrights>
|
110
|
<dr:CobjCategory>0021</dr:CobjCategory>
|
111
|
<xsl:copy-of select="//*[local-name() = 'metadata']/oaf:*" copy-namespaces="no"></xsl:copy-of>
|
112
|
</oai:metadata>
|
113
|
<xsl:copy-of select="//*[local-name() = 'about']" copy-namespaces="no"/>
|
114
|
</oai:record>
|
115
|
</xsl:template>
|
116
|
</xsl:stylesheet>
|
117
|
]]></CODE>
|
118
|
</SCRIPT>
|
119
|
</CONFIGURATION>
|
120
|
<STATUS/>
|
121
|
<SECURITY_PARAMETERS/>
|
122
|
</BODY>
|
123
|
</RESOURCE_PROFILE>
|