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 OpenPortalFormat</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:dnet="eu.dnetlib.data.utils.XsltFunctions"
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 dnet datetime exslt dc ">
18
    <xsl:param name="varOfficialName"/>
19
    
20
    <xsl:variable name="tf" select="TransformationFunction:getInstance()" />
21
    
22
    <xsl:template match="/">
23
        
24
        <xsl:variable name="rights" select="'Unknown'" />
25
        
26
        <oai:record>
27
            <xsl:copy-of select="//*[local-name() = 'header']"/>
28
            <oai:metadata>
29
                <record>
30
                    
31
                    <identifier><xsl:value-of select="normalize-space(//dri:recordIdentifier)"/></identifier>
32
                    
33
                    <title><xsl:value-of select="//dc:title[1]" /></title>
34
                    
35
                    <creators>
36
	                    <xsl:for-each select="//dc:creator">
37
	                        <xsl:for-each select="tokenize(dnet:cleanNames(.), '#')">
38
	                            <xsl:if test="string-length(.) &gt; 0">
39
	                                <creator><xsl:value-of select="."/></creator>
40
	                            </xsl:if>
41
	                        </xsl:for-each>
42
	                    </xsl:for-each>
43
                    </creators>
44
                    
45
                    <publisher><xsl:value-of select="//dc:publisher[1]"/></publisher>
46

    
47
					<subjects>
48
	                    <xsl:for-each select="//dc:subject">
49
	                        <subject><xsl:value-of select="."/></subject>
50
	                    </xsl:for-each>
51
	                </subjects>
52
                    
53
                    <contributors>
54
	                    <xsl:for-each select="//dc:contributor">
55
	                        <xsl:for-each select="tokenize(., ',')">
56
	                            <contributor><xsl:value-of select="normalize-space(.)"/></contributor>
57
	                        </xsl:for-each>
58
	                    </xsl:for-each>
59
	               </contributors>
60
                    
61
                   <date><xsl:value-of select="//dc:date[1]"/></date>
62
                                       
63
                   <language><xsl:value-of select="TransformationFunction:convertString($tf, //dc:language[1], 'Languages')"/></language>
64
                                       
65
                   <type><xsl:value-of select="TransformationFunction:convertString($tf, //dc:type[1], 'TextTypologies')" /></type>
66
                    
67
                   <urls>
68
	                    <xsl:for-each select="//dc:identifier">
69
	                        <xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')">
70
	                            <url rights="{$rights}" hostedBy="CNR People"><xsl:value-of select="."/></url>
71
	                        </xsl:if>
72
	                        <xsl:if test="starts-with(., 'http') and not(contains(., 'dx.doi.org')) and not(contains(., 'www.cnr.it'))">
73
	                            <url rights="{$rights}" hostedBy="Unknown"><xsl:value-of select="."/></url>
74
	                        </xsl:if>
75
	                        <xsl:if test="starts-with(., 'info:doi:')">
76
	                            <xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" />
77
	                            <url rights="{$rights}" hostedBy="Unknown"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></url>
78
	                        </xsl:if>
79
	                    </xsl:for-each>
80
                    </urls>
81
                    
82
                    <dois>
83
	                    <xsl:for-each select="//dc:identifier">
84
	                        <xsl:if test="starts-with(., 'info:doi:')">
85
	                            <xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" />
86
	                            <doi><xsl:value-of select="$doi"/></doi>
87
	                        </xsl:if>
88
	                    </xsl:for-each>
89
                    </dois>
90
                                        
91
                    <bestRights><xsl:value-of select="$rights" /></bestRights>
92
                    
93
                    <abstract><xsl:value-of select="//dc:description[1]"/></abstract>
94

    
95
                    <source><xsl:value-of select="//dc:source[string-length(.) &gt; 20]" /></source>
96
                    
97
                    <projects>
98
	                    <xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]">
99
	                        <xsl:if test="dnet:isValidProject(.)">
100
	                            <project>
101
	                                <infoId><xsl:value-of select="." /></infoId>
102
	                                <openaireId />
103
	                                <code />
104
	                                <name />
105
	                                <acronym />
106
	                                <funder />
107
	                                <program />
108
	                                <jurisdiction />
109
	                            </project>
110
	                        </xsl:if>
111
	                    </xsl:for-each>
112
                    </projects>
113
                    
114
                     <cnrPersons>
115
	                    <xsl:for-each select="//dc:relation[starts-with(., 'info:cnr-pdr/author')]">
116
	                        <cnrPerson>
117
	                            <infoId><xsl:value-of select="." /></infoId>
118
	                            <name><xsl:value-of select="dnet:calculatePersonName(.)" /></name>
119
	                        </cnrPerson>
120
	                    </xsl:for-each>
121
	                </cnrPersons>
122
                    
123
                    <citations />
124
                    
125
                </record>
126
                
127
            </oai:metadata>
128
        </oai:record>
129
    </xsl:template>
130
</xsl:stylesheet>
131
                    ]]></CODE>
132
			</SCRIPT>
133
		</CONFIGURATION>
134
		<STATUS/>
135
		<SECURITY_PARAMETERS/>
136
	</BODY>
137
</RESOURCE_PROFILE>
    (1-1/1)