Project

General

Profile

1 59802 michele.ar
<RESOURCE_PROFILE>
2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="be0f63b5-f4b7-47d5-9e87-a54e6911acd0_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6
        <RESOURCE_URI value=""/>
7 61311 michele.ar
        <DATE_OF_CREATION value="2020-11-30T09:36:08+01:00"/>
8 59802 michele.ar
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13 61311 michele.ar
                <TITLE>People to OpenPortal</TITLE>
14 59802 michele.ar
                <CODE>
15
&lt;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 "&gt;
18
    &lt;xsl:param name="varOfficialName"/&gt;
19
20
    &lt;xsl:variable name="tf" select="TransformationFunction:getInstance()" /&gt;
21
22
    &lt;xsl:template match="/"&gt;
23
24
	&lt;xsl:variable name="tmpRights"&gt;
25
            &lt;xsl:choose&gt;
26
                &lt;xsl:when test=".//dc:rights[.='info:eu-repo/semantics/closedAccess']"&gt;Closed Access&lt;/xsl:when&gt;
27
                &lt;xsl:when test=".//dc:rights[.='info:eu-repo/semantics/restrictedAccess']"&gt;Restricted&lt;/xsl:when&gt;
28
                &lt;xsl:when test=".//dc:rights[.='info:eu-repo/semantics/embargoedAccess']"&gt;Embargo&lt;/xsl:when&gt;
29
                &lt;xsl:when test=".//dc:rights[.='info:eu-repo/semantics/openAccess']"&gt;Open Access&lt;/xsl:when&gt;
30
                &lt;xsl:otherwise&gt;Unknown&lt;/xsl:otherwise&gt;
31
            &lt;/xsl:choose&gt;
32
        &lt;/xsl:variable&gt;
33
        &lt;xsl:variable name="rights" select="normalize-space($tmpRights)"/&gt;
34
35
        &lt;oai:record&gt;
36
            &lt;xsl:copy-of select="//*[local-name() = 'header']"/&gt;
37
            &lt;oai:metadata&gt;
38
                &lt;record&gt;
39
40
                    &lt;identifier&gt;&lt;xsl:value-of select="normalize-space(//dri:recordIdentifier)"/&gt;&lt;/identifier&gt;
41
42
                    &lt;title&gt;&lt;xsl:value-of select="//dc:title[1]" /&gt;&lt;/title&gt;
43
44
                    &lt;creators&gt;
45
	                    &lt;xsl:for-each select="//dc:creator"&gt;
46
	                        &lt;xsl:for-each select="tokenize(dnet:cleanNames(.), '#')"&gt;
47
	                            &lt;xsl:if test="string-length(.) &amp;gt; 0"&gt;
48
	                                &lt;creator&gt;&lt;xsl:value-of select="."/&gt;&lt;/creator&gt;
49
	                            &lt;/xsl:if&gt;
50
	                        &lt;/xsl:for-each&gt;
51
	                    &lt;/xsl:for-each&gt;
52
                    &lt;/creators&gt;
53
54
                    &lt;publisher&gt;&lt;xsl:value-of select="//dc:publisher[1]"/&gt;&lt;/publisher&gt;
55
56
					&lt;subjects&gt;
57
	                    &lt;xsl:for-each select="//dc:subject"&gt;
58
	                        &lt;subject&gt;&lt;xsl:value-of select="."/&gt;&lt;/subject&gt;
59
	                    &lt;/xsl:for-each&gt;
60
	                &lt;/subjects&gt;
61
62
                    &lt;contributors&gt;
63
	                    &lt;xsl:for-each select="//dc:contributor"&gt;
64
	                        &lt;xsl:for-each select="tokenize(., ',')"&gt;
65
	                            &lt;contributor&gt;&lt;xsl:value-of select="normalize-space(.)"/&gt;&lt;/contributor&gt;
66
	                        &lt;/xsl:for-each&gt;
