Project

General

Profile

« Previous | Next » 

Revision 61311

profiles

View differences:

modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/people2pmf_with_rights.xml
1
<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
        <DATE_OF_CREATION value="2020-05-04T15:05:43+02:00"/>
8
    </HEADER>
9
    <BODY>
10
        <CONFIGURATION>
11
            <IMPORTED/>
12
            <SCRIPT>
13
                <TITLE>People to OpenPortalFormat with Rights</TITLE>
14
                <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
                   &lt;type&gt;&lt;xsl:value-of select="TransformationFunction:convertString($tf, //dc:type[1], 'TextTypologies')" /&gt;&lt;/type&gt;
75
                    
76
                   &lt;urls&gt;
77
	                    &lt;xsl:for-each select="//dc:identifier"&gt;
78
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')"&gt;
79
	                        &lt;!-- &lt;url rights="{$rights}" hostedBy="CNR People"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;--&gt;
80
	                        &lt;/xsl:if&gt;
81
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')"&gt;
82
	                           &lt;url rights="{$rights}" hostedBy="CNR ExploRA"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
83
	                        &lt;/xsl:if&gt;
84
	                        &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;
85
	                            &lt;url rights="{$rights}" hostedBy="{dnet:serverName(.)}"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
86
	                        &lt;/xsl:if&gt;
87
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org')"&gt;
88
	                            &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
89
	                        &lt;/xsl:if&gt;
90
	                        &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
91
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
92
	                            &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="concat('https://dx.doi.org/', $doi)"/&gt;&lt;/url&gt;
93
	                        &lt;/xsl:if&gt;
94
	                    &lt;/xsl:for-each&gt;
95
                    &lt;/urls&gt;
96
                    
97
                    &lt;dois&gt;
98
	                    &lt;xsl:for-each select="//dc:identifier"&gt;
99
	                        &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
100
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
101
	                            &lt;xsl:if test="$doi"&gt;&lt;doi&gt;&lt;xsl:value-of select="$doi"/&gt;&lt;/doi&gt;&lt;/xsl:if&gt;
102
	                        &lt;/xsl:if&gt;
103
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org/')"&gt;
104
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'doi.org/'))" /&gt;
105
	                            &lt;xsl:if test="$doi"&gt;&lt;doi&gt;&lt;xsl:value-of select="$doi"/&gt;&lt;/doi&gt;&lt;/xsl:if&gt;
106
	                        &lt;/xsl:if&gt;
107
	                    &lt;/xsl:for-each&gt;
108
                    &lt;/dois&gt;
109
                                        
110
                    &lt;bestRights&gt;&lt;xsl:value-of select="$rights" /&gt;&lt;/bestRights&gt;
111
                    
112
                    &lt;abstract&gt;&lt;xsl:value-of select="//dc:description[1]"/&gt;&lt;/abstract&gt;
113

  
114
					&lt;xsl:for-each select="//dc:source[(string-length(.) &gt; 10) and not(starts-with(.,'info:cnr-pdr/source')) ]"&gt; 
115
                    		&lt;xsl:if test="position() = 1"&gt;
116
                    			&lt;source&gt;&lt;xsl:value-of select="." /&gt;&lt;/source&gt;
117
                    		&lt;/xsl:if&gt;
118
                    &lt;/xsl:for-each&gt;
119
                    
120
                    &lt;projects&gt;
121
	                    &lt;xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]"&gt;
122
	                        &lt;xsl:if test="dnet:isValidProject(.)"&gt;
123
	                            &lt;project&gt;
124
	                                &lt;infoId&gt;&lt;xsl:value-of select="." /&gt;&lt;/infoId&gt;
125
	                                &lt;openaireId&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/openaireId&gt;
126
	                                &lt;code&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/code&gt;
127
	                                &lt;name&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/name&gt;
128
	                                &lt;acronym&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/acronym&gt;
129
	                                &lt;funder&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/funder&gt;
130
	                                &lt;program&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/program&gt;
131
	                                &lt;jurisdiction&gt;&lt;xsl:value-of select="position()" /&gt;&lt;/jurisdiction&gt;
132
	                            &lt;/project&gt;
133
	                        &lt;/xsl:if&gt;
134
	                    &lt;/xsl:for-each&gt;
135
                    &lt;/projects&gt;
136
                    
137
                     &lt;cnrPersons&gt;
138
	                    &lt;xsl:for-each select="//dc:relation[starts-with(., 'info:cnr-pdr/author')]"&gt;
139
	                        &lt;cnrPerson&gt;
140
	                            &lt;infoId&gt;&lt;xsl:value-of select="." /&gt;&lt;/infoId&gt;
141
	                            &lt;name&gt;&lt;xsl:value-of select="dnet:calculatePersonName(.)" /&gt;&lt;/name&gt;
142
	                        &lt;/cnrPerson&gt;
143
	                    &lt;/xsl:for-each&gt;
144
	                &lt;/cnrPersons&gt;
145
                    
146
                    &lt;citations /&gt;
147
                    
148
                    &lt;collections&gt;
149
                    		&lt;xsl:for-each select="//oai:setSpec[normalize-space(.) != 'openaire']"&gt;
150
	                        &lt;inCollection&gt;
