Revision 61311
Added by Michele Artini almost 3 years ago
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 |
<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="tmpRights"> |
|
25 |
<xsl:choose> |
|
26 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/closedAccess']">Closed Access</xsl:when> |
|
27 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/restrictedAccess']">Restricted</xsl:when> |
|
28 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/embargoedAccess']">Embargo</xsl:when> |
|
29 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/openAccess']">Open Access</xsl:when> |
|
30 |
<xsl:otherwise>Unknown</xsl:otherwise> |
|
31 |
</xsl:choose> |
|
32 |
</xsl:variable> |
|
33 |
<xsl:variable name="rights" select="normalize-space($tmpRights)"/> |
|
34 |
|
|
35 |
<oai:record> |
|
36 |
<xsl:copy-of select="//*[local-name() = 'header']"/> |
|
37 |
<oai:metadata> |
|
38 |
<record> |
|
39 |
|
|
40 |
<identifier><xsl:value-of select="normalize-space(//dri:recordIdentifier)"/></identifier> |
|
41 |
|
|
42 |
<title><xsl:value-of select="//dc:title[1]" /></title> |
|
43 |
|
|
44 |
<creators> |
|
45 |
<xsl:for-each select="//dc:creator"> |
|
46 |
<xsl:for-each select="tokenize(dnet:cleanNames(.), '#')"> |
|
47 |
<xsl:if test="string-length(.) &gt; 0"> |
|
48 |
<creator><xsl:value-of select="."/></creator> |
|
49 |
</xsl:if> |
|
50 |
</xsl:for-each> |
|
51 |
</xsl:for-each> |
|
52 |
</creators> |
|
53 |
|
|
54 |
<publisher><xsl:value-of select="//dc:publisher[1]"/></publisher> |
|
55 |
|
|
56 |
<subjects> |
|
57 |
<xsl:for-each select="//dc:subject"> |
|
58 |
<subject><xsl:value-of select="."/></subject> |
|
59 |
</xsl:for-each> |
|
60 |
</subjects> |
|
61 |
|
|
62 |
<contributors> |
|
63 |
<xsl:for-each select="//dc:contributor"> |
|
64 |
<xsl:for-each select="tokenize(., ',')"> |
|
65 |
<contributor><xsl:value-of select="normalize-space(.)"/></contributor> |
|
66 |
</xsl:for-each> |
|
67 |
</xsl:for-each> |
|
68 |
</contributors> |
|
69 |
|
|
70 |
<date><xsl:value-of select="//dc:date[1]"/></date> |
|
71 |
|
|
72 |
<language><xsl:value-of select="TransformationFunction:convertString($tf, //dc:language[1], 'Languages')"/></language> |
|
73 |
|
|
74 |
<type><xsl:value-of select="TransformationFunction:convertString($tf, //dc:type[1], 'TextTypologies')" /></type> |
|
75 |
|
|
76 |
<urls> |
|
77 |
<xsl:for-each select="//dc:identifier"> |
|
78 |
<xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')"> |
|
79 |
<!-- <url rights="{$rights}" hostedBy="CNR People"><xsl:value-of select="."/></url>--> |
|
80 |
</xsl:if> |
|
81 |
<xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')"> |
|
82 |
<url rights="{$rights}" hostedBy="CNR ExploRA"><xsl:value-of select="."/></url> |
|
83 |
</xsl:if> |
|
84 |
<xsl:if test="starts-with(., 'http') and not(contains(., 'doi.org/')) and not(contains(., '/www.cnr.it/')) and not(contains(., '/publications.cnr.it/'))"> |
|
85 |
<url rights="{$rights}" hostedBy="{dnet:serverName(.)}"><xsl:value-of select="."/></url> |
|
86 |
</xsl:if> |
|
87 |
<xsl:if test="starts-with(., 'http') and contains(., 'doi.org')"> |
|
88 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="."/></url> |
|
89 |
</xsl:if> |
|
90 |
<xsl:if test="starts-with(., 'info:doi:')"> |
|
91 |
<xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /> |
|
92 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></url> |
|
93 |
</xsl:if> |
|
94 |
</xsl:for-each> |
|
95 |
</urls> |
|
96 |
|
|
97 |
<dois> |
|
98 |
<xsl:for-each select="//dc:identifier"> |
|
99 |
<xsl:if test="starts-with(., 'info:doi:')"> |
|
100 |
<xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /> |
|
101 |
<xsl:if test="$doi"><doi><xsl:value-of select="$doi"/></doi></xsl:if> |
|
102 |
</xsl:if> |
|
103 |
<xsl:if test="starts-with(., 'http') and contains(., 'doi.org/')"> |
|
104 |
<xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'doi.org/'))" /> |
|
105 |
<xsl:if test="$doi"><doi><xsl:value-of select="$doi"/></doi></xsl:if> |
|
106 |
</xsl:if> |
|
107 |
</xsl:for-each> |
|
108 |
</dois> |
|
109 |
|
|
110 |
<bestRights><xsl:value-of select="$rights" /></bestRights> |
|
111 |
|
|
112 |
<abstract><xsl:value-of select="//dc:description[1]"/></abstract> |
|
113 |
|
|
114 |
<xsl:for-each select="//dc:source[(string-length(.) > 10) and not(starts-with(.,'info:cnr-pdr/source')) ]"> |
|
115 |
<xsl:if test="position() = 1"> |
|
116 |
<source><xsl:value-of select="." /></source> |
|
117 |
</xsl:if> |
|
118 |
</xsl:for-each> |
|
119 |
|
|
120 |
<projects> |
|
121 |
<xsl:for-each select="//dc:relation[starts-with(., 'info:eu-repo/grantAgreement')]"> |
|
122 |
<xsl:if test="dnet:isValidProject(.)"> |
|
123 |
<project> |
|
124 |
<infoId><xsl:value-of select="." /></infoId> |
|
125 |
<openaireId><xsl:value-of select="position()" /></openaireId> |
|
126 |
<code><xsl:value-of select="position()" /></code> |
|
127 |
<name><xsl:value-of select="position()" /></name> |
|
128 |
<acronym><xsl:value-of select="position()" /></acronym> |
|
129 |
<funder><xsl:value-of select="position()" /></funder> |
|
130 |
<program><xsl:value-of select="position()" /></program> |
|
131 |
<jurisdiction><xsl:value-of select="position()" /></jurisdiction> |
|
132 |
</project> |
|
133 |
</xsl:if> |
|
134 |
</xsl:for-each> |
|
135 |
</projects> |
|
136 |
|
|
137 |
<cnrPersons> |
|
138 |
<xsl:for-each select="//dc:relation[starts-with(., 'info:cnr-pdr/author')]"> |
|
139 |
<cnrPerson> |
|
140 |
<infoId><xsl:value-of select="." /></infoId> |
|
141 |
<name><xsl:value-of select="dnet:calculatePersonName(.)" /></name> |
|
142 |
</cnrPerson> |
|
143 |
</xsl:for-each> |
|
144 |
</cnrPersons> |
|
145 |
|
|
146 |
<citations /> |
|
147 |
|
|
148 |
<collections> |
|
149 |
<xsl:for-each select="//oai:setSpec[normalize-space(.) != 'openaire']"> |
|
150 |
<inCollection> |
|
151 |
<code><xsl:value-of select="normalize-space(.)" /></code> |
|
152 |
<name /> |
|
153 |
<acronym /> |
|
154 |
</inCollection> |
|
155 |
</xsl:for-each> |
|
156 |
</collections> |
|
157 |
|
|
158 |
</record> |
|
159 |
|
|
160 |
</oai:metadata> |
|
161 |
</oai:record> |
|
162 |
</xsl:template> |
|
163 |
</xsl:stylesheet> |
|
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 |
<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 |
<xsl:template match="/"> |
23 | 23 |
|
24 |
<xsl:variable name="rights" select="'Unknown'" /> |
|
24 |
<xsl:variable name="tmpRights"> |
|
25 |
<xsl:choose> |
|
26 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/closedAccess']">Closed Access</xsl:when> |
|
27 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/restrictedAccess']">Restricted</xsl:when> |
|
28 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/embargoedAccess']">Embargo</xsl:when> |
|
29 |
<xsl:when test=".//dc:rights[.='info:eu-repo/semantics/openAccess']">Open Access</xsl:when> |
|
30 |
<xsl:otherwise>Unknown</xsl:otherwise> |
|
31 |
</xsl:choose> |
|
32 |
</xsl:variable> |
|
33 |
<xsl:variable name="rights" select="normalize-space($tmpRights)"/> |
|
25 | 34 |
|
26 | 35 |
<oai:record> |
27 | 36 |
<xsl:copy-of select="//*[local-name() = 'header']"/> |
... | ... | |
64 | 73 |
|
65 | 74 |
<type><xsl:value-of select="TransformationFunction:convertString($tf, //dc:type[1], 'TextTypologies')" /></type> |
66 | 75 |
|
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 contains(., 'publications.cnr.it')"> |
|
73 |
<url rights="{$rights}" hostedBy="CNR ExploRA"><xsl:value-of select="."/></url> |
|
74 |
</xsl:if> |
|
75 |
<xsl:if test="starts-with(., 'http') and not(contains(., 'doi.org/')) and not(contains(., '/www.cnr.it/')) and not(contains(., '/publications.cnr.it/'))"> |
|
76 |
<url rights="{$rights}" hostedBy="{dnet:serverName(.)}"><xsl:value-of select="."/></url> |
|
77 |
</xsl:if> |
|
78 |
<xsl:if test="starts-with(., 'http') and contains(., 'doi.org')"> |
|
79 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="."/></url> |
|
80 |
</xsl:if> |
|
81 |
<xsl:if test="starts-with(., 'info:doi:')"> |
|
82 |
<xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" /> |
|
83 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></url> |
|
84 |
</xsl:if> |
|
85 |
</xsl:for-each> |
|
76 |
<urls>
|
|
77 |
<xsl:for-each select="//dc:identifier">
|
|
78 |
<xsl:if test="starts-with(., 'http') and contains(., 'www.cnr.it')">
|
|
79 |
<!-- <url rights="{$rights}" hostedBy="CNR People"><xsl:value-of select="."/></url>-->
|
|
80 |
</xsl:if>
|
|
81 |
<xsl:if test="starts-with(., 'http') and contains(., 'publications.cnr.it')">
|
|
82 |
<url rights="{$rights}" hostedBy="CNR ExploRA"><xsl:value-of select="."/></url>
|
|
83 |
</xsl:if>
|
|
84 |
<xsl:if test="starts-with(., 'http') and not(contains(., 'doi.org/')) and not(contains(., '/www.cnr.it/')) and not(contains(., '/publications.cnr.it/'))">
|
|
85 |
<url rights="{$rights}" hostedBy="{dnet:serverName(.)}"><xsl:value-of select="."/></url>
|
|
86 |
</xsl:if>
|
|
87 |
<xsl:if test="starts-with(., 'http') and contains(., 'doi.org')">
|
|
88 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="."/></url>
|
|
89 |
</xsl:if>
|
|
90 |
<xsl:if test="starts-with(., 'info:doi:')">
|
|
91 |
<xsl:variable name="doi" select="dnet:cleanDoi(substring-after(., 'info:doi:'))" />
|
|
92 |
<url rights="{$rights}" hostedBy="DOI Resolver"><xsl:value-of select="concat('https://dx.doi.org/', $doi)"/></url>
|
|
93 |
</xsl:if>
|
|
94 |
</xsl:for-each>
|
|
86 | 95 |
</urls> |
96 |
|
|
87 | 97 |
|
88 | 98 |
<dois> |
89 | 99 |
<xsl:for-each select="//dc:identifier"> |
Also available in: Unified diff
profiles