67
	                    &lt;/xsl:for-each&gt;
68
	               &lt;/contributors&gt;
69
70
                   &lt;date&gt;&lt;xsl:value-of select="//dc:date[1]"/&gt;&lt;/date&gt;
71
72
                   &lt;language&gt;&lt;xsl:value-of select="TransformationFunction:convertString($tf, //dc:language[1], 'Languages')"/&gt;&lt;/language&gt;
73
74 61314 michele.ar
                   &lt;xsl:variable name="infoType" select="normalize-space(//dc:type[contains(.,'info:eu-repo/semantics')])"/&gt;
75
                   &lt;xsl:variable name="peopleType" select="normalize-space(//dc:type[not(contains(.,'info:eu-repo/semantics'))])"/&gt;
76
                   &lt;xsl:choose&gt;
77 61315 michele.ar
                       &lt;xsl:when test="contains($infoType,'masterThesis')"&gt;
78 61314 michele.ar
                           &lt;type&gt;Master thesis&lt;/type&gt;
79
                       &lt;/xsl:when&gt;
80 61315 michele.ar
                       &lt;xsl:when test="contains($infoType,'doctoralThesis')"&gt;
81 61314 michele.ar
                           &lt;type&gt;Doctoral thesis&lt;/type&gt;
82
                       &lt;/xsl:when&gt;
83 61315 michele.ar
                       &lt;xsl:when test="contains($infoType,'bachelorThesis')"&gt;
84 61314 michele.ar
                           &lt;type&gt;Bachelor thesis&lt;/type&gt;
85
                       &lt;/xsl:when&gt;
86
                       &lt;xsl:otherwise&gt;
87 61656 michele.ar
                           &lt;type&gt;&lt;xsl:value-of select="TransformationFunction:convertString($tf, $peopleType, 'IopTypologies')" /&gt;&lt;/type&gt;
88 61314 michele.ar
                       &lt;/xsl:otherwise&gt;
89
                   &lt;/xsl:choose&gt;
90
91
                   &lt;urls&gt;
92 59802 michele.ar
	                    &lt;xsl:for-each select="//dc:identifier"&gt;
93
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')"&gt;
94 59808 michele.ar
	                        &lt;!-- &lt;url rights="{$rights}" hostedBy="CNR People"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;--&gt;
95 59802 michele.ar
	                        &lt;/xsl:if&gt;
96 59808 michele.ar
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')"&gt;
97 59985 michele.ar
	                           &lt;url rights="{$rights}" hostedBy="CNR ExploRA"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
98 59808 michele.ar
	                        &lt;/xsl:if&gt;
99
	                        &lt;xsl:if test="starts-with(., 'http') and not(contains(., 'doi.org/')) and not(contains(., '/www.cnr.it/')) and not(contains(., '/publications.cnr.it/'))"&gt;
100 59802 michele.ar
	                            &lt;url rights="{$rights}" hostedBy="{dnet:serverName(.)}"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
101
	                        &lt;/xsl:if&gt;
102 61532 michele.ar
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org/')"&gt;
103
                                &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'doi.org/'))" /&gt;
104
								&lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="concat('https://dx.doi.org/', $doi)"/&gt;&lt;/url&gt;
105 59802 michele.ar
	                        &lt;/xsl:if&gt;
106
	                        &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
107
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
108
	                            &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="concat('https://dx.doi.org/', $doi)"/&gt;&lt;/url&gt;
109
	                        &lt;/xsl:if&gt;
110
	                    &lt;/xsl:for-each&gt;
111
                    &lt;/urls&gt;
112 61311 michele.ar
113 59802 michele.ar
114
                    &lt;dois&gt;
115
	                    &lt;xsl:for-each select="//dc:identifier"&gt;
116
	                        &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
117
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
118
	                            &lt;xsl:if test="$doi"&gt;&lt;doi&gt;&lt;xsl:value-of select="$doi"/&gt;&lt;/doi&gt;&lt;/xsl:if&gt;