151
	                        		&lt;code&gt;&lt;xsl:value-of select="normalize-space(.)" /&gt;&lt;/code&gt;
152
	                        		&lt;name /&gt;
153
	                             &lt;acronym /&gt;
154
	                        &lt;/inCollection&gt;
155
	                    &lt;/xsl:for-each&gt;
156
                    &lt;/collections&gt;
157
                    
158
                &lt;/record&gt;
159
                
160
            &lt;/oai:metadata&gt;
161
        &lt;/oai:record&gt;
162
    &lt;/xsl:template&gt;
163
&lt;/xsl:stylesheet&gt;
164
				</CODE>
165
            </SCRIPT>
166
        </CONFIGURATION>
167
        <STATUS/>
168
        <SECURITY_PARAMETERS/>
169
    </BODY>
170
</RESOURCE_PROFILE>
modules/dnet-isti/trunk/src/main/resources/eu/dnetlib/bootstrap/profiles/TransformationRuleDSResources/people2pmf.xml
1 1
<RESOURCE_PROFILE>
2 2
    <HEADER>
3
        <RESOURCE_IDENTIFIER value="60216DD9-8036-4CF8-A26D-DCDABBCED558_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
3
        <RESOURCE_IDENTIFIER value="be0f63b5-f4b7-47d5-9e87-a54e6911acd0_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/>
4 4
        <RESOURCE_TYPE value="TransformationRuleDSResourceType"/>
5 5
        <RESOURCE_KIND value="TransformationRuleDSResources"/>
6 6
        <RESOURCE_URI value=""/>
7
        <DATE_OF_CREATION value="2020-05-04T15:05:43+02:00"/>
7
        <DATE_OF_CREATION value="2020-11-30T09:36:08+01:00"/>
8 8
    </HEADER>
9 9
    <BODY>
10 10
        <CONFIGURATION>
11 11
            <IMPORTED/>
12 12
            <SCRIPT>
13
                <TITLE>People to OpenPortalFormat</TITLE>
13
                <TITLE>People to OpenPortal</TITLE>
14 14
                <CODE>
15 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 16
    xmlns:dnet="eu.dnetlib.data.utils.XsltFunctions"
......
21 21
    
22 22
    &lt;xsl:template match="/"&gt;
23 23
        
24
        &lt;xsl:variable name="rights" select="'Unknown'" /&gt;
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;
25 34
        
26 35
        &lt;oai:record&gt;
27 36
            &lt;xsl:copy-of select="//*[local-name() = 'header']"/&gt;
......
64 73
                                       
65 74
                   &lt;type&gt;&lt;xsl:value-of select="TransformationFunction:convertString($tf, //dc:type[1], 'TextTypologies')" /&gt;&lt;/type&gt;
66 75
                    
67
                    &lt;urls&gt;
68
                    &lt;xsl:for-each select="//dc:identifier"&gt;
69
                    &lt;xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')"&gt;
70
                    &lt;!-- &lt;url rights="{$rights}" hostedBy="CNR People"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;--&gt;
71
                    &lt;/xsl:if&gt;
72
                    &lt;xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')"&gt;
73
                    &lt;url rights="{$rights}" hostedBy="CNR ExploRA"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
74
                    &lt;/xsl:if&gt;
75
                    &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;
76
                    &lt;url rights="{$rights}" hostedBy="{dnet:serverName(.)}"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
77
                    &lt;/xsl:if&gt;
78
                    &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org')"&gt;
79
                    &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
80
                    &lt;/xsl:if&gt;
81
                    &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
82
                    &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
83
                    &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="concat('https://dx.doi.org/', $doi)"/&gt;&lt;/url&gt;
84
                    &lt;/xsl:if&gt;
85
                    &lt;/xsl:for-each&gt;
76
                                      &lt;urls&gt;
77
	                    &lt;xsl:for-each select="//dc:identifier"&gt;
78
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')"&gt;
79
	                        &lt;!-- &lt;url rights="{$rights}" hostedBy="CNR People"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;--&gt;
80
	                        &lt;/xsl:if&gt;
81
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')"&gt;
82
	                           &lt;url rights="{$rights}" hostedBy="CNR ExploRA"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
83
	                        &lt;/xsl:if&gt;
84
	                        &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;
85
	                            &lt;url rights="{$rights}" hostedBy="{dnet:serverName(.)}"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
86
	                        &lt;/xsl:if&gt;
87
	                        &lt;xsl:if test="starts-with(., 'http') and contains(., 'doi.org')"&gt;
88
	                            &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="."/&gt;&lt;/url&gt;
89
	                        &lt;/xsl:if&gt;
90
	                        &lt;xsl:if test="starts-with(., 'info:doi:')"&gt;
91
	                            &lt;xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /&gt;
92
	                            &lt;url rights="{$rights}" hostedBy="DOI Resolver"&gt;&lt;xsl:value-of select="concat('https://dx.doi.org/', $doi)"/&gt;&lt;/url&gt;
93
	                        &lt;/xsl:if&gt;
94
	                    &lt;/xsl:for-each&gt;
86 95
                    &lt;/urls&gt;
96

  
87 97
                    
88 98
                    &lt;dois&gt;
89 99
	                    &lt;xsl:for-each select="//dc:identifier"&gt;

Also available in: Unified diff