Project

General

Profile

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_people">
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:cleanNames(.), '#')">
37
                            	<xsl:if test="string-length(.) &gt; 0">
38
                            		<creator>
39
                            			<creatorName><xsl:value-of select="."/></creatorName>
40
                            		</creator>
41
                            	</xsl:if>
42
                            </xsl:for-each>
43
                        </xsl:for-each>
44
                    </creators>
45
                    <titles>
46
                        <xsl:for-each select="//dc:title">
47
                            <title>
48
                                <xsl:value-of select="."/>
49
                            </title>
50
                        </xsl:for-each>
51
                    </titles>
52

    
53
                    <xsl:if test="//dc:publisher">
54
                        <publisher>
55
                            <xsl:value-of select="//dc:publisher[1]"/>
56
                        </publisher>
57
                    </xsl:if>
58

    
59
                    <subjects>
60
                        <xsl:for-each select="//dc:subject">
61
                            <subject>
62
                                <xsl:value-of select="."/>
63
                            </subject>
64
                        </xsl:for-each>
65
                    </subjects>
66

    
67
                    <contributors>
68
                        <xsl:for-each select="//dc:contributor">
69
                            <xsl:for-each select="tokenize(., ',')">
70
                                <contributor>
71
                                    <contributorName>
72
                                        <xsl:value-of select="normalize-space(.)"/>
73
                                    </contributorName>
74
                                </contributor>
75
                            </xsl:for-each>
76
                        </xsl:for-each>
77
                    </contributors>
78

    
79
                    <dates>
80
                        <xsl:for-each select="//dc:date">
81
                            <date dateType="Accepted">
82
                                <xsl:value-of select="."/>
83
                            </date>
84
                        </xsl:for-each>
85
                    </dates>
86

    
87
                    <xsl:if test="//dc:language">
88
                        <language><xsl:value-of select="TransformationFunction:convertString($tf, //dc:language[1], 'Languages')"/></language>
89
                    </xsl:if>
90

    
91
                    <xsl:for-each select="//dc:type">
92
                        <resourceType resourceTypeGeneral="Text">
93
                           <xsl:value-of select="TransformationFunction:convertString($tf, ., 'TextTypologies')" />
94
                        </resourceType>
95
                    </xsl:for-each>
96

    
97
                    <alternateIdentifiers>
98
	                    <xsl:for-each select="//dc:identifier">
99
	                           <xsl:if test="starts-with(., 'http') and not(contains(., 'dx.doi.org'))">
100
	                               <alternateIdentifier alternateIdentifierType="url"><xsl:value-of select="."/></alternateIdentifier>
101
	                           </xsl:if>
102
	                           <xsl:if test="starts-with(., 'info:doi:')">
103
	                           	  <xsl:variable name="doi" select="istiFunction:cleanDoi(substring-after(., 'info:doi:'))" />
104
	                               <alternateIdentifier alternateIdentifierType="url"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></alternateIdentifier>
105
	                               <alternateIdentifier alternateIdentifierType="doi"><xsl:value-of select="$doi"/></alternateIdentifier>
106
							  </xsl:if>
107
	                    </xsl:for-each>
108
                    </alternateIdentifiers>
109

    
110
                    <relatedIdentifiers/>
111
                    <sizes/>
112
                    <formats/>
113

    
114
                    <rightsList>
115
                        <xsl:for-each select="//dc:rights">
116
                            <rights>
117
                                <xsl:value-of select="."/>
118
                            </rights>
119
                        </xsl:for-each>
120
                    </rightsList>
121

    
122
                    <descriptions>
123
                        <xsl:for-each select="//dc:description">
124
                            <description descriptionType="Abstract">
125
                                <xsl:value-of select="."/>
126
                            </description>
127
                        </xsl:for-each>
128
                    </descriptions>
129

    
130
                    <geoLocations/>
131
                    
132
                    <sources>
133
                    	<xsl:for-each select="//dc:source[string-length(.) &gt; 20]">
134
                    		<source><xsl:value-of select="." /></source>
135
                    	</xsl:for-each>
136
                    </sources>
137
                    
138
                    <isti:projects>
139
                    	<xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]">
140
                    		<xsl:if test="istiFunction:isValidProject(.)">
141
	                    		<isti:project>
142
	                    			<isti:infoId><xsl:value-of select="." /></isti:infoId>
143
									<isti:openaireId />
144
									<isti:code />
145
									<isti:name />
146
									<isti:acronym />
147
									<isti:funder />
148
									<isti:program />
149
									<isti:jurisdiction />
150
								</isti:project>
151
							</xsl:if>
152
                    	</xsl:for-each>
153
                    </isti:projects>
154
                    
155
                    <isti:datasets />
156
                    
157
                    <isti:persons>
158
                    	<xsl:for-each select="//dc:relation[starts-with(., 'info:cnr-pdr/author')]">
159
                    		<isti:person>
160
                    			<isti:infoId><xsl:value-of select="." /></isti:infoId>
161
                    		</isti:person>
162
                    	</xsl:for-each>
163
                    </isti:persons>
164
                    
165
                    <isti:citations />
166
                    
167

    
168
                </resource>
169

    
170
            </oai:metadata>
171
        </oai:record>
172
    </xsl:template>
173
</xsl:stylesheet>
174
                    ]]></CODE>
175
			</SCRIPT>
176
		</CONFIGURATION>
177
		<STATUS/>
178
		<SECURITY_PARAMETERS/>
179
	</BODY>
180
</RESOURCE_PROFILE>
    (1-1/1)