1
|
<RESOURCE_PROFILE>
|
2
|
<HEADER>
|
3
|
<RESOURCE_IDENTIFIER value="60216DD9-8036-4CF8-A26D-DCDABBCED558_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
|
4
|
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
|
5
|
<RESOURCE_KIND value="TransformationRuleDSResources"/>
|
6
|
<RESOURCE_URI value=""/>
|
7
|
<DATE_OF_CREATION value="2015-07-28T12:26:13+02:00"/>
|
8
|
</HEADER>
|
9
|
<BODY>
|
10
|
<CONFIGURATION>
|
11
|
<IMPORTED/>
|
12
|
<SCRIPT>
|
13
|
<TITLE>People to datacite transformation</TITLE>
|
14
|
<CODE><![CDATA[
|
15
|
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:transformExt="http://namespace.openaire.eu/java/org.apache.commons.codec.digest.DigestUtils" xmlns:datetime="http://exslt.org/dates-and-times" xmlns:exslt="http://exslt.org/common" xmlns:oai="http://www.openarchives.org/OAI/2.0/"
|
16
|
xmlns:isti="http://www.isti.cnr.it/" xmlns:istiFunction="eu.dnetlib.xml.ISTIUtilityFunction"
|
17
|
xmlns:dri="http://www.driver-repository.eu/namespace/dri" xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" xmlns:dc="http://purl.org/dc/elements/1.1/" exclude-result-prefixes="xsl transformExt TransformationFunction istiFunction datetime exslt dc ">
|
18
|
<xsl:param name="varOfficialName"/>
|
19
|
|
20
|
<xsl:variable name="tf" select="TransformationFunction:getInstance()" />
|
21
|
|
22
|
|
23
|
<xsl:template match="/">
|
24
|
<oai:record>
|
25
|
<xsl:copy-of select="//*[local-name() = 'header']"/>
|
26
|
<oai:metadata>
|
27
|
<resource xmlns="http://datacite.org/schema/kernel-3"
|
28
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
29
|
xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
|
30
|
|
31
|
<identifier identifierType="oai">
|
32
|
<xsl:value-of select="normalize-space(//dri:recordIdentifier)"/>
|
33
|
</identifier>
|
34
|
<creators>
|
35
|
<xsl:for-each select="//dc:creator">
|
36
|
<xsl:for-each select="tokenize(istiFunction:cleanName(.), ';')">
|
37
|
<xsl:for-each select="tokenize(., ',')">
|
38
|
<creator>
|
39
|
<creatorName>
|
40
|
<xsl:value-of select="normalize-space(.)"/>
|
41
|
</creatorName>
|
42
|
</creator>
|
43
|
</xsl:for-each>
|
44
|
</xsl:for-each>
|
45
|
</xsl:for-each>
|
46
|
</creators>
|
47
|
<titles>
|
48
|
<xsl:for-each select="//dc:title">
|
49
|
<title>
|
50
|
<xsl:value-of select="."/>
|
51
|
</title>
|
52
|
</xsl:for-each>
|
53
|
</titles>
|
54
|
|
55
|
<xsl:if test="//dc:publisher">
|
56
|
<publisher>
|
57
|
<xsl:value-of select="//dc:publisher[1]"/>
|
58
|
</publisher>
|
59
|
</xsl:if>
|
60
|
|
61
|
<subjects>
|
62
|
<xsl:for-each select="//dc:subject">
|
63
|
<subject>
|
64
|
<xsl:value-of select="."/>
|
65
|
</subject>
|
66
|
</xsl:for-each>
|
67
|
</subjects>
|
68
|
|
69
|
<contributors>
|
70
|
<xsl:for-each select="//dc:contributor">
|
71
|
<xsl:for-each select="tokenize(., ',')">
|
72
|
<contributor>
|
73
|
<contributorName>
|
74
|
<xsl:value-of select="normalize-space(.)"/>
|
75
|
</contributorName>
|
76
|
</contributor>
|
77
|
</xsl:for-each>
|
78
|
</xsl:for-each>
|
79
|
</contributors>
|
80
|
|
81
|
<dates>
|
82
|
<xsl:for-each select="//dc:date">
|
83
|
<date dateType="Accepted">
|
84
|
<xsl:value-of select="."/>
|
85
|
</date>
|
86
|
</xsl:for-each>
|
87
|
</dates>
|
88
|
|
89
|
<xsl:if test="//dc:language">
|
90
|
<language><xsl:value-of select="TransformationFunction:convertString($tf, //dc:language[1], 'Languages')"/></language>
|
91
|
</xsl:if>
|
92
|
|
93
|
<xsl:for-each select="//dc:type">
|
94
|
<resourceType resourceTypeGeneral="Text">
|
95
|
<xsl:value-of select="TransformationFunction:convertString($tf, ., 'TextTypologies')" />
|
96
|
</resourceType>
|
97
|
</xsl:for-each>
|
98
|
|
99
|
<alternateIdentifiers>
|
100
|
<xsl:for-each select="//dc:identifier">
|
101
|
<alternateIdentifier>
|
102
|
<xsl:attribute name="alternateIdentifierType" >
|
103
|
<xsl:choose>
|
104
|
<xsl:when test="starts-with(., 'http')">url</xsl:when>
|
105
|
<xsl:when test="contains(.,'doi')">doi</xsl:when>
|
106
|
<xsl:when test="contains(.,'issn')">issn</xsl:when>
|
107
|
<xsl:when test="contains(.,'isbn')">isbn</xsl:when>
|
108
|
<xsl:when test="starts-with(., 'urn')">urn</xsl:when>
|
109
|
<xsl:otherwise>unknown</xsl:otherwise>
|
110
|
</xsl:choose>
|
111
|
</xsl:attribute>
|
112
|
<xsl:value-of select="."/>
|
113
|
</alternateIdentifier>
|
114
|
</xsl:for-each>
|
115
|
</alternateIdentifiers>
|
116
|
|
117
|
<relatedIdentifiers/>
|
118
|
<sizes/>
|
119
|
<formats/>
|
120
|
|
121
|
<rightsList>
|
122
|
<xsl:for-each select="//dc:rights">
|
123
|
<rights>
|
124
|
<xsl:value-of select="."/>
|
125
|
</rights>
|
126
|
</xsl:for-each>
|
127
|
</rightsList>
|
128
|
|
129
|
<descriptions>
|
130
|
<xsl:for-each select="//dc:description">
|
131
|
<description descriptionType="Abstract">
|
132
|
<xsl:value-of select="."/>
|
133
|
</description>
|
134
|
</xsl:for-each>
|
135
|
</descriptions>
|
136
|
|
137
|
<geoLocations/>
|
138
|
|
139
|
<isti:projects>
|
140
|
<xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]">
|
141
|
<isti:project>
|
142
|
<isti:infoId><xsl:value-of select="." /></isti:infoId>
|
143
|
</isti:project>
|
144
|
</xsl:for-each>
|
145
|
</isti:projects>
|
146
|
|
147
|
</resource>
|
148
|
|
149
|
</oai:metadata>
|
150
|
</oai:record>
|
151
|
</xsl:template>
|
152
|
</xsl:stylesheet>
|
153
|
]]></CODE>
|
154
|
</SCRIPT>
|
155
|
</CONFIGURATION>
|
156
|
<STATUS/>
|
157
|
<SECURITY_PARAMETERS/>
|
158
|
</BODY>
|
159
|
</RESOURCE_PROFILE>
|