119
	                        &lt;/xsl:if&gt;
120
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org/')"&gt;
121
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'doi.org/'))" /&gt;
122
	                            &lt;xsl:if test="$doi"&gt;&lt;doi&gt;&lt;xsl:value-of select="$doi"/&gt;&lt;/doi&gt;&lt;/xsl:if&gt;
123
	                        &lt;/xsl:if&gt;
124
	                    &lt;/xsl:for-each&gt;
125
                    &lt;/dois&gt;
126
127
                    &lt;bestRights&gt;&lt;xsl:value-of select="$rights" /&gt;&lt;/bestRights&gt;
128
129
                    &lt;abstract&gt;&lt;xsl:value-of select="//dc:description[1]"/&gt;&lt;/abstract&gt;
130
131
					&lt;xsl:for-each select="//dc:source[(string-length(.) &gt; 10) and not(starts-with(.,'info:cnr-pdr/source')) ]"&gt;
132
                    		&lt;xsl:if test="position() = 1"&gt;
133
                    			&lt;source&gt;&lt;xsl:value-of select="." /&gt;&lt;/source&gt;
134
                    		&lt;/xsl:if&gt;
135
                    &lt;/xsl:for-each&gt;
136
137
                    &lt;projects&gt;
138
	                    &lt;xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]"&gt;
139
	                        &lt;xsl:if test="dnet:isValidProject(.)"&gt;
140
	                            &lt;project&gt;
141
	                                &lt;infoId&gt;&lt;xsl:value-of select="." /&gt;&lt;/infoId&gt;
142
	                                &lt;openaireId&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/openaireId&gt;
143
	                                &lt;code&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/code&gt;
144
	                                &lt;name&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/name&gt;
145
	                                &lt;acronym&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/acronym&gt;
146
	                                &lt;funder&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/funder&gt;
147
	                                &lt;program&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/program&gt;
148
	                                &lt;jurisdiction&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/jurisdiction&gt;
149
	                            &lt;/project&gt;
150
	                        &lt;/xsl:if&gt;
151
	                    &lt;/xsl:for-each&gt;
152
                    &lt;/projects&gt;
153
154
                     &lt;cnrPersons&gt;
155
	                    &lt;xsl:for-each select="//dc:relation[starts-with(., 'info:cnr-pdr/author')]"&gt;
156
	                        &lt;cnrPerson&gt;
157
	                            &lt;infoId&gt;&lt;xsl:value-of select="." /&gt;&lt;/infoId&gt;
158
	                            &lt;name&gt;&lt;xsl:value-of select="dnet:calculatePersonName(.)" /&gt;&lt;/name&gt;
159
	                        &lt;/cnrPerson&gt;
160
	                    &lt;/xsl:for-each&gt;
161
	                &lt;/cnrPersons&gt;
162
163
                    &lt;citations /&gt;
164
165
                    &lt;collections&gt;
166
                    		&lt;xsl:for-each select="//oai:setSpec[normalize-space(.) != 'openaire']"&gt;
167
	                        &lt;inCollection&gt;
168
	                        		&lt;code&gt;&lt;xsl:value-of select="normalize-space(.)" /&gt;&lt;/code&gt;
169
	                        		&lt;name /&gt;
170
	                             &lt;acronym /&gt;
171
	                        &lt;/inCollection&gt;
172
	                    &lt;/xsl:for-each&gt;
173
                    &lt;/collections&gt;
174
175
                &lt;/record&gt;
176
177
            &lt;/oai:metadata&gt;
178
        &lt;/oai:record&gt;
179
    &lt;/xsl:template&gt;
180
&lt;/xsl:stylesheet&gt;
181
				</CODE>
182
            </SCRIPT>
183
        </CONFIGURATION>
184
        <STATUS/>
185
        <SECURITY_PARAMETERS/>
186
    </BODY>
187
</RESOURCE_PROFILE>