Revision 54061
Added by Aenne Loehden almost 6 years ago
modules/dnet-openaireplus-profiles/trunk/src/main/resources/eu/dnetlib/test/profiles/TransformationRuleDSResources/TransformationRuleDSResourceType/crossref2oaf.xml | ||
---|---|---|
1 |
<RESOURCE_PROFILE> |
|
2 |
<HEADER> |
|
3 |
<RESOURCE_IDENTIFIER value="2bc17dbe-93a9-4a4d-bd61-9831f1efdd0c_VHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZXMvVHJhbnNmb3JtYXRpb25SdWxlRFNSZXNvdXJjZVR5cGU="/> |
|
4 |
<RESOURCE_TYPE value="TransformationRuleDSResourceType"/> |
|
5 |
<RESOURCE_KIND value="TransformationRuleDSResources"/> |
|
6 |
<RESOURCE_URI value=""/> |
|
7 |
<DATE_OF_CREATION value="2018-11-22T16:58:58+00:00"/> |
|
8 |
</HEADER> |
|
9 |
<BODY> |
|
10 |
<CONFIGURATION> |
|
11 |
<IMPORTED/> |
|
12 |
<SCRIPT> |
|
13 |
<TITLE>crossref2oaf</TITLE> |
|
14 |
<CODE><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
|
15 |
xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:dc="http://purl.org/dc/elements/1.1/" |
|
16 |
xmlns:dr="http://www.driver-repository.eu/namespace/dr" |
|
17 |
xmlns:dri="http://www.driver-repository.eu/namespace/dri" |
|
18 |
xmlns:oaf="http://namespace.openaire.eu/oaf" xmlns:date="http://exslt.org/dates-and-times" |
|
19 |
xmlns:TransformationFunction="eu.dnetlib.data.collective.transformation.core.xsl.ext.TransformationFunctionProxy" |
|
20 |
extension-element-prefixes="date TransformationFunction" |
|
21 |
exclude-result-prefixes="xs TransformationFunction" version="2.0"> |
|
22 |
|
|
23 |
<xsl:output omit-xml-declaration="yes" indent="yes"/> |
|
24 |
<xsl:param name="varOfficialName"/> |
|
25 |
<xsl:param name="varDataSourceId"/> |
|
26 |
<xsl:variable name="tf" select="TransformationFunction:getInstance()"/> |
|
27 |
|
|
28 |
<xsl:template name="terminate"> |
|
29 |
<xsl:message terminate="yes"> |
|
30 |
record is not compliant, transformation is interrupted. |
|
31 |
</xsl:message> |
|
32 |
</xsl:template> |
|
33 |
|
|
34 |
<xsl:template match="/"> |
|
35 |
<xsl:if test="not(.//error)"> |
|
36 |
<record> |
|
37 |
<header> |
|
38 |
<xsl:copy-of select="//*[local-name() = 'header']/*" copy-namespaces="no"/> |
|
39 |
<dr:dateOfTransformation> |
|
40 |
<xsl:value-of select="date:date-time()"/> |
|
41 |
</dr:dateOfTransformation> |
|
42 |
</header> |
|
43 |
<metadata> |
|
44 |
|
|
45 |
<!-- dropping records without titles --> |
|
46 |
<!-- |
|
47 |
<xsl:if test="not(//(journal_article, conference_paper, book/content_item, posted_content, report-paper/report-paper_metadata, dissertation, database/dataset, sa_component/component_list/component)/titles/title[string-length(normalize-space(.))> 0]) and not(//*[local-name()='conference_paper']/*[local-name()='titles']/*[local-name()='title'][string-length(normalize-space(.))> 0])"> |
|
48 |
--> |
|
49 |
<xsl:if test="not(//(journal_article, conference_paper, book/content_item, book[not(./content_item)]/book_series_metadata/series_metadata, book[not(./content_item)]/book_metadata, posted_content, report-paper/report-paper_metadata, dissertation, database/dataset, sa_component/component_list/component)/titles/title[string-length(normalize-space(.))> 0])"> |
|
50 |
<xsl:call-template name="terminate"/> |
|
51 |
</xsl:if> |
|
52 |
|
|
53 |
<!-- ToDo: find items without cobjcategory --> |
|
54 |
|
|
55 |
<dc:language>eng</dc:language> |
|
56 |
<xsl:call-template name="accessrights"/> |
|
57 |
<oaf:hostedBy id="openaire____::1256f046-bf1f-4afc-8b47-d0b147148b18" |
|
58 |
name="Unknown Repository"/> |
|
59 |
<oaf:collectedFrom> |
|
60 |
<xsl:attribute name="name"> |
|
61 |
<xsl:value-of select="$varOfficialName"/> |
|
62 |
</xsl:attribute> |
|
63 |
<xsl:attribute name="id"> |
|
64 |
<xsl:value-of select="$varDataSourceId"/> |
|
65 |
</xsl:attribute> |
|
66 |
</oaf:collectedFrom> |
|
67 |
|
|
68 |
<xsl:apply-templates select=".//*"/> |
|
69 |
</metadata> |
|
70 |
<xsl:copy-of select="//*[local-name() = 'about']/*" copy-namespaces="no"/> |
|
71 |
</record> |
|
72 |
</xsl:if> |
|
73 |
|
|
74 |
</xsl:template> |
|
75 |
|
|
76 |
<!-- |
|
77 |
<xsl:template match="dc:relation"> |
|
78 |
<xsl:variable name="projectId" |
|
79 |
select="substring-after(., 'info:eu-repo/grantAgreement/EC/H2020/')"/> |
|
80 |
<oaf:projectid> |
|
81 |
<xsl:value-of select="concat('corda__h2020::', $projectId)"/> |
|
82 |
</oaf:projectid> |
|
83 |
</xsl:template> |
|
84 |
--> |
|
85 |
|
|
86 |
<!-- funding --> |
|
87 |
<xsl:template match="*[local-name()='relation'][starts-with(., 'info:eu-repo/grantAgreement/')] | assertion[./@name='fundgroup']"> |
|
88 |
|
|
89 |
<xsl:variable name="varFP7" select="'corda_______::'"/> |
|
90 |
<xsl:variable name="varH2020" select="'corda__h2020::'"/> |
|
91 |
<xsl:variable name="varAKA" select="'aka_________::'"/> <!-- tbd, no statements yet --> |
|
92 |
<xsl:variable name="varAFF" select="'aff_________::'"/> |
|
93 |
<xsl:variable name="varARC" select="'arc_________::'"/> |
|
94 |
<xsl:variable name="varCONICYT" select="'conicytf____::'"/> |
|
95 |
<xsl:variable name="varDFG" select="'dfgf________::'"/> |
|
96 |
<xsl:variable name="varFCT" select="'fct_________::'"/> |
|
97 |
<xsl:variable name="varFWF" select="'fwf_________::'"/> |
|
98 |
<xsl:variable name="varHRZZ" select="'irb_hr______::'"/> |
|
99 |
<xsl:variable name="varMESTD" select="'mestd_______::'"/> |
|
100 |
<xsl:variable name="varMIUR" select="'miur________::'"/> <!-- tbd, no statements yet --> |
|
101 |
<xsl:variable name="varMZOS" select="'irb_hr______::'"/> |
|
102 |
<xsl:variable name="varNHMRC" select="'nhmrc_______::'"/> |
|
103 |
<xsl:variable name="varNIH" select="'nih_________::'"/> |
|
104 |
<xsl:variable name="varNSF" select="'nsf_________::'"/> |
|
105 |
<xsl:variable name="varNWO" select="'nwo_________::'"/> |
|
106 |
<xsl:variable name="varRCUK" select="'rcuk________::'"/> |
|
107 |
<xsl:variable name="varSFI" select="'sfi_________::'"/> |
|
108 |
<xsl:variable name="varSGOV" select="'sgov________::'"/> |
|
109 |
<xsl:variable name="varSNSF" select="'snsf________::'"/> |
|
110 |
<xsl:variable name="varTARA" select="'taraexp_____::'"/> |
|
111 |
<xsl:variable name="varTUBITAK" select="'tubitakf____::'"/> |
|
112 |
<xsl:variable name="varWT" select="'wt__________::'"/> |
|
113 |
|
|
114 |
<!-- EU H2020 --> |
|
115 |
<xsl:for-each select=".[local-name()='relation'][starts-with(., 'info:eu-repo/grantAgreement/EC/H2020')]"> |
|
116 |
<xsl:variable name="projectId" select="substring-after(., 'info:eu-repo/grantAgreement/EC/H2020/')"/> |
|
117 |
<oaf:projectid> <xsl:value-of select="concat($varH2020, $projectId)"/> </oaf:projectid> |
|
118 |
</xsl:for-each> |
|
119 |
|
|
120 |
<!-- EU FP7 --> |
|
121 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/100011102')] or ./assertion[./@name='funder_name' and (contains(., 'Seventh Framework Program') or contains(., 'FP7'))]]/assertion[./@name='award_number']"> |
|
122 |
<xsl:variable name="projectId" select="."/> |
|
123 |
<oaf:projectid> <xsl:value-of select="concat($varFP7, $projectId)"/> </oaf:projectid> |
|
124 |
</xsl:for-each> |
|
125 |
|
|
126 |
<!-- AFF --> |
|
127 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100002341')] or ./assertion[./@name='funder_name' and (contains(., 'Suomen Akatemia') or contains(., 'Academy of Finland'))]]/assertion[./@name='award_number']"> |
|
128 |
<xsl:variable name="projectId" select="."/> |
|
129 |
<oaf:projectid> <xsl:value-of select="concat($varAFF, $projectId)"/> </oaf:projectid> |
|
130 |
</xsl:for-each> |
|
131 |
|
|
132 |
<!-- ARC --> |
|
133 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100000923')] or ./assertion[./@name='funder_name' and contains(., 'Australian Research Council')]]/assertion[./@name='award_number']"> |
|
134 |
<xsl:variable name="projectId" select="."/> |
|
135 |
<oaf:projectid> <xsl:value-of select="concat($varARC, $projectId)"/> </oaf:projectid> |
|
136 |
</xsl:for-each> |
|
137 |
|
|
138 |
<!-- CONICYT --> |
|
139 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100002848')] or ./assertion[./@name='funder_name' and (contains(., 'Comisión Nacional de Investigación Científica y Tecnológica') or contains(., 'CONICYT'))]]/assertion[./@name='award_number']"> |
|
140 |
<xsl:variable name="projectId" select="."/> |
|
141 |
<oaf:projectid> <xsl:value-of select="concat($varCONICYT, $projectId)"/> </oaf:projectid> |
|
142 |
</xsl:for-each> |
|
143 |
|
|
144 |
<!-- DFG --> |
|
145 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100001659')] or ./assertion[./@name='funder_name' and (contains(., 'Deutsche Forschungsgemeinschaft') or contains(., 'DFG'))]]/assertion[./@name='award_number']"> |
|
146 |
<xsl:variable name="projectId" select="."/> |
|
147 |
<oaf:projectid> <xsl:value-of select="concat($varDFG, $projectId)"/> </oaf:projectid> |
|
148 |
</xsl:for-each> |
|
149 |
|
|
150 |
<!-- RCUK --> |
|
151 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100000690')] or ./assertion[./@name='funder_name' and (contains(., 'Research Councils UK') or contains(., 'RCUK'))]]/assertion[./@name='award_number']"> |
|
152 |
<xsl:variable name="projectId" select="."/> |
|
153 |
<oaf:projectid> <xsl:value-of select="concat($varRCUK, $projectId)"/> </oaf:projectid> |
|
154 |
</xsl:for-each> |
|
155 |
|
|
156 |
<!-- SGOV --> |
|
157 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][./assertion[./@name='funder_name' and (contains(., 'Gobierno de Espana') or contains(., 'Ministry of Economy and Competitiveness') or contains(., 'Ministerio de Economía y Competitividad'))]]/assertion[./@name='award_number']"> |
|
158 |
<xsl:variable name="projectId" select="."/> |
|
159 |
<oaf:projectid> <xsl:value-of select="concat($varSGOV, $projectId)"/> </oaf:projectid> |
|
160 |
</xsl:for-each> |
|
161 |
|
|
162 |
<!-- SNSF --> |
|
163 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100001711')] or ./assertion[./@name='funder_name' and (contains(., 'Swiss National Science Foundation') or contains(., 'Schweizerischer Nationalfonds zur Förderung der Wissenschaftlichen Forschung'))]]/assertion[./@name='award_number']"> |
|
164 |
<xsl:variable name="projectId" select="."/> |
|
165 |
<oaf:projectid> <xsl:value-of select="concat($varSNSF, $projectId)"/> </oaf:projectid> |
|
166 |
</xsl:for-each> |
|
167 |
|
|
168 |
<!-- TUBITAK --> |
|
169 |
<xsl:for-each select=".[local-name()='assertion' and ./@name='fundgroup'][.//assertion[./@name='funder_identifier' and ends-with(., '10.13039/501100004410')] or ./assertion[./@name='funder_name' and (contains(., 'Turkish National Science and Research Council') or (contains(., 'Türkiye Bilimsel ve Teknolojik Ara') and contains(., 'rma Kurumu')))]]/assertion[./@name='award_number']"> |
|
170 |
<xsl:variable name="projectId" select="."/> |
|
171 |
<oaf:projectid> <xsl:value-of select="concat($varTUBITAK, $projectId)"/> </oaf:projectid> |
|
172 |
</xsl:for-each> |
|
173 |
|
|
174 |
</xsl:template> |
|
175 |
|
|
176 |
<xsl:template match=" |
|
177 |
journal_article/titles/title | |
|
178 |
conference_paper/titles/title | |
|
179 |
book/content_item/titles/title | |
|
180 |
posted_content/titles/title | |
|
181 |
report-paper/report-paper_metadata/titles/title | |
|
182 |
dissertation/titles/title | |
|
183 |
database/dataset/titles/title | |
|
184 |
sa_component/component_list/component/titles/title"> |
|
185 |
|
|
186 |
<dc:title> |
|
187 |
<xsl:value-of select="normalize-space(.)"/> |
|
188 |
</dc:title> |
|
189 |
<xsl:if test="../subtitle[string-length(.) > 0]"> |
|
190 |
<dc:title> |
|
191 |
<xsl:value-of select="normalize-space(../subtitle)"/> |
|
192 |
</dc:title> |
|
193 |
</xsl:if> |
|
194 |
<!-- TODO: handle subtititles if needed --> |
|
195 |
</xsl:template> |
|
196 |
|
|
197 |
<xsl:template match="book/book_series_metadata"> |
|
198 |
<xsl:if test="not(../content_item)"> |
|
199 |
<dc:title> |
|
200 |
<xsl:value-of select="concat(normalize-space(./series_metadata/*/title),' ' , normalize-space(./titles/title))"/> |
|
201 |
</dc:title> |
|
202 |
<xsl:if test="./titles/subtitle[string-length(.) > 0]"> |
|
203 |
<dc:title> |
|
204 |
<xsl:value-of select="normalize-space(./titles/subtitle[string-length(.) > 0])"/> |
|
205 |
</dc:title> |
|
206 |
</xsl:if> |
|
207 |
<xsl:variable name="varType" select="string('info:eu-repo/semantics/book')"/> |
|
208 |
<dc:type> |
|
209 |
<xsl:value-of select="$varType"/> |
|
210 |
</dc:type> |
|
211 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
212 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
213 |
<dr:CobjCategory> |
|
214 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
215 |
<xsl:value-of select="$varCobjCategory" /> |
|
216 |
</dr:CobjCategory> |
|
217 |
<dc:date> |
|
218 |
<xsl:variable name="d"> |
|
219 |
<xsl:value-of select="string-join((./publication_date/year, ./publication_date/month, ./publication_date/day), '-')"/> |
|
220 |
</xsl:variable> |
|
221 |
<xsl:value-of select="$d"/> |
|
222 |
</dc:date> |
|
223 |
</xsl:if> |
|
224 |
<xsl:if test=".//publisher"> |
|
225 |
<dc:publisher> |
|
226 |
<xsl:value-of select="./publisher/publisher_name"/> |
|
227 |
</dc:publisher> |
|
228 |
</xsl:if> |
|
229 |
</xsl:template> |
|
230 |
|
|
231 |
<xsl:template match="journal_article/contributors/person_name[./@contributor_role = 'author'] | |
|
232 |
conference_paper/contributors/person_name[./@contributor_role = 'author'] | |
|
233 |
content_item/contributors/person_name[./@contributor_role = 'author'] | |
|
234 |
posted_content/contributors/person_name[./@contributor_role = 'author']"> |
|
235 |
<dc:creator> |
|
236 |
<xsl:if test="string-length(./ORCID)"> |
|
237 |
<xsl:attribute name="nameIdentifierScheme">ORCID</xsl:attribute> |
|
238 |
<xsl:attribute name="schemeURI">http://orcid.org/</xsl:attribute> |
|
239 |
<xsl:attribute name="nameIdentifier"> |
|
240 |
<xsl:value-of select="substring-after(./ORCID, 'http://orcid.org/')"/> |
|
241 |
</xsl:attribute> |
|
242 |
</xsl:if> |
|
243 |
<xsl:value-of select="concat(./surname, ', ', ./given_name)"/> |
|
244 |
</dc:creator> |
|
245 |
</xsl:template> |
|
246 |
|
|
247 |
<xsl:template match=" |
|
248 |
journal_article/publication_date | |
|
249 |
conference_paper/publication_date | |
|
250 |
content_item/publication_date | |
|
251 |
dissertation/approval_date | |
|
252 |
report-paper_metadata/publication_date"> |
|
253 |
<xsl:variable name="d"> |
|
254 |
<xsl:value-of select="string-join((./year, ./month, ./day), '-')"/> |
|
255 |
</xsl:variable> |
|
256 |
<xsl:variable name="dAcc"> |
|
257 |
<xsl:value-of select="string-join((./year, substring(substring(concat('0',normalize-space(./month),'1'),string-length(normalize-space(./month))),1,2), substring(substring(concat('0',normalize-space(./day),'1'),string-length(normalize-space(./day))),1,2)), '-')"/> |
|
258 |
</xsl:variable> |
|
259 |
|
|
260 |
<dc:date> |
|
261 |
<xsl:value-of select="$d"/> |
|
262 |
</dc:date> |
|
263 |
<!-- <oaf:dateAccepted> |
|
264 |
<xsl:value-of select="$d"/> |
|
265 |
</oaf:dateAccepted> --> |
|
266 |
<oaf:dateAccepted> |
|
267 |
<xsl:value-of select="$dAcc"/> |
|
268 |
</oaf:dateAccepted> |
|
269 |
|
|
270 |
</xsl:template> |
|
271 |
|
|
272 |
<xsl:template match="posted_content/posted_date | |
|
273 |
posted_content/acceptance_date"> |
|
274 |
<xsl:variable name="d"> |
|
275 |
<xsl:value-of select="string-join((./year, ./month, ./day), '-')"/> |
|
276 |
</xsl:variable> |
|
277 |
<dc:date> |
|
278 |
<xsl:value-of select="$d"/> |
|
279 |
</dc:date> |
|
280 |
<!-- <oaf:dateAccepted> |
|
281 |
<xsl:value-of select="$d"/> |
|
282 |
</oaf:dateAccepted> --> |
|
283 |
</xsl:template> |
|
284 |
<xsl:template match="dri:recordIdentifier"> |
|
285 |
<dc:identifier> |
|
286 |
<xsl:value-of select="concat('http://dx.doi.org/', .)"/> |
|
287 |
</dc:identifier> |
|
288 |
<oaf:identifier identifierType="doi"> |
|
289 |
<xsl:value-of select="."/> |
|
290 |
</oaf:identifier> |
|
291 |
</xsl:template> |
|
292 |
|
|
293 |
<xsl:template match="conference_paper"> |
|
294 |
<xsl:variable name="varType" select="string('info:eu-repo/semantics/conferenceObject')"/> |
|
295 |
<dc:type> |
|
296 |
<xsl:value-of select="$varType"/> |
|
297 |
</dc:type> |
|
298 |
<dc:type> |
|
299 |
<xsl:value-of select="string('conference paper')"/> |
|
300 |
</dc:type> |
|
301 |
<!-- conference_paper: only source --> |
|
302 |
<dc:source> |
|
303 |
<xsl:value-of select="normalize-space(../proceedings_metadata/proceedings_title)"/> |
|
304 |
</dc:source> |
|
305 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
306 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
307 |
<dr:CobjCategory> |
|
308 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
309 |
<xsl:value-of select="$varCobjCategory" /> |
|
310 |
</dr:CobjCategory> |
|
311 |
<!-- TODO: ISBN? Other proceedings info? --> |
|
312 |
</xsl:template> |
|
313 |
|
|
314 |
<xsl:template match="journal_article"> |
|
315 |
<xsl:variable name="varType" select="string('info:eu-repo/semantics/article')"/> |
|
316 |
<dc:type> |
|
317 |
<xsl:value-of select="$varType"/> |
|
318 |
</dc:type> |
|
319 |
<dc:type> |
|
320 |
<xsl:value-of select="string('journal article')"/> |
|
321 |
</dc:type> |
|
322 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
323 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
324 |
<dr:CobjCategory> |
|
325 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
326 |
<xsl:value-of select="$varCobjCategory" /> |
|
327 |
</dr:CobjCategory> |
|
328 |
<dc:source> |
|
329 |
<xsl:value-of select="normalize-space(../journal_metadata/full_title[0])"/> |
|
330 |
</dc:source> |
|
331 |
<oaf:journal eissn="{../journal_metadata/issn[@media_type='electronic']}" |
|
332 |
issn="{../journal_metadata/issn[@media_type='print' or not(@media_type)]}" |
|
333 |
iss="{../journal_issue/issue}" vol="{../journal_issue/journal_volume/volume}" |
|
334 |
sp="{./pages/first_page}" ep="{./pages/last_page}"> |
|
335 |
<xsl:value-of select="normalize-space(../journal_metadata/full_title[0])"/> |
|
336 |
</oaf:journal> |
|
337 |
</xsl:template> |
|
338 |
|
|
339 |
<xsl:template match="content_item"> |
|
340 |
<xsl:variable name="varType" select="./@component_type"/> |
|
341 |
<dc:type> |
|
342 |
<xsl:value-of select="string('info:eu-repo/semantics/bookPart')"/> |
|
343 |
</dc:type> |
|
344 |
<dc:type> |
|
345 |
<xsl:value-of select="$varType"/> |
|
346 |
</dc:type> |
|
347 |
<xsl:variable name='varCobjCategory' select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
348 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
349 |
<dr:CobjCategory> |
|
350 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
351 |
<xsl:value-of select="$varCobjCategory" /> |
|
352 |
</dr:CobjCategory> |
|
353 |
<dc:source> |
|
354 |
<xsl:value-of select="concat(normalize-space(../book_series_metadata/series_metadata/*/title),' - ' , normalize-space(../book_series_metadata/titles/title))"/> |
|
355 |
</dc:source> |
|
356 |
<dc:source> |
|
357 |
<xsl:value-of select="concat(string('eissn: '),normalize-space(../book_series_metadata/*/issn[@media_type='electronic']))"/> |
|
358 |
</dc:source> |
|
359 |
<dc:source> |
|
360 |
<xsl:value-of select="concat(string('issn: '),normalize-space(../book_series_metadata/*/issn[@media_type='print' or not(@media_type)]))"/> |
|
361 |
</dc:source> |
|
362 |
|
|
363 |
<xsl:for-each select="../book_series_metadata/isbn[@media_type='electronic']"> |
|
364 |
<dc:source> |
|
365 |
<xsl:value-of select="concat(string('eisbn: '),normalize-space(.))"/> |
|
366 |
</dc:source> |
|
367 |
</xsl:for-each> |
|
368 |
|
|
369 |
<dc:source> |
|
370 |
<xsl:value-of select="concat(string('isbn: '),normalize-space(../book_series_metadata/isbn[@media_type='print' or not(@media_type)]))"/> |
|
371 |
</dc:source> |
|
372 |
|
|
373 |
</xsl:template> |
|
374 |
|
|
375 |
<!-- |
|
376 |
<xsl:template match="book_series_metadata"> |
|
377 |
<xsl:if test="not(../content_item)"> |
|
378 |
<dc:type> |
|
379 |
<xsl:value-of select="string('info:eu-repo/semantics/book')"/> |
|
380 |
</dc:type> |
|
381 |
<dc:source> |
|
382 |
<xsl:value-of select="concat(normalize-space(../book_series_metadata/series_metadata/*/title),' - ' , normalize-space(../book_series_metadata/titles/title))"/> |
|
383 |
</dc:source> |
|
384 |
<dr:CobjCategory>0002</dr:CobjCategory> |
|
385 |
</xsl:if> |
|
386 |
</xsl:template> |
|
387 |
--> |
|
388 |
|
|
389 |
<xsl:template match="posted_content"> |
|
390 |
<!-- |
|
391 |
<xsl:variable name="type"> |
|
392 |
<xsl:value-of select="./@type"/> |
|
393 |
</xsl:variable> |
|
394 |
<xsl:choose> |
|
395 |
<xsl:when test="normalize-space($type) = 'preprint'"> |
|
396 |
<dc:type> |
|
397 |
<xsl:value-of select="string('info:eu-repo/semantics/preprint')"/> |
|
398 |
</dc:type> |
|
399 |
<dr:CobjCategory>0016</dr:CobjCategory> |
|
400 |
</xsl:when> |
|
401 |
<xsl:when test="normalize-space($type) = 'working_paper'"> |
|
402 |
<dc:type> |
|
403 |
<xsl:value-of select="string('info:eu-repo/semantics/workingPaper')"/> |
|
404 |
</dc:type> |
|
405 |
</xsl:when> |
|
406 |
<xsl:when test="normalize-space($type) = 'report'"> |
|
407 |
<dc:type> |
|
408 |
<xsl:value-of select="string('info:eu-repo/semantics/report')"/> |
|
409 |
</dc:type> |
|
410 |
</xsl:when> |
|
411 |
<xsl:otherwise> |
|
412 |
<dc:type> |
|
413 |
<xsl:value-of select="string('info:eu-repo/semantics/other')"/> |
|
414 |
</dc:type> |
|
415 |
|
|
416 |
</xsl:otherwise> |
|
417 |
|
|
418 |
</xsl:choose> |
|
419 |
--> |
|
420 |
<xsl:variable name="varType" select="./@type[.='preprint']/'info:eu-repo/semantics/preprint', |
|
421 |
./@type[.='working_paper']/'info:eu-repo/semantics/workingPaper', |
|
422 |
./@type[.='report']/'info:eu-repo/semantics/report', |
|
423 |
./@type[not(.=('preprint', 'working_paper', 'report'))]/'info:eu-repo/semantics/other'"/> |
|
424 |
<dc:type> |
|
425 |
<xsl:value-of select="$varType"/> |
|
426 |
</dc:type> |
|
427 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
428 |
<xsl:variable name="varSuperType" select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
429 |
<dr:CobjCategory> |
|
430 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
431 |
<xsl:value-of select="$varCobjCategory" /> |
|
432 |
</dr:CobjCategory> |
|
433 |
<dc:source> |
|
434 |
<xsl:value-of select="concat(normalize-space(.//institution_name),' - ' , normalize-space(./item_number))"/> |
|
435 |
</dc:source> |
|
436 |
<!-- |
|
437 |
<xsl:if test="not(normalize-space($type) = 'preprint')"> |
|
438 |
<dr:CobjCategory>0020</dr:CobjCategory> |
|
439 |
</xsl:if> |
|
440 |
--> |
|
441 |
|
|
442 |
</xsl:template> |
|
443 |
|
|
444 |
<!-- sa_components seem to be supplements, but unfortunately don't state, what pertain to (no second PID) --> |
|
445 |
<xsl:template match="sa_component"> |
|
446 |
<xsl:variable name="varType" select="string('text')"/> |
|
447 |
<dc:type> |
|
448 |
<xsl:value-of select="$varType"/> |
|
449 |
</dc:type> |
|
450 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
451 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
452 |
<dr:CobjCategory> |
|
453 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
454 |
<xsl:value-of select="$varCobjCategory" /> |
|
455 |
</dr:CobjCategory> |
|
456 |
</xsl:template> |
|
457 |
|
|
458 |
<xsl:template match="report-paper"> |
|
459 |
<xsl:variable name="varType" select="string('info:eu-repo/semantics/report')"/> |
|
460 |
<dc:type> |
|
461 |
<xsl:value-of select="$varType"/> |
|
462 |
</dc:type> |
|
463 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
464 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
465 |
<dr:CobjCategory> |
|
466 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
467 |
<xsl:value-of select="$varCobjCategory" /> |
|
468 |
</dr:CobjCategory> |
|
469 |
</xsl:template> |
|
470 |
|
|
471 |
<xsl:template match="dissertation"> |
|
472 |
<xsl:variable name="varType" select="string('info:eu-repo/semantics/doctoralThesis')"/> |
|
473 |
<dc:type> |
|
474 |
<xsl:value-of select="$varType"/> |
|
475 |
</dc:type> |
|
476 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
477 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
478 |
<dr:CobjCategory> |
|
479 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
480 |
<xsl:value-of select="$varCobjCategory" /> |
|
481 |
</dr:CobjCategory> |
|
482 |
</xsl:template> |
|
483 |
|
|
484 |
<!-- databases seem to be bibliographies --> |
|
485 |
<xsl:template match="database"> |
|
486 |
<xsl:variable name="varType" select="string('bibliography')"/> |
|
487 |
<dc:type> |
|
488 |
<xsl:value-of select="$varType"/> |
|
489 |
</dc:type> |
|
490 |
<xsl:variable name="varCobjCategory" select="TransformationFunction:convertString($tf, $varType, 'TextTypologies')" /> |
|
491 |
<xsl:variable name='varSuperType' select="TransformationFunction:convertString($tf, $varCobjCategory, 'SuperTypes')" /> |
|
492 |
<dr:CobjCategory> |
|
493 |
<xsl:attribute name="type" select="$varSuperType"/> |
|
494 |
<xsl:value-of select="$varCobjCategory" /> |
|
495 |
</dr:CobjCategory> |
|
496 |
<dc:source> |
|
497 |
<xsl:value-of select="normalize-space(./database_metadata/titles/title)"/> |
|
498 |
</dc:source> |
|
499 |
</xsl:template> |
|
500 |
|
|
501 |
<!-- Extend with new templates for additional types of publication --> |
|
502 |
|
|
503 |
|
|
504 |
<!-- oaf:accessrights --> |
|
505 |
<xsl:template name="accessrights"> |
|
506 |
|
|
507 |
<xsl:choose> |
|
508 |
<xsl:when test="//program[./@name = 'AccessIndicators']/(license_ref[./@applies_to = 'vor' or not(./@applies_to)][contains(., '://creativecommons.org/licenses/by')], free_to_read)"> |
|
509 |
<xsl:variable name="varEmbargoEnd"> |
|
510 |
<xsl:value-of select="max(//program[./@name = 'AccessIndicators']/(license_ref[./@applies_to = 'vor'][contains(., '://creativecommons.org/licenses/by')], free_to_read)/@start_date/string(.))"/> |
|
511 |
</xsl:variable> |
|
512 |
<xsl:if test="xs:date( max(( string($varEmbargoEnd), '0001-01-01' ) ) ) gt current-date()"> |
|
513 |
<oaf:accessrights> |
|
514 |
<xsl:value-of select="'EMBARGO'" /> |
|
515 |
</oaf:accessrights> |
|
516 |
</xsl:if> |
|
517 |
<xsl:if test="$varEmbargoEnd and not((xs:date( max( (string($varEmbargoEnd), '0001-01-01') ) ) gt current-date()))"> |
|
518 |
<oaf:accessrights> |
|
519 |
<xsl:value-of select="'OPEN'" /> |
|
520 |
</oaf:accessrights> |
|
521 |
</xsl:if> |
|
522 |
</xsl:when> |
|
523 |
<xsl:otherwise> |
|
524 |
<oaf:accessrights> |
|
525 |
<xsl:value-of select="'UNKNOWN'"/> |
|
526 |
</oaf:accessrights> |
|
527 |
</xsl:otherwise> |
|
528 |
</xsl:choose> |
|
529 |
|
|
530 |
<xsl:for-each select="//program[./@name = 'AccessIndicators']/license_ref[not(./@applies_to = 'am') or not(./@applies_to)]"> |
|
531 |
<oaf:license> |
|
532 |
<xsl:value-of select="." /> |
|
533 |
</oaf:license> |
|
534 |
<xsl:if test="./@start_date"> |
|
535 |
<dc:date> |
|
536 |
<xsl:value-of select="concat('info:eu-repo/date/embargoEnd/', ./@start_date)"/> |
|
537 |
</dc:date> |
|
538 |
</xsl:if> |
|
539 |
</xsl:for-each> |
|
540 |
|
|
541 |
</xsl:template> |
|
542 |
|
|
543 |
|
|
544 |
<xsl:template match="* | @*"/> |
|
545 |
|
|
546 |
</xsl:stylesheet></CODE> |
|
547 |
</SCRIPT> |
|
548 |
</CONFIGURATION> |
|
549 |
<STATUS/> |
|
550 |
<SECURITY_PARAMETERS>SECURITY_PARAMETERS</SECURITY_PARAMETERS> |
|
551 |
</BODY> |
|
552 |
</RESOURCE_PROFILE> |
Also available in: Unified diff
embrace new publication types, add subtitles, add superTypes, include further funders