Revision 55452
Added by Alessia Bardi over 5 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/datacite_rules.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8"?> |
|
2 | 1 |
<RESOURCE_PROFILE> |
3 |
<HEADER> |
|
4 |
<RESOURCE_IDENTIFIER value="754faf14-fe72-46b3-a219-e0423f8bb732_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
5 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
6 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
7 |
<RESOURCE_URI value=""/> |
|
8 |
<DATE_OF_CREATION value="2014-01-08T23:27:01+01:00"/> |
|
9 |
</HEADER> |
|
10 |
<BODY> |
|
11 |
<CONFIGURATION> |
|
12 |
<IMPORTED/> |
|
13 |
<SCRIPT> |
|
14 |
<TITLE>xslt_cleaning_datacite</TITLE> |
|
15 |
<CODE><![CDATA[ |
|
16 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |
|
17 |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
19 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
20 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
21 |
extension-element-prefixes="TransformationFunction" |
|
22 |
exclude-result-prefixes="TransformationFunction"> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="754faf14-fe72-46b3-a219-e0423f8bb732_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2019-04-12T13:51:38+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<IMPORTED/> |
|
12 |
<SCRIPT> |
|
13 |
<TITLE>xslt_cleaning_datacite</TITLE> |
|
14 |
<CODE> |
|
15 |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.1" |
|
16 |
xmlns:oaf="http://namespace.openaire.eu/oaf" |
|
17 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
18 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
19 |
extension-element-prefixes="TransformationFunction" |
|
20 |
exclude-result-prefixes="TransformationFunction"> |
|
23 | 21 |
|
24 |
<xsl:param name="varOfficialName" />
|
|
25 |
<xsl:param name="varDsType" />
|
|
26 |
<xsl:param name="varDataSourceId" />
|
|
27 |
<xsl:param name="varFP7" select="'corda_______::'"/>
|
|
28 |
<xsl:param name="varH2020" select="'corda__h2020::'"/>
|
|
29 |
<xsl:param name="varHostedByOfficialName" select="'Unknown Repository'"/>
|
|
30 |
<xsl:param name="varHostedByDataSourceId" select="'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'"/>
|
|
22 |
<xsl:param name="varOfficialName"/>
|
|
23 |
<xsl:param name="varDsType"/>
|
|
24 |
<xsl:param name="varDataSourceId"/>
|
|
25 |
<xsl:param name="varFP7" select="'corda_______::'"/>
|
|
26 |
<xsl:param name="varH2020" select="'corda__h2020::'"/>
|
|
27 |
<xsl:param name="varHostedByOfficialName" select="'Unknown Repository'"/>
|
|
28 |
<xsl:param name="varHostedByDataSourceId" select="'openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18'"/>
|
|
31 | 29 |
|
32 |
<xsl:param name="index" select="0"/> |
|
33 |
<xsl:param name="transDate" select="current-dateTime()"/> |
|
34 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
|
30 |
<xsl:param name="index" select="0"/> |
|
31 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
|
35 | 32 |
|
33 |
<!-- with the re-change of the CAP, those filters can be turned off --> |
|
34 |
<!-- conditions whether content acquisitions are met --> |
|
35 |
<!-- |
|
36 |
<xsl:variable name="varCap1AccRhts" select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('OPEN', 'OPEN SOURCE')],1,1), 'AccessRights') = ('OPEN', 'OPEN SOURCE')"/> |
|
37 |
<xsl:variable name="varCap2LinkPub" select="exists(//*[local-name()='relatedIdentifier'][@relationType = ('IsCitedBy', 'IsDescribedBy','IsDocumentedBy', 'IsReferencedBy', 'Cites', 'Describes', 'Documents', 'References')])"/> |
|
38 |
<xsl:variable name="varCap3Project" select="exists(//*[local-name()='fundingReference'][string-length(normalize-space(./*[local-name()='awardNumber']))> 0])"/> |
|
39 |
<xsl:variable name="varCap4Comnty" /> |
|
40 |
--> |
|
41 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, //*[local-name()='resourceType']/@resourceTypeGeneral, 'TextTypologies')"/> |
|
42 |
<xsl:variable name="varSuperType" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/> |
|
36 | 43 |
|
37 |
<xsl:template match="/"> |
|
38 |
<xsl:variable name="datasourcePrefix" |
|
39 |
select="normalize-space(//oaf:datasourceprefix)" /> |
|
44 |
<xsl:template match="/"> |
|
45 |
<xsl:variable name="datasourcePrefix" |
|
46 |
select="normalize-space(//oaf:datasourceprefix)"/> |
|
47 |
<xsl:call-template name="validRecord"/> |
|
48 |
</xsl:template> |
|
40 | 49 |
|
41 |
<xsl:if test="not(//*[local-name()='title'][string-length(.)> 0]) or (//*[local-name()='resourceType'][lower-case(.)='article'] or not(lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual') or //*[local-name()='resourceType'][@resourceTypeGeneral='Other' and .='Study']))"> |
|
42 |
<xsl:call-template name="terminate"/> |
|
43 |
</xsl:if> |
|
50 |
<xsl:template name="terminate"> |
|
51 |
<xsl:message terminate="yes"> |
|
52 |
record is not compliant, transformation is interrupted. |
|
53 |
</xsl:message> |
|
54 |
</xsl:template> |
|
44 | 55 |
|
56 |
<xsl:template name="validRecord"> |
|
57 |
<record> |
|
58 |
<xsl:copy-of select="//*[local-name() = 'header']"/> |
|
45 | 59 |
|
46 |
<xsl:call-template name="validRecord" /> |
|
47 |
</xsl:template> |
|
60 |
<metadata> |
|
48 | 61 |
|
49 |
<xsl:template name="terminate"> |
|
50 |
<xsl:message terminate="yes"> |
|
51 |
record is not compliant, transformation is interrupted. |
|
52 |
</xsl:message> |
|
53 |
</xsl:template> |
|
62 |
<xsl:apply-templates select="//*[local-name() = 'metadata']/*[local-name() = 'resource']"/> |
|
54 | 63 |
|
55 |
<xsl:template name="validRecord"> |
|
56 |
<record> |
|
57 |
<xsl:apply-templates select="//*[local-name() = 'header']" /> |
|
64 |
<xsl:if test="//*[local-name()='date']/@dateType='Available'"> |
|
65 |
<xsl:variable name='varEmbargoEndDate' |
|
66 |
select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/> |
|
67 |
<xsl:choose> |
|
68 |
<xsl:when test="string-length($varEmbargoEndDate) > 0"> |
|
69 |
<oaf:embargoenddate> |
|
70 |
<xsl:value-of select="$varEmbargoEndDate"/> |
|
71 |
</oaf:embargoenddate> |
|
72 |
</xsl:when> |
|
73 |
<xsl:otherwise> |
|
74 |
<xsl:call-template name="terminate"/> |
|
75 |
</xsl:otherwise> |
|
76 |
</xsl:choose> |
|
77 |
</xsl:if> |
|
58 | 78 |
|
59 |
<metadata> |
|
79 |
<!-- |
|
80 |
<xsl:choose> |
|
60 | 81 |
|
61 |
<xsl:apply-templates select="//*[local-name() = 'metadata']/*[local-name() = 'resource']"/>
|
|
82 |
<xsl:when test="//*[local-name()='resourceType']/@resourceTypeGeneral='Dataset' or //*[local-name()='resourceType']/@resourceTypeGeneral='Software' or //*[local-name()='resourceType']/@resourceTypeGeneral='Film' or //*[local-name()='resourceType']/@resourceTypeGeneral='Sound' or //*[local-name()='resourceType']/@resourceTypeGeneral='PhysicalObject' or //*[local-name()='resourceType']/@resourceTypeGeneral='Audiovisual' or //*[local-name()='resourceType'][@resourceTypeGeneral='Other' and .='Study']">
|
|
62 | 83 |
|
63 |
<!-- |
|
64 |
<xsl:when test="not(//*[local-name()='resourceType'][lower-case(.)='article']) and lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual') or //*[local-name()='resourceType'][@resourceTypeGeneral='Other' and .='Study']"> |
|
65 |
--> |
|
84 |
<xsl:when test="//*[local-name()='resourceType'][lower-case(.)='article'] or lower-case(//*[local-name()='resourceType']/@resourceTypeGeneral)=('dataset', 'software', 'collection', 'film', 'sound', 'physicalobject', 'audiovisual', 'model', 'workflow', 'service', 'image') or //*[local-name()='resourceType'][lower-case(@resourceTypeGeneral)='other' and lower-case(.)='study']"> |
|
66 | 85 |
|
67 |
<dr:CobjCategory> |
|
68 |
<xsl:value-of |
|
69 |
select="TransformationFunction:convertString($tf, //*[local-name()='resourceType']/@resourceTypeGeneral, 'TextTypologies')" /> |
|
70 |
</dr:CobjCategory> |
|
86 |
<dr:CobjCategory> |
|
87 |
<xsl:variable name='varCobjCategory' |
|
88 |
select="TransformationFunction:convertString($tf, //*[local-name()='resourceType']/@resourceTypeGeneral, 'TextTypologies')" /> |
|
89 |
<xsl:attribute name="type"> |
|
90 |
<xsl:value-of select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')"/> |
|
91 |
</xsl:attribute> |
|
92 |
<xsl:value-of |
|
93 |
select="$varCobjCategory" /> |
|
94 |
</dr:CobjCategory> |
|
95 |
</xsl:when> |
|
96 |
<xsl:otherwise> |
|
97 |
<xsl:call-template name="terminate"/> |
|
98 |
</xsl:otherwise> |
|
99 |
</xsl:choose> |
|
100 |
--> |
|
71 | 101 |
|
72 |
<!--
|
|
73 |
</xsl:when>
|
|
74 |
<xsl:otherwise>
|
|
75 |
<xsl:call-template name="terminate"/>
|
|
76 |
</xsl:otherwise>
|
|
77 |
</xsl:choose>
|
|
102 |
<dr:CobjCategory>
|
|
103 |
<xsl:attribute name="type">
|
|
104 |
<xsl:value-of select="$varSuperType"/>
|
|
105 |
</xsl:attribute>
|
|
106 |
<xsl:value-of select="$varCobjCategory"/>
|
|
107 |
</dr:CobjCategory>
|
|
78 | 108 |
|
79 |
<xsl:if test="not(//*[local-name()='title'][string-length(.)> 0])"> |
|
80 |
<xsl:call-template name="terminate"/> |
|
81 |
</xsl:if> |
|
82 |
--> |
|
109 |
<oaf:dateAccepted> |
|
110 |
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"/> |
|
111 |
</oaf:dateAccepted> |
|
83 | 112 |
|
84 |
<xsl:if test="//*[local-name()='date']/@dateType='Available'"> |
|
85 |
<xsl:variable name='varEmbargoEndDate' |
|
86 |
select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='date'][@dateType='Available']), 'DateISO8601')"/> |
|
87 |
<xsl:choose> |
|
88 |
<xsl:when test="string-length($varEmbargoEndDate) > 0"> |
|
89 |
<oaf:embargoenddate> |
|
90 |
<xsl:value-of select="$varEmbargoEndDate"/> |
|
91 |
</oaf:embargoenddate> |
|
92 |
</xsl:when> |
|
93 |
<xsl:otherwise> |
|
94 |
<xsl:call-template name="terminate"/> |
|
95 |
</xsl:otherwise> |
|
96 |
</xsl:choose> |
|
97 |
</xsl:if> |
|
98 | 113 |
|
114 |
<!-- |
|
115 |
<xsl:if test="//*[local-name() = 'datasourceprefix'][.='r310e4cd113d'] and not(boolean(//*[local-name() = 'rights']/@rightsURI ) )]"> |
|
116 |
<xsl:call-template name="terminate"/> |
|
117 |
</xsl:if> |
|
118 |
--> |
|
99 | 119 |
|
100 |
<oaf:dateAccepted> |
|
101 |
<xsl:value-of select="TransformationFunction:convertString($tf, normalize-space(//*[local-name()='publicationYear']), 'DateISO8601')"/> |
|
102 |
</oaf:dateAccepted> |
|
120 |
<!-- |
|
121 |
<xsl:choose> |
|
122 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')][1]"> |
|
123 |
<oaf:accessrights> |
|
124 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')][1], 'AccessRights')"/> |
|
125 |
</oaf:accessrights> |
|
126 |
</xsl:when> |
|
127 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
128 |
<oaf:accessrights> |
|
129 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
130 |
</oaf:accessrights> |
|
131 |
</xsl:when> |
|
132 |
<xsl:otherwise> |
|
133 |
<xsl:choose> |
|
134 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'Creative Commons')]"> |
|
135 |
<oaf:accessrights> |
|
136 |
<xsl:text>OPEN</xsl:text> |
|
137 |
</oaf:accessrights> |
|
138 |
</xsl:when> |
|
139 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'http://opendatacommons.org')]"> |
|
140 |
<oaf:accessrights> |
|
141 |
<xsl:text>OPEN</xsl:text> |
|
142 |
</oaf:accessrights> |
|
143 |
</xsl:when> |
|
144 |
<xsl:otherwise> |
|
145 |
<oaf:accessrights> |
|
146 |
<xsl:text>UNKNOWN</xsl:text> |
|
147 |
</oaf:accessrights> |
|
148 |
</xsl:otherwise> |
|
149 |
</xsl:choose> |
|
150 |
</xsl:otherwise> |
|
151 |
</xsl:choose> |
|
152 |
--> |
|
103 | 153 |
|
104 |
<!-- |
|
105 |
<xsl:if test="//*[local-name() = 'datasourceprefix'][.='r310e4cd113d'] and not(boolean(//*[local-name() = 'rights']/@rightsURI ) )]"> |
|
106 |
<xsl:call-template name="terminate"/> |
|
107 |
</xsl:if> |
|
108 |
--> |
|
154 |
<!-- avoiding to check access rights 'synonyms' which are listed in dnet:access_modes --> |
|
155 |
<oaf:accessrights> |
|
156 |
<xsl:choose> |
|
157 |
<xsl:when test="//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('OPEN', 'OPEN SOURCE')]"> |
|
158 |
<xsl:value-of select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('OPEN', 'OPEN SOURCE')],1,1), 'AccessRights')"/> |
|
159 |
</xsl:when> |
|
160 |
<xsl:when test="//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('EMBARGO', '6MONTHS', '12MONTHS')]"> |
|
161 |
<xsl:value-of select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('EMBARGO', '6MONTHS', '12MONTHS')],1,1), 'AccessRights')"/> |
|
162 |
</xsl:when> |
|
163 |
<xsl:when test="//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('RESTRICTED')]"> |
|
164 |
<xsl:value-of select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('RESTRICTED')],1,1), 'AccessRights')"/> |
|
165 |
</xsl:when> |
|
166 |
<xsl:when test="//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('CLOSED', 'OTHER')]"> |
|
167 |
<xsl:value-of select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI)[TransformationFunction:convertString($tf, ., 'AccessRights') = ('CLOSED', 'OTHER')],1,1), 'AccessRights')"/> |
|
168 |
</xsl:when> |
|
169 |
<xsl:otherwise> |
|
170 |
<xsl:value-of select="TransformationFunction:convertString($tf, subsequence(//*[local-name() = 'rights']/(., @rightsURI),1,1), 'AccessRights')"/> |
|
171 |
</xsl:otherwise> |
|
172 |
</xsl:choose> |
|
173 |
</oaf:accessrights> |
|
109 | 174 |
|
110 |
<xsl:choose> |
|
111 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')][1]"> |
|
112 |
<oaf:accessrights> |
|
113 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics')][1], 'AccessRights')"/> |
|
114 |
</oaf:accessrights> |
|
115 |
</xsl:when> |
|
116 |
<!-- <xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')]"> |
|
117 |
<oaf:accessrights> |
|
118 |
<xsl:value-of select="TransformationFunction:convertString($tf, //*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'info:eu-repo/semantics')], 'AccessRights')"/> |
|
119 |
</oaf:accessrights> |
|
120 |
</xsl:when> |
|
121 |
--> |
|
122 |
<xsl:otherwise> |
|
123 |
<xsl:choose> |
|
124 |
<xsl:when test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'Creative Commons')]"> |
|
125 |
<oaf:accessrights> |
|
126 |
<xsl:text>OPEN</xsl:text> |
|
127 |
</oaf:accessrights> |
|
128 |
</xsl:when> |
|
129 |
<xsl:when test="//*[local-name() = 'rights']/@rightsURI[starts-with(normalize-space(.), 'http://creativecommons.org') or starts-with(normalize-space(.), 'http://opendatacommons.org')]"> |
|
130 |
<oaf:accessrights> |
|
131 |
<xsl:text>OPEN</xsl:text> |
|
132 |
</oaf:accessrights> |
|
133 |
</xsl:when> |
|
134 |
<xsl:otherwise> |
|
135 |
<oaf:accessrights> |
|
136 |
<xsl:text>UNKNOWN</xsl:text> |
|
137 |
</oaf:accessrights> |
|
138 |
</xsl:otherwise> |
|
139 |
</xsl:choose> |
|
140 |
</xsl:otherwise> |
|
141 |
</xsl:choose> |
|
175 |
<xsl:for-each select="//*[local-name()='rights']/@rightsURI[starts-with(normalize-space(.), 'http') and matches(., '.*(/licenses|/publicdomain|unlicense.org/|/legal-and-data-protection-notices|/download/license|/open-government-licence).*')]"> |
|
176 |
<oaf:license> |
|
177 |
<xsl:copy-of select="normalize-space(.)"/> |
|
178 |
</oaf:license> |
|
179 |
</xsl:for-each> |
|
142 | 180 |
|
143 |
<oaf:language>
|
|
144 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" />
|
|
145 |
</oaf:language>
|
|
181 |
<oaf:language>
|
|
182 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')"/>
|
|
183 |
</oaf:language>
|
|
146 | 184 |
|
147 |
<!-- |
|
148 |
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
|
|
149 |
<oaf:embargoenddate>
|
|
150 |
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
|
|
151 |
</oaf:embargoenddate>
|
|
152 |
</xsl:if>
|
|
153 |
--> |
|
185 |
<!--
|
|
186 |
<xsl:if test="//*[local-name() = 'rights'][starts-with(normalize-space(.), 'info:eu-repo/semantics/embargoedAccess')]">
|
|
187 |
<oaf:embargoenddate>
|
|
188 |
<xsl:value-of select="//*[local-name()='date']/@dateType='Available'"/>
|
|
189 |
</oaf:embargoenddate>
|
|
190 |
</xsl:if>
|
|
191 |
-->
|
|
154 | 192 |
|
155 |
<xsl:for-each select="//*[local-name()='nameIdentifier']">
|
|
156 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
|
|
157 |
<oaf:projectid>
|
|
158 |
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
|
159 |
</oaf:projectid>
|
|
160 |
</xsl:if>
|
|
161 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
|
|
162 |
<oaf:projectid>
|
|
163 |
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
|
164 |
</oaf:projectid>
|
|
165 |
</xsl:if>
|
|
166 |
</xsl:for-each>
|
|
193 |
<xsl:for-each select="//*[local-name()='nameIdentifier']">
|
|
194 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', 'i')">
|
|
195 |
<oaf:projectid>
|
|
196 |
<xsl:value-of select="concat($varFP7, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/fp7/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
|
197 |
</oaf:projectid>
|
|
198 |
</xsl:if>
|
|
199 |
<xsl:if test="matches(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', 'i')">
|
|
200 |
<oaf:projectid>
|
|
201 |
<xsl:value-of select="concat($varH2020, replace(normalize-space(.), '(info:eu-repo/grantagreement/ec/h2020/)(\d\d\d\d\d\d)(.*)', '$2', 'i'))"/>
|
|
202 |
</oaf:projectid>
|
|
203 |
</xsl:if>
|
|
204 |
</xsl:for-each>
|
|
167 | 205 |
|
168 |
<oaf:hostedBy> |
|
169 |
<xsl:attribute name="name"> |
|
170 |
<xsl:value-of select="$varHostedByOfficialName"/> |
|
171 |
</xsl:attribute> |
|
172 |
<xsl:attribute name="id"> |
|
173 |
<xsl:value-of select="$varHostedByDataSourceId"/> |
|
174 |
</xsl:attribute> |
|
175 |
</oaf:hostedBy> |
|
176 |
<oaf:collectedFrom> |
|
177 |
<xsl:attribute name="name"> |
|
178 |
<xsl:value-of select="$varOfficialName"/> |
|
179 |
</xsl:attribute> |
|
180 |
<xsl:attribute name="id"> |
|
181 |
<xsl:value-of select="$varDataSourceId"/> |
|
182 |
</xsl:attribute> |
|
183 |
</oaf:collectedFrom> |
|
184 |
</metadata> |
|
185 |
<xsl:copy-of select="//*[local-name() = 'about']" /> |
|
186 |
</record> |
|
187 |
</xsl:template> |
|
206 |
<oaf:hostedBy> |
|
207 |
<xsl:attribute name="name"> |
|
208 |
<xsl:value-of select="$varHostedByOfficialName"/> |
|
209 |
</xsl:attribute> |
|
210 |
<xsl:attribute name="id"> |
|
211 |
<xsl:value-of select="$varHostedByDataSourceId"/> |
|
212 |
</xsl:attribute> |
|
213 |
</oaf:hostedBy> |
|
214 |
<oaf:collectedFrom> |
|
215 |
<xsl:attribute name="name"> |
|
216 |
<xsl:value-of select="$varOfficialName"/> |
|
217 |
</xsl:attribute> |
|
218 |
<xsl:attribute name="id"> |
|
219 |
<xsl:value-of select="$varDataSourceId"/> |
|
220 |
</xsl:attribute> |
|
221 |
</oaf:collectedFrom> |
|
188 | 222 |
|
189 |
<xsl:template match="node()|@*"> |
|
190 |
<xsl:copy> |
|
191 |
<xsl:apply-templates select="node()|@*"/> |
|
192 |
</xsl:copy> |
|
193 |
</xsl:template> |
|
223 |
<!-- with the re-change of the CAP, those filters can be turned off --> |
|
224 |
<!-- |
|
225 |
<xsl:call-template name="cap" /> |
|
226 |
--> |
|
194 | 227 |
|
195 |
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']"> |
|
196 |
<xsl:copy> |
|
197 |
<xsl:apply-templates select="node()|@*"/> |
|
198 |
</xsl:copy> |
|
199 |
</xsl:template> |
|
228 |
</metadata> |
|
229 |
<xsl:copy-of select="//*[local-name() = 'about']"/> |
|
230 |
</record> |
|
231 |
</xsl:template> |
|
200 | 232 |
|
201 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']"> |
|
202 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
233 |
<xsl:template match="node()|@*"> |
|
234 |
<xsl:copy> |
|
235 |
<xsl:apply-templates select="node()|@*"/> |
|
236 |
</xsl:copy> |
|
237 |
</xsl:template> |
|
203 | 238 |
|
204 |
<xsl:copy-of select="./*"/> |
|
239 |
<xsl:template match="//*[local-name() = 'metadata']//*[local-name() = 'resource']"> |
|
240 |
<xsl:copy> |
|
241 |
<xsl:apply-templates select="node()|@*"/> |
|
242 |
</xsl:copy> |
|
243 |
</xsl:template> |
|
205 | 244 |
|
206 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']"> |
|
207 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
208 |
<xsl:attribute name="alternateIdentifierType"> |
|
209 |
<xsl:value-of select="'URL'"/> |
|
210 |
</xsl:attribute> |
|
211 |
<xsl:value-of |
|
212 |
select="concat('http://hdl.handle.net/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
213 |
</xsl:element> |
|
214 |
</xsl:if> |
|
245 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers']"> |
|
246 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
215 | 247 |
|
216 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']"> |
|
217 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
218 |
<xsl:attribute name="alternateIdentifierType"> |
|
219 |
<xsl:value-of select="'URL'"/> |
|
220 |
</xsl:attribute> |
|
221 |
<xsl:value-of |
|
222 |
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" /> |
|
223 |
</xsl:element> |
|
224 |
</xsl:if> |
|
248 |
<xsl:copy-of select="./*"/> |
|
225 | 249 |
|
226 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']">
|
|
227 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
228 |
<xsl:attribute name="alternateIdentifierType">
|
|
229 |
<xsl:value-of select="'URL'"/>
|
|
230 |
</xsl:attribute>
|
|
231 |
<xsl:value-of
|
|
232 |
select="concat('http://dx.doi.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])" />
|
|
233 |
</xsl:element>
|
|
234 |
</xsl:if>
|
|
250 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='Handle']">
|
|
251 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/">
|
|
252 |
<xsl:attribute name="alternateIdentifierType">
|
|
253 |
<xsl:value-of select="'URL'"/>
|
|
254 |
</xsl:attribute>
|
|
255 |
<xsl:value-of
|
|
256 |
select="concat('http://hdl.handle.net/', //*[local-name() = 'resource']/*[local-name()='identifier'])"/>
|
|
257 |
</xsl:element>
|
|
258 |
</xsl:if>
|
|
235 | 259 |
|
236 |
</xsl:element> |
|
260 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='URN']"> |
|
261 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
262 |
<xsl:attribute name="alternateIdentifierType"> |
|
263 |
<xsl:value-of select="'URL'"/> |
|
264 |
</xsl:attribute> |
|
265 |
<xsl:value-of |
|
266 |
select="concat('http://nbn-resolving.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])"/> |
|
267 |
</xsl:element> |
|
268 |
</xsl:if> |
|
237 | 269 |
|
238 |
</xsl:template> |
|
270 |
<xsl:if test="//*[local-name() = 'resource']/*[local-name()='identifier'][@identifierType='DOI']"> |
|
271 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
272 |
<xsl:attribute name="alternateIdentifierType"> |
|
273 |
<xsl:value-of select="'URL'"/> |
|
274 |
</xsl:attribute> |
|
275 |
<xsl:value-of |
|
276 |
select="concat('http://dx.doi.org/', //*[local-name() = 'resource']/*[local-name()='identifier'])"/> |
|
277 |
</xsl:element> |
|
278 |
</xsl:if> |
|
239 | 279 |
|
240 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']"> |
|
241 |
<xsl:copy-of select="."/> |
|
242 |
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])"> |
|
243 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
244 |
<xsl:if test=".[@identifierType='Handle']"> |
|
245 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
246 |
<xsl:attribute name="alternateIdentifierType"> |
|
247 |
<xsl:value-of select="'URL'"/> |
|
248 |
</xsl:attribute> |
|
249 |
<xsl:value-of |
|
250 |
select="concat('http://hdl.handle.net/', .)" /> |
|
251 |
</xsl:element> |
|
252 |
</xsl:if> |
|
253 |
<xsl:if test=".[@identifierType='URN']"> |
|
254 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
255 |
<xsl:attribute name="alternateIdentifierType"> |
|
256 |
<xsl:value-of select="'URL'"/> |
|
257 |
</xsl:attribute> |
|
258 |
<xsl:value-of |
|
259 |
select="concat('http://nbn-resolving.org/', .)" /> |
|
260 |
</xsl:element> |
|
261 |
</xsl:if> |
|
262 |
<xsl:if test=".[@identifierType='DOI']"> |
|
263 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
264 |
<xsl:attribute name="alternateIdentifierType"> |
|
265 |
<xsl:value-of select="'URL'"/> |
|
266 |
</xsl:attribute> |
|
267 |
<xsl:value-of |
|
268 |
select="concat('http://dx.doi.org/', .)" /> |
|
269 |
</xsl:element> |
|
270 |
</xsl:if> |
|
280 |
</xsl:element> |
|
271 | 281 |
|
272 |
</xsl:element> |
|
273 |
</xsl:if> |
|
282 |
</xsl:template> |
|
274 | 283 |
|
284 |
<xsl:template match="//*[local-name() = 'resource']/*[local-name()='identifier']"> |
|
285 |
<xsl:copy-of select="."/> |
|
286 |
<xsl:if test="not(//*[local-name() = 'resource']/*[local-name()='alternateIdentifiers'])"> |
|
287 |
<xsl:element name="alternateIdentifiers" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
288 |
<xsl:if test=".[@identifierType='Handle']"> |
|
289 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
290 |
<xsl:attribute name="alternateIdentifierType"> |
|
291 |
<xsl:value-of select="'URL'"/> |
|
292 |
</xsl:attribute> |
|
293 |
<xsl:value-of |
|
294 |
select="concat('http://hdl.handle.net/', .)"/> |
|
295 |
</xsl:element> |
|
296 |
</xsl:if> |
|
297 |
<xsl:if test=".[@identifierType='URN']"> |
|
298 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
299 |
<xsl:attribute name="alternateIdentifierType"> |
|
300 |
<xsl:value-of select="'URL'"/> |
|
301 |
</xsl:attribute> |
|
302 |
<xsl:value-of |
|
303 |
select="concat('http://nbn-resolving.org/', .)"/> |
|
304 |
</xsl:element> |
|
305 |
</xsl:if> |
|
306 |
<xsl:if test=".[@identifierType='DOI']"> |
|
307 |
<xsl:element name="alternateIdentifier" namespace="http://www.openarchives.org/OAI/2.0/"> |
|
308 |
<xsl:attribute name="alternateIdentifierType"> |
|
309 |
<xsl:value-of select="'URL'"/> |
|
310 |
</xsl:attribute> |
|
311 |
<xsl:value-of |
|
312 |
select="concat('http://dx.doi.org/', .)"/> |
|
313 |
</xsl:element> |
|
314 |
</xsl:if> |
|
275 | 315 |
|
276 |
</xsl:template> |
|
316 |
</xsl:element> |
|
317 |
</xsl:if> |
|
277 | 318 |
|
278 |
<xsl:template match="//*[local-name() = 'header']"> |
|
279 |
<xsl:copy> |
|
280 |
<xsl:apply-templates select="node()|@*"/> |
|
281 |
<xsl:element name="dr:dateOfTransformation"> |
|
282 |
<xsl:value-of select="$transDate"/> |
|
283 |
</xsl:element> |
|
284 |
</xsl:copy> |
|
285 |
</xsl:template> |
|
319 |
</xsl:template> |
|
286 | 320 |
|
287 |
</xsl:stylesheet> |
|
288 |
]]></CODE> |
|
289 |
</SCRIPT> |
|
290 |
</CONFIGURATION> |
|
291 |
<STATUS/> |
|
292 |
<SECURITY_PARAMETERS/> |
|
293 |
</BODY> |
|
294 |
</RESOURCE_PROFILE> |
|
321 |
<!-- |
|
322 |
<xsl:template match="//*[local-name()='language']"> |
|
323 |
<oaf:language> |
|
324 |
<xsl:value-of select="TransformationFunction:convert($tf, //*[local-name()='language'], 'Languages')" /> |
|
325 |
</oaf:language> |
|
326 |
</xsl:template> |
|
327 |
--> |
|
295 | 328 |
|
329 |
<!-- with the re-change of the CAP, those filters can be turned off --> |
|
330 |
<!-- drop record if content acquisition policy is not met --> |
|
331 |
<!-- |
|
332 |
<xsl:template name="cap"> |
|
333 |
<xsl:if test="not($varSuperType = 'publication' or ($varCap1AccRhts or $varCap2LinkPub or $varCap3Project or $varCap4Comnty))"> |
|
334 |
<xsl:call-template name="terminate"/> |
|
335 |
</xsl:if> |
|
336 |
</xsl:template> |
|
337 |
--> |
|
338 |
|
|
339 |
</xsl:stylesheet> |
|
340 |
</CODE> |
|
341 |
</SCRIPT> |
|
342 |
</CONFIGURATION> |
|
343 |
<STATUS/> |
|
344 |
<SECURITY_PARAMETERS/> |
|
345 |
</BODY> |
|
346 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
Rule for datacite and the new cap copied from beta