Project

General

Profile

1
<RESOURCE_PROFILE>
2
	<HEADER>
3
		<RESOURCE_IDENTIFIER value="BC1DE5CD-CEA3-431A-9692-817CAB61274C_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>Puma 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:dri="http://www.driver-repository.eu/namespace/dri" xmlns:istiFunction="eu.dnetlib.xml.ISTIUtilityFunction" 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 datetime istiFunction exslt dc ">
17
    <xsl:param name="varOfficialName"/>
18

    
19
    <xsl:variable name="tf" select="TransformationFunction:getInstance()"/>
20

    
21
    <xsl:template match="/">
22
        <oai:record>
23
            <xsl:copy-of select="//*[local-name()='header']"/>
24
            <oai:metadata>
25
                <resource xmlns="http://datacite.org/schema/kernel-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
26
                    <identifier identifierType="ISTI">
27
                        <xsl:value-of select="normalize-space(//dc:identifier)"/>
28
                    </identifier>
29
                    <creators>
30
                        <xsl:for-each select="//dc:creator">
31
                                <xsl:if test="string-length(istiFunction:cleanName(./dc:surname)) &gt; 0">
32
									<creator>
33
										<creatorName>
34
											<xsl:value-of select="istiFunction:cleanName(concat(normalize-space(./dc:surname), ' ', normalize-space(./dc:name)))"/>
35
										</creatorName>
36

    
37
										<xsl:if test="./dc:person_number">
38
											<nameIdentifier>
39
												<xsl:attribute name="nameIdentifierScheme">cnrIdentifier</xsl:attribute>
40
												<xsl:value-of select="normalize-space(./dc:person_number)"/>
41
											</nameIdentifier>
42
										</xsl:if>
43
										<xsl:if test="./dc:affiliation">
44
											<affiliation>
45
												<xsl:attribute name="department"><xsl:value-of select="TransformationFunction:convertString($tf, ./dc:department, 'Departments')"/></xsl:attribute>
46
												<xsl:value-of select="normalize-space(./dc:affiliation)"/>
47
											</affiliation>
48
										</xsl:if>
49
									</creator>
50
                                </xsl:if>
51

    
52
                        </xsl:for-each>
53
                    </creators>
54
                    <titles>
55
                        <xsl:for-each select="//dc:title">
56
                            <title>
57
                                <xsl:attribute name="xml:lang"><xsl:value-of select="//dc:language"/></xsl:attribute>
58
                                <xsl:value-of select="."/>
59
                            </title>
60
                        </xsl:for-each>
61
                    </titles>
62

    
63
                    <xsl:if test="//dc:publisher">
64
                        <publisher>
65
                            <xsl:value-of select="//dc:publisher[1]"/>
66
                        </publisher>
67
                    </xsl:if>
68

    
69
                    <subjects>
70
                        <xsl:for-each select="//dc:subject">
71
                            <subject>
72
                                <xsl:value-of select="."/>
73
                            </subject>
74
                        </xsl:for-each>
75
                        <xsl:for-each select="//dc:subject.acm">
76
                            <subject subjectScheme='acm'>
77
                                <xsl:value-of select="."/>
78
                            </subject>
79
                        </xsl:for-each>
80
                    </subjects>
81

    
82
                    <contributors>
83
                        <xsl:for-each select="//dc:contributor">
84
                            <xsl:for-each select="tokenize(.,',')">
85
                                <contributor>
86
                                    <contributorName>
87
                                        <xsl:value-of select="normalize-space(.)"/>
88
                                    </contributorName>
89
                                </contributor>
90
                            </xsl:for-each>
91
                        </xsl:for-each>
92
                    </contributors>
93
                    <dates>
94
                        <xsl:for-each select="//dc:date.publication">
95
                            <date dateType='Accepted'>
96
                                <xsl:value-of select="."/>
97
                            </date>
98
                        </xsl:for-each>
99
                    </dates>
100
                    <xsl:if test="//dc:language">
101
                        <language><xsl:value-of select="//dc:language[1]" /></language>
102
                    </xsl:if>
103
                    <xsl:for-each select="//dc:type">
104
                        <resourceType resourceTypeGeneral="Text"><xsl:value-of select="TransformationFunction:convertString($tf, ., 'TextTypologies')" /></resourceType>
105
                    </xsl:for-each>
106

    
107
                    <alternateIdentifiers>
108
	                   <xsl:for-each select="//dc:url">
109
                           <alternateIdentifier >
110
                               <xsl:attribute name="alternateIdentifierType" >url</xsl:attribute>
111
                               <xsl:value-of select="."/>
112
                           </alternateIdentifier>
113
                       </xsl:for-each>
114
                       <xsl:for-each select="//dc:identifier.resource">
115
                            <alternateIdentifier >
116
                                <xsl:attribute name="alternateIdentifierType" >url</xsl:attribute>
117
                                <xsl:value-of select="."/>
118
                            </alternateIdentifier>
119
                        </xsl:for-each>
120
                    </alternateIdentifiers>
121

    
122
                    <relatedIdentifiers />
123
                    <sizes />
124
                    <formats />
125

    
126
                    <rightsList>
127
                        <xsl:for-each select="//dc:file.copyright">
128
                            <rights><xsl:value-of select="." /></rights>
129
                        </xsl:for-each>
130
                    </rightsList>
131

    
132
                    <descriptions>
133
                        <xsl:for-each select="//dc:description">
134
                            <description descriptionType="Abstract"><xsl:value-of select="." /></description>
135
                        </xsl:for-each>
136
                    </descriptions>
137
                    
138
                    <geoLocations />
139
                    
140
                    <isti:projects>
141
                    	<xsl:for-each select="//dc:funds[./dc:relation.grantfund]">
142
                    		<isti:project>
143
                    			<isti:code><xsl:value-of select="./dc:relation.grantfund" /></isti:code>
144
                    			<isti:acronym><xsl:value-of select="./dc:relation.acronym_funding" /></isti:acronym>
145
                    		</isti:project>
146
                    	</xsl:for-each>
147
                    </isti:projects>
148

    
149
                </resource>
150

    
151
            </oai:metadata>
152
        </oai:record>
153
    </xsl:template>
154
</xsl:stylesheet>
155
                    ]]></CODE>
156
			</SCRIPT>
157
		</CONFIGURATION>
158
		<STATUS/>
159
		<SECURITY_PARAMETERS/>
160
	</BODY>
161
</RESOURCE_PROFILE>
(3-3/3)