-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdatacite-to-dcat-ap.xsl
3456 lines (3262 loc) · 151 KB
/
datacite-to-dcat-ap.xsl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2016-2021 EUROPEAN UNION
Licensed under the EUPL, Version 1.2 or - as soon they will be approved by
the European Commission - subsequent versions of the EUPL (the "Licence");
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at:
https://joinup.ec.europa.eu/collection/eupl
Unless required by applicable law or agreed to in writing, software
distributed under the Licence is distributed on an "AS IS" basis,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the Licence for the specific language governing permissions and
limitations under the Licence.
Authors: European Commission, Joint Research Centre (JRC)
Andrea Perego (https://github.com/andrea-perego)
Source code: https://github.com/ec-jrc/datacite-to-dcat-ap
-->
<!--
PURPOSE AND USAGE
This XSLT is a proof of concept for the implementation of the specification
concerning the DataCite profile of DCAT-AP (CiteDCAT-AP):
https://w3id.org/citedcat-ap/
As such, this XSLT must be considered as unstable, and can be updated any
time based on the revisions to the CiteDCAT-AP specification.
The official distributions of this XSLT are published in the dedicated GitHub
repository:
https://github.com/ec-jrc/datacite-to-dcat-ap
Comments and inquiries should be sent via the corresponding issue tracker:
https://github.com/ec-jrc/datacite-to-dcat-ap/issues
-->
<xsl:transform
xmlns:adms = "http://www.w3.org/ns/adms#"
xmlns:bibo = "http://purl.org/ontology/bibo/"
xmlns:citedcat = "https://w3id.org/citedcat-ap/"
xmlns:dct = "http://purl.org/dc/terms/"
xmlns:dctype = "http://purl.org/dc/dcmitype/"
xmlns:dcat = "http://www.w3.org/ns/dcat#"
xmlns:foaf = "http://xmlns.com/foaf/0.1/"
xmlns:gsp = "http://www.opengis.net/ont/geosparql#"
xmlns:locn = "http://www.w3.org/ns/locn#"
xmlns:org = "http://www.w3.org/ns/org#"
xmlns:owl = "http://www.w3.org/2002/07/owl#"
xmlns:prov = "http://www.w3.org/ns/prov#"
xmlns:rdf = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs = "http://www.w3.org/2000/01/rdf-schema#"
xmlns:skos = "http://www.w3.org/2004/02/skos/core#"
xmlns:vcard = "http://www.w3.org/2006/vcard/ns#"
xmlns:wdrs = "http://www.w3.org/2007/05/powder-s#"
xmlns:xlink = "http://www.w3.org/1999/xlink"
xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform"
xmlns:dtct2.2 = "http://datacite.org/schema/kernel-2.2"
xmlns:dtct3 = "http://datacite.org/schema/kernel-3"
xmlns:dtct4 = "http://datacite.org/schema/kernel-4"
exclude-result-prefixes = "dtct2.2 dtct3 dtct4 xlink xsi xsl"
version="1.0">
<xsl:output method="xml"
indent="yes"
encoding="utf-8"
cdata-section-elements="locn:geometry dcat:bbox dcat:centroid" />
<!-- Vars used when transforming strings into upper/lowercase. -->
<xsl:variable name="lowercase" select="'abcdefghijklmnopqrstuvwxyz'"/>
<xsl:variable name="uppercase" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<!-- The namespace of the DataCite metadata schema changes depending on the schema version -->
<!--
<xsl:param name="dtctNsUriPrefix">http://datacite.org/schema/kernel-</xsl:param>
-->
<!--
Mapping parameters
==================
This section includes mapping parameters to be modified manually.
-->
<!-- Parameter $profile -->
<!--
This parameter specifies the CiteDCAT-AP profile to be used:
- value "core": the CiteDCAT-AP Core profile, which includes only the DataCite metadata elements supported in DCAT-AP
- value "extended": the CiteDCAT-AP Extended profile, which defines mappings for all the DataCite metadata elements
The current specifications for the core and extended CiteDCAT-AP profiles are available on the JRC GitHub repository:
https://github.com/ec-jrc/datacite-to-dcat-ap/
-->
<!-- Uncomment to use CiteDCAT-AP Core -->
<!--
<xsl:param name="profile">core</xsl:param>
-->
<!-- Uncomment to use CiteDCAT-AP Extended -->
<xsl:param name="profile">extended</xsl:param>
<!--
Other global parameters
=======================
-->
<!-- URI and URN of the spatial reference system (SRS) used in the bounding box.
The default SRS is CRS84. If a different SRS is used, also parameter
$SrsAxisOrder must be specified. -->
<!-- Old param
<xsl:param name="srid">4326</xsl:param>
-->
<!-- The SRS URI is used in the WKT and GML encodings of the bounding box. -->
<xsl:param name="SrsUri">http://www.opengis.net/def/crs/OGC/1.3/CRS84</xsl:param>
<!-- The SRS URN is used in the GeoJSON encoding of the bounding box. -->
<xsl:param name="SrsUrn">urn:ogc:def:crs:OGC:1.3:CRS84</xsl:param>
<!-- Axis order for the reference SRS:
- "LonLat": longitude / latitude
- "LatLon": latitude / longitude.
The axis order must be specified only if the reference SRS is different from CRS84.
If the reference SRS is CRS84, this parameter is ignored. -->
<xsl:param name="SrsAxisOrder">LonLat</xsl:param>
<!-- Namespaces -->
<xsl:param name="xsd">http://www.w3.org/2001/XMLSchema#</xsl:param>
<xsl:param name="dct">http://purl.org/dc/terms/</xsl:param>
<xsl:param name="dctype">http://purl.org/dc/dcmitype/</xsl:param>
<xsl:param name="foaf">http://xmlns.com/foaf/0.1/</xsl:param>
<xsl:param name="vcard">http://www.w3.org/2006/vcard/ns#</xsl:param>
<!-- Currently not used.
<xsl:param name="timeUri">http://placetime.com/</xsl:param>
<xsl:param name="timeInstantUri" select="concat($timeUri,'instant/gregorian/')"/>
<xsl:param name="timeIntervalUri" select="concat($timeUri,'interval/gregorian/')"/>
-->
<xsl:param name="dcat">http://www.w3.org/ns/dcat#</xsl:param>
<xsl:param name="gsp">http://www.opengis.net/ont/geosparql#</xsl:param>
<xsl:param name="skos">http://www.w3.org/2004/02/skos/core#</xsl:param>
<xsl:param name="bibo">http://purl.org/ontology/bibo/</xsl:param>
<xsl:param name="citedcat">https://w3id.org/citedcat-ap/</xsl:param>
<xsl:param name="prov">http://www.w3.org/ns/prov#</xsl:param>
<!-- MDR NALs and other code lists -->
<xsl:param name="op">http://publications.europa.eu/resource/authority/</xsl:param>
<xsl:param name="oplang" select="concat($op,'language/')"/>
<xsl:param name="opcb" select="concat($op,'corporate-body/')"/>
<xsl:param name="oplic" select="concat($op,'licence/')"/>
<xsl:param name="opar" select="concat($op,'access-right/')"/>
<xsl:param name="opds" select="concat($op,'dataset-status/')"/>
<!--
<xsl:param name="opcountry" select="concat($op,'country/')"/>
<xsl:param name="opfq" select="concat($op,'frequency/')"/>
<xsl:param name="cldFrequency">http://purl.org/cld/freq/</xsl:param>
-->
<!-- IANA base URI -->
<xsl:param name="iana">https://www.iana.org/assignments/</xsl:param>
<!-- IANA registers URIs -->
<xsl:param name="iana-mt" select="concat($iana,'media-types/')"/>
<!-- DEPRECATED: Parameter kept for backward compatibility -->
<!-- This was used as the datatype for the GeoJSON-based encoding of the geometry, now replaced by gsp:geoJSONLiteral . -->
<xsl:param name="geojsonMediaTypeUri" select="concat($iana-mt,'application/vnd.geo+json')"/>
<!--
Master template
===============
-->
<xsl:template match="/">
<rdf:RDF>
<xsl:apply-templates select="*[local-name() = 'resource' and starts-with(namespace-uri(), 'http://datacite.org/schema/kernel-')]|//*[local-name() = 'resource' and starts-with(namespace-uri(), 'http://datacite.org/schema/kernel-')]"/>
</rdf:RDF>
</xsl:template>
<!--
Metadata template
=================
-->
<xsl:template match="*[local-name() = 'resource' and starts-with(namespace-uri(), 'http://datacite.org/schema/kernel-')]|//*[local-name() = 'resource' and starts-with(namespace-uri(), 'http://datacite.org/schema/kernel-')]">
<!--
Parameters to create HTTP URIs for the resource and the corresponding metadata record
_____________________________________________________________________________________
These parameters must be customised depending on the strategy used to assign HTTP URIs.
The default rule implies that HTTP URIs are specified for the metadata file identifier
(metadata URI) and the resource identifier (resource URI).
-->
<xsl:param name="ResourceUri">
<xsl:variable name="identifier" select="normalize-space(*[local-name() = 'identifier'])"/>
<xsl:variable name="type" select="normalize-space(translate(*[local-name() = 'identifier']/@identifierType,$uppercase,$lowercase))"/>
<xsl:variable name="schemeURI" select="*[local-name() = 'identifier']/@schemeURI"/>
<xsl:variable name="uri">
<xsl:call-template name="IdentifierURI">
<xsl:with-param name="identifier" select="$identifier"/>
<xsl:with-param name="type" select="$type"/>
<xsl:with-param name="schemeURI" select="$schemeURI"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="urilc" select="translate($uri,$uppercase,$lowercase)"/>
<xsl:if test="$uri != '' and ( starts-with($urilc, 'http://') or starts-with($urilc, 'https://') )">
<xsl:value-of select="$uri"/>
</xsl:if>
</xsl:param>
<xsl:param name="MetadataUri"/>
<!--
Other parameters
________________
-->
<!-- Resource type -->
<xsl:param name="ResourceType">
<xsl:variable name="type" select="normalize-space(translate(*[local-name() = 'resourceType']/@resourceTypeGeneral,$uppercase,$lowercase))"/>
<xsl:choose>
<xsl:when test="$type = 'audiovisual'">dataset</xsl:when>
<xsl:when test="$type = 'collection'">dataset</xsl:when>
<xsl:when test="$type = 'dataset'">dataset</xsl:when>
<xsl:when test="$type = 'event'">event</xsl:when>
<xsl:when test="$type = 'image'">dataset</xsl:when>
<xsl:when test="$type = 'interactiveresource'">dataset</xsl:when>
<xsl:when test="$type = 'model'">dataset</xsl:when>
<xsl:when test="$type = 'physicalobject'">physicalobject</xsl:when>
<xsl:when test="$type = 'service'">service</xsl:when>
<xsl:when test="$type = 'software'">dataset</xsl:when>
<xsl:when test="$type = 'sound'">dataset</xsl:when>
<xsl:when test="$type = 'text'">dataset</xsl:when>
<xsl:when test="$type = 'workflow'">dataset</xsl:when>
<xsl:when test="$type = 'other'">other</xsl:when>
<!-- Added in DataCite v4.1 -->
<xsl:when test="$type = 'datapaper'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'book'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'bookchapter'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'computationalnotebook'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'conferencepaper'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'conferenceproceeding'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'dissertation'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'journal'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'journalarticle'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'outputsmanagementplan'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'peerreview'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'preprint'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'report'">dataset</xsl:when>
<!-- Added in DataCite v4.4 -->
<xsl:when test="$type = 'standard'">dataset</xsl:when>
<xsl:otherwise>other</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- Metadata description (metadata on metadata) -->
<xsl:param name="MetadataDescription"/>
<!-- Resource description (resource metadata) -->
<xsl:param name="ResourceDescription">
<!-- Resource type -->
<!--
<xsl:apply-templates select="*[local-name() = 'resourceType']"/>
-->
<xsl:apply-templates select="*[local-name() = 'resourceType']/@resourceTypeGeneral"/>
<!-- Identifier -->
<xsl:apply-templates select="*[local-name() = 'identifier']">
<xsl:with-param name="ResourceType" select="$ResourceType"/>
</xsl:apply-templates>
<!-- Creators -->
<xsl:apply-templates select="*[local-name() = 'creators']/*[local-name() = 'creator']"/>
<!-- Titles -->
<xsl:apply-templates select="*[local-name() = 'titles']/*[local-name() = 'title']"/>
<!-- Publisher -->
<xsl:apply-templates select="*[local-name() = 'publisher']"/>
<!-- Publication year-->
<xsl:apply-templates select="*[local-name() = 'publicationYear']"/>
<!-- Subjects -->
<xsl:apply-templates select="*[local-name() = 'subjects']/*[local-name() = 'subject']"/>
<!-- Funding references -->
<xsl:if test="$profile = 'extended'">
<xsl:for-each select="*[local-name() = 'fundingReferences']/*[local-name() = 'fundingReference']">
<xsl:call-template name="FundingReferences"/>
</xsl:for-each>
</xsl:if>
<!-- Contributors-->
<xsl:apply-templates select="*[local-name() = 'contributors']/*[local-name() = 'contributor']"/>
<!-- Dates -->
<xsl:apply-templates select="*[local-name() = 'dates']/*[local-name() = 'date']"/>
<!-- Language -->
<xsl:apply-templates select="*[local-name() = 'language']"/>
<!-- Alternate identifiers-->
<xsl:apply-templates select="*[local-name() = 'alternateIdentifiers']/*[local-name() = 'alternateIdentifier']"/>
<!-- Related identifiers -->
<xsl:apply-templates select="*[local-name() = 'relatedIdentifiers']/*[local-name() = 'relatedIdentifier']"/>
<!-- Added in DataCite v4.4 -->
<!-- Related items -->
<xsl:apply-templates select="*[local-name() = 'relatedItems']/*[local-name() = 'relatedItem']"/>
<!-- Version -->
<xsl:apply-templates select="*[local-name() = 'version']"/>
<!-- Descriptions -->
<xsl:apply-templates select="*[local-name() = 'descriptions']/*[local-name() = 'description']"/>
<!-- Geo locations -->
<xsl:apply-templates select="*[local-name() = 'geoLocations']/*[local-name() = 'geoLocation']"/>
<!-- Access rights -->
<!-- For DataCite schema version < 3 -->
<xsl:apply-templates select="*[local-name() = 'rights']">
<xsl:with-param name="show-access-rights">yes</xsl:with-param>
</xsl:apply-templates>
<!-- For DataCite schema version >= 3 -->
<xsl:apply-templates select="*[local-name() = 'rightsList']">
<xsl:with-param name="show-access-rights">yes</xsl:with-param>
</xsl:apply-templates>
<!-- Distribution -->
<xsl:variable name="distribution">
<!-- Sizes -->
<xsl:apply-templates select="*[local-name() = 'sizes']/*[local-name() = 'size']"/>
<!-- Formats-->
<xsl:apply-templates select="*[local-name() = 'formats']/*[local-name() = 'format']"/>
<!-- Rights -->
<!-- For DataCite schema version < 3 -->
<xsl:apply-templates select="*[local-name() = 'rights']">
<xsl:with-param name="show-licence">yes</xsl:with-param>
<xsl:with-param name="show-rights">yes</xsl:with-param>
</xsl:apply-templates>
<!-- For DataCite schema version >= 3 -->
<xsl:apply-templates select="*[local-name() = 'rightsList']">
<xsl:with-param name="show-licence">yes</xsl:with-param>
<xsl:with-param name="show-rights">yes</xsl:with-param>
</xsl:apply-templates>
<xsl:if test="$ResourceUri != ''">
<xsl:choose>
<xsl:when test="$ResourceType = 'dataset'">
<dcat:accessURL rdf:resource="{$ResourceUri}"/>
</xsl:when>
<xsl:otherwise>
<!--
<foaf:page rdf:resource="{$ResourceUri}"/>
-->
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="$ResourceType = 'dataset'">
<dcat:distribution>
<dcat:Distribution>
<xsl:copy-of select="$distribution"/>
</dcat:Distribution>
</dcat:distribution>
</xsl:when>
<xsl:otherwise>
<xsl:copy-of select="$distribution"/>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- Generating the output record. -->
<xsl:if test="$profile = 'extended' or ($profile = 'core' and $ResourceType = 'dataset')">
<xsl:choose>
<xsl:when test="$ResourceUri != ''">
<xsl:choose>
<xsl:when test="$MetadataUri != ''">
<rdf:Description rdf:about="{$MetadataUri}">
<rdf:type rdf:resource="{$dcat}CatalogRecord"/>
<foaf:primaryTopic rdf:resource="{$ResourceUri}"/>
<xsl:copy-of select="$MetadataDescription"/>
</rdf:Description>
</xsl:when>
<xsl:otherwise>
<xsl:if test="normalize-space($MetadataDescription)">
<rdf:Description>
<rdf:type rdf:resource="{$dcat}CatalogRecord"/>
<foaf:primaryTopic rdf:resource="{$ResourceUri}"/>
<xsl:copy-of select="$MetadataDescription"/>
</rdf:Description>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<rdf:Description rdf:about="{$ResourceUri}">
<xsl:copy-of select="$ResourceDescription"/>
</rdf:Description>
</xsl:when>
<xsl:otherwise>
<rdf:Description>
<xsl:if test="normalize-space($MetadataDescription)">
<foaf:isPrimaryTopicOf>
<rdf:Description>
<rdf:type rdf:resource="{$dcat}CatalogRecord"/>
<xsl:copy-of select="$MetadataDescription"/>
</rdf:Description>
</foaf:isPrimaryTopicOf>
</xsl:if>
<xsl:copy-of select="$ResourceDescription"/>
</rdf:Description>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$profile = 'extended'">
<xsl:for-each select="//*[local-name() = 'fundingReferences']/*[local-name() = 'fundingReference' and normalize-space(*[local-name() = 'awardNumber']/@awardURI) != '']">
<xsl:call-template name="FundingAwards"/>
</xsl:for-each>
<xsl:for-each select="//*[local-name() = 'fundingReferences']/*[local-name() = 'fundingReference' and ( starts-with(translate(normalize-space(*[local-name() = 'funderIdentifier']),$uppercase,$lowercase),'http://') or starts-with(translate(normalize-space(*[local-name() = 'funderIdentifier']),$uppercase,$lowercase),'https://') ) and not(*[local-name() = 'funderIdentifier']=preceding::*)]">
<xsl:call-template name="Funders"/>
</xsl:for-each>
</xsl:if>
</xsl:if>
</xsl:template>
<!--
DataCite elements templates
===========================
-->
<!-- Titles template -->
<xsl:template name="Titles" match="*[local-name() = 'titles']/*[local-name() = 'title']">
<xsl:variable name="title" select="normalize-space(.)"/>
<xsl:variable name="type" select="normalize-space(translate(@titleType,$uppercase,$lowercase))"/>
<xsl:choose>
<xsl:when test="$type = ''">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:title xml:lang="{@xml:lang}"><xsl:value-of select="$title"/></dct:title>
</xsl:when>
<xsl:otherwise>
<dct:title><xsl:value-of select="$title"/></dct:title>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$type = 'alternativetitle'">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:alternative xml:lang="{@xml:lang}"><xsl:value-of select="$title"/></dct:alternative>
</xsl:when>
<xsl:otherwise>
<dct:alternative><xsl:value-of select="$title"/></dct:alternative>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<!-- TBD
<xsl:when test="$type = 'subtitle' and $profile = 'extended'">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:?? xml:lang="{@xml:lang}"><xsl:value-of select="$title"/></dct:??>
</xsl:when>
<xsl:otherwise>
<dct:??><xsl:value-of select="$title"/></dct:??>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
-->
<!-- Unstable -->
<xsl:when test="$type = 'translated'">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:title xml:lang="{@xml:lang}"><xsl:value-of select="$title"/></dct:title>
</xsl:when>
<xsl:otherwise>
<dct:title><xsl:value-of select="$title"/></dct:title>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- Descriptions template -->
<xsl:template name="Descriptions" match="*[local-name() = 'descriptions']/*[local-name() = 'description']">
<xsl:variable name="description" select="normalize-space(.)"/>
<xsl:variable name="type" select="normalize-space(translate(@descriptionType,$uppercase,$lowercase))"/>
<xsl:if test="$description != ''">
<xsl:choose>
<xsl:when test="$type = 'abstract'">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:description xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></dct:description>
</xsl:when>
<xsl:otherwise>
<dct:description><xsl:value-of select="$description"/></dct:description>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$type = 'methods'">
<dct:provenance>
<dct:ProvenanceStatement>
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<rdfs:label xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></rdfs:label>
</xsl:when>
<xsl:otherwise>
<rdfs:label><xsl:value-of select="$description"/></rdfs:label>
</xsl:otherwise>
</xsl:choose>
</dct:ProvenanceStatement>
</dct:provenance>
</xsl:when>
<xsl:when test="$type = 'seriesinformation' and $profile = 'extended'">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<bibo:locator xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></bibo:locator>
</xsl:when>
<xsl:otherwise>
<bibo:locator><xsl:value-of select="$description"/></bibo:locator>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$type = 'tableofcontents' and $profile = 'extended'">
<dct:tableOfContents><xsl:value-of select="$description"/></dct:tableOfContents>
</xsl:when>
<!--
<xsl:when test="$type = 'other' and $profile = 'extended'">
<rdfs:comment xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></rdfs:comment>
</xsl:when>
-->
<!-- The following is meant to deal also with $type = 'other', and ensures that a dct:description is provided in
the resulting record. -->
<xsl:otherwise>
<xsl:choose>
<xsl:when test="not(../*[local-name() = 'description' and $type = 'abstract'])">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:description xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></dct:description>
</xsl:when>
<xsl:otherwise>
<dct:description><xsl:value-of select="$description"/></dct:description>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<rdfs:comment xml:lang="{@xml:lang}"><xsl:value-of select="$description"/></rdfs:comment>
</xsl:when>
<xsl:otherwise>
<rdfs:comment><xsl:value-of select="$description"/></rdfs:comment>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:template>
<!-- Subjects template -->
<xsl:template name="Subjects" match="*[local-name() = 'subjects']/*[local-name() = 'subject']">
<xsl:variable name="subject" select="normalize-space(.)"/>
<xsl:variable name="subjectScheme" select="normalize-space(@subjectScheme)"/>
<xsl:variable name="subjectSchemeLC" select="translate($subjectScheme,$uppercase,$lowercase)"/>
<xsl:variable name="schemeURI" select="@schemeURI"/>
<!-- Added in DataCite v4.0 -->
<xsl:variable name="valueURI" select="@valueURI"/>
<!-- Added in DataCite v4.4 -->
<xsl:variable name="classificationCode" select="@classificationCode"/>
<xsl:choose>
<xsl:when test="starts-with($valueURI, 'http://') or starts-with($subject, 'https://')">
<xsl:choose>
<xsl:when test="starts-with($valueURI, 'http://publications.europa.eu/resource/authority/theme/')">
<dcat:theme rdf:resource="{$valueURI}"/>
</xsl:when>
<xsl:otherwise>
<dct:subject rdf:resource="{$valueURI}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="starts-with($subject, 'http://') or starts-with($subject, 'https://')">
<xsl:choose>
<xsl:when test="starts-with($subject, 'http://publications.europa.eu/resource/authority/theme/')">
<dcat:theme rdf:resource="{$subject}"/>
</xsl:when>
<xsl:otherwise>
<dct:subject rdf:resource="{$subject}"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:when test="$subjectScheme != '' or $schemeURI != ''">
<dct:subject>
<skos:Concept>
<xsl:if test="$classificationCode != ''">
<skos:notation><xsl:value-of select="$classificationCode"/></skos:notation>
<dct:identifier><xsl:value-of select="$classificationCode"/></dct:identifier>
</xsl:if>
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<skos:prefLabel xml:lang="{@xml:lang}"><xsl:value-of select="$subject"/></skos:prefLabel>
</xsl:when>
<xsl:otherwise>
<skos:prefLabel><xsl:value-of select="$subject"/></skos:prefLabel>
</xsl:otherwise>
</xsl:choose>
<skos:inScheme>
<xsl:choose>
<xsl:when test="$subjectScheme != '' and $schemeURI != ''">
<skos:ConceptScheme rdf:about="{$schemeURI}">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:title xml:lang="{@xml:lang}"><xsl:value-of select="$subjectScheme"/></dct:title>
</xsl:when>
<xsl:otherwise>
<dct:title><xsl:value-of select="$subjectScheme"/></dct:title>
</xsl:otherwise>
</xsl:choose>
</skos:ConceptScheme>
</xsl:when>
<xsl:when test="not($subjectScheme != '') and $schemeURI != ''">
<skos:ConceptScheme rdf:about="{$schemeURI}"/>
</xsl:when>
<xsl:when test="$subjectScheme != '' and not($schemeURI != '')">
<skos:ConceptScheme>
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dct:title xml:lang="{@xml:lang}"><xsl:value-of select="$subjectScheme"/></dct:title>
</xsl:when>
<xsl:otherwise>
<dct:title><xsl:value-of select="$subjectScheme"/></dct:title>
</xsl:otherwise>
</xsl:choose>
</skos:ConceptScheme>
</xsl:when>
</xsl:choose>
</skos:inScheme>
</skos:Concept>
</dct:subject>
</xsl:when>
<xsl:otherwise>
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<dcat:keyword xml:lang="{@xml:lang}"><xsl:value-of select="$subject"/></dcat:keyword>
</xsl:when>
<xsl:otherwise>
<dcat:keyword><xsl:value-of select="$subject"/></dcat:keyword>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<!-- Funding references template -->
<xsl:template name="FundingReferences">
<xsl:param name="funderIdentifier" select="normalize-space(*[local-name() = 'funderIdentifier'])"/>
<xsl:param name="funderIdentifierType" select="translate(normalize-space(*[local-name() = 'funderIdentifier']/@funderIdentifierType),$uppercase,$lowercase)"/>
<xsl:param name="funderURI">
<xsl:variable name="uri">
<xsl:call-template name="IdentifierURI">
<xsl:with-param name="identifier" select="$funderIdentifier"/>
<xsl:with-param name="type" select="$funderIdentifierType"/>
<!--
<xsl:with-param name="schemeURI" select="$schemeURI"/>
-->
</xsl:call-template>
</xsl:variable>
<xsl:if test="starts-with(translate(normalize-space($uri),$uppercase,$lowercase),'http://') or starts-with(translate(normalize-space($uri),$uppercase,$lowercase),'https://') or starts-with(translate(normalize-space($uri),$uppercase,$lowercase),'urn://')">
<xsl:value-of select="$uri"/>
</xsl:if>
<!--
<xsl:if test="starts-with(translate(normalize-space(*[local-name() = 'funderIdentifier']),$uppercase,$lowercase),'http://') or starts-with(translate(normalize-space(*[local-name() = 'funderIdentifier']),$uppercase,$lowercase),'https://')">
<xsl:value-of select="normalize-space(*[local-name() = 'funderIdentifier'])"/>
</xsl:if>
-->
</xsl:param>
<xsl:param name="funderInfo">
<dct:identifier><xsl:value-of select="normalize-space(*[local-name() = 'funderIdentifier'])"/></dct:identifier>
<foaf:name><xsl:value-of select="normalize-space(*[local-name() = 'funderName'])"/></foaf:name>
</xsl:param>
<xsl:param name="fundingReferenceURI">
<xsl:value-of select="normalize-space(*[local-name() = 'awardNumber']/@awardURI)"/>
</xsl:param>
<xsl:choose>
<xsl:when test="$fundingReferenceURI != ''">
<citedcat:isFundedBy rdf:resource="{$fundingReferenceURI}"/>
</xsl:when>
<xsl:when test="normalize-space(*[local-name() = 'awardNumber']) != '' or normalize-space(*[local-name() = 'awardTitle']) != ''">
<citedcat:isFundedBy>
<xsl:call-template name="FundingAwards"/>
</citedcat:isFundedBy>
</xsl:when>
</xsl:choose>
<xsl:choose>
<xsl:when test="$funderURI != ''">
<!-- DEPRECATED Replaced by citedcat:funder
<schema:funder rdf:resource="{$funderURI}"/>
-->
<citedcat:funder rdf:resource="{$funderURI}"/>
</xsl:when>
<xsl:when test="normalize-space($funderInfo) != ''">
<!-- DEPRECATED Replaced by citedcat:funder
<schema:funder>
<xsl:call-template name="Funders"/>
</schema:funder>
-->
<citedcat:funder>
<xsl:call-template name="Funders"/>
</citedcat:funder>
</xsl:when>
</xsl:choose>
</xsl:template>
<!-- Version template -->
<xsl:template name="Version" match="*[local-name() = 'version']">
<owl:versionInfo><xsl:value-of select="normalize-space(.)"/></owl:versionInfo>
</xsl:template>
<!-- Rights template -->
<xsl:template name="Rights" match="*[local-name() = 'rights']">
<xsl:param name="show-licence"/>
<xsl:param name="show-access-rights"/>
<xsl:param name="show-rights"/>
<xsl:param name="rightsText" select="normalize-space(.)"/>
<xsl:param name="rightsURI" select="normalize-space(@rightsURI)"/>
<xsl:param name="rightsLabel">
<xsl:choose>
<xsl:when test="normalize-space(@xml:lang) != ''">
<rdfs:label xml:lang="{@xml:lang}"><xsl:value-of select="$rightsText"/></rdfs:label>
</xsl:when>
<xsl:otherwise>
<rdfs:label><xsl:value-of select="$rightsText"/></rdfs:label>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<!-- Added in DataCite v4.2 -->
<xsl:param name="rightsIdentifier" select="normalize-space(@rightsIdentifier)"/>
<!-- Added in DataCite v4.2 -->
<xsl:param name="rightsIdentifierScheme" select="normalize-space(@rightsIdentifierScheme)"/>
<!-- Added in DataCite v4.2 -->
<xsl:param name="rightsIdentifierSchemeURI" select="normalize-space(@schemeURI)"/>
<xsl:param name="rightsID">
<xsl:if test="$rightsIdentifier != ''">
<adms:identifier>
<adms:Identifier>
<skos:notation><xsl:value-of select="$rightsIdentifier"/></skos:notation>
<xsl:choose>
<xsl:when test="$rightsIdentifierScheme != ''">
<adms:schemeAgency><xsl:value-of select="$rightsIdentifierScheme"/></adms:schemeAgency>
</xsl:when>
<xsl:when test="$rightsIdentifierSchemeURI != ''">
<dct:creator rdf:resource="{$rightsIdentifierSchemeURI}"/>
</xsl:when>
</xsl:choose>
</adms:Identifier>
</adms:identifier>
</xsl:if>
</xsl:param>
<xsl:param name="licence">
<xsl:if test="$rightsURI != ''">
<!--
<xsl:if test="$show-use-conditions = 'yes'">
<rdfs:label><xsl:value-of select="$rightsURI"/></rdfs:label>
-->
<xsl:choose>
<xsl:when test="starts-with($rightsURI, 'http://creativecommons.org/')">
<dct:license rdf:resource="{$rightsURI}"/>
</xsl:when>
<xsl:when test="starts-with($rightsURI, 'https://creativecommons.org/')">
<dct:license rdf:resource="{$rightsURI}"/>
</xsl:when>
<xsl:when test="starts-with($rightsURI, $oplic)">
<dct:license rdf:resource="{$rightsURI}"/>
</xsl:when>
<xsl:otherwise>not-detected</xsl:otherwise>
</xsl:choose>
<!--
</xsl:if>
<xsl:if test="$show-access-conditions = 'yes'">
<xsl:choose>
-->
</xsl:if>
</xsl:param>
<xsl:param name="access-rights">
<xsl:if test="$rightsURI != ''">
<!--
See:
- https://wiki.surfnet.nl/display/standards/info-eu-repo#info-eu-repo-AccessRights
- http://guidelines.readthedocs.io/en/latest/data/field_rights.html
-->
<xsl:choose>
<xsl:when test="starts-with($rightsURI,'info:eu-repo/semantics/closedAccess')">
<dct:accessRights rdf:resource="{$opar}NON_PUBLIC"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,'info:eu-repo/semantics/embargoedAccess')">
<dct:accessRights rdf:resource="{$opar}NON_PUBLIC"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,'info:eu-repo/semantics/restrictedAccess')">
<dct:accessRights rdf:resource="{$opar}RESTRICTED"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,'info:eu-repo/semantics/openAccess')">
<dct:accessRights rdf:resource="{$opar}PUBLIC"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<!-- See: http://www.ukoln.ac.uk/repositories/digirep/index/Eprints_AccessRights_Vocabulary_Encoding_Scheme -->
<xsl:when test="starts-with($rightsURI,'http://purl.org/eprint/accessRights/ClosedAccess')">
<dct:accessRights rdf:resource="{$opar}NON_PUBLIC"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,'http://purl.org/eprint/accessRights/RestrictedAccess')">
<dct:accessRights rdf:resource="{$opar}RESTRICTED"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,'http://purl.org/eprint/accessRights/OpenAccess')">
<dct:accessRights rdf:resource="{$opar}PUBLIC"/>
<dct:accessRights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</dct:accessRights>
</xsl:when>
<xsl:when test="starts-with($rightsURI,$opar)">
<dct:accessRights rdf:resource="{$rightsURI}"/>
</xsl:when>
<xsl:otherwise>not-detected</xsl:otherwise>
</xsl:choose>
</xsl:if>
</xsl:param>
<xsl:param name="rights">
<xsl:choose>
<xsl:when test="$rightsURI != ''">
<dct:rights>
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
<xsl:copy-of select="$rightsID"/>
</dct:RightsStatement>
</dct:rights>
</xsl:when>
<xsl:otherwise>
<dct:rights>
<dct:RightsStatement>
<xsl:copy-of select="$rightsLabel"/>
<xsl:copy-of select="$rightsID"/>
</dct:RightsStatement>
</dct:rights>
</xsl:otherwise>
</xsl:choose>
</xsl:param>
<xsl:choose>
<xsl:when test="$licence != 'not-detected' or $access-rights != 'not-detected'">
<xsl:if test="$licence != 'not-detected' and $show-licence = 'yes'">
<xsl:copy-of select="$licence"/>
</xsl:if>
<xsl:if test="$access-rights != 'not-detected' and $show-access-rights = 'yes'">
<xsl:copy-of select="$access-rights"/>
</xsl:if>
</xsl:when>
<xsl:when test="$show-rights = 'yes'">
<xsl:copy-of select="$rights"/>
</xsl:when>
</xsl:choose>
<!--
<dct:rights>
<xsl:choose>
<xsl:when test="$rightsURI != ''">
<dct:RightsStatement rdf:about="{$rightsURI}">
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</xsl:when>
<xsl:otherwise>
<dct:RightsStatement>
<xsl:copy-of select="$rightsLabel"/>
</dct:RightsStatement>
</xsl:otherwise>
</xsl:choose>
</dct:rights>
-->
</xsl:template>
<!-- Rights list template -->
<xsl:template name="RightsList" match="*[local-name() = 'rightsList']">
<xsl:param name="show-licence"/>
<xsl:param name="show-access-rights"/>
<xsl:param name="show-rights"/>
<xsl:apply-templates select="*[local-name() = 'rights']">
<xsl:with-param name="show-licence" select="$show-licence"/>
<xsl:with-param name="show-access-rights" select="$show-access-rights"/>
<xsl:with-param name="show-rights" select="$show-rights"/>
</xsl:apply-templates>
</xsl:template>
<!-- Geolocations template -->
<xsl:template name="Geolocations" match="*[local-name() = 'geoLocations']/*[local-name() = 'geoLocation']">
<xsl:param name="place" select="normalize-space(*[local-name() = 'geoLocationPlace'])"/>
<xsl:param name="point">
<xsl:if test="normalize-space(*[local-name() = 'geoLocationPoint']) != ''">
<xsl:choose>
<xsl:when test="*[local-name() = 'geoLocationPoint']/*[local-name() = 'pointLatitude'] and *[local-name() = 'geoLocationPoint']/*[local-name() = 'pointLongitude']">
<xsl:value-of select="normalize-space(concat(*[local-name() = 'geoLocationPoint']/*[local-name() = 'pointLatitude'],' ',*[local-name() = 'geoLocationPoint']/*[local-name() = 'pointLongitude']))"/>
</xsl:when>
<xsl:when test="self::text()">
<xsl:value-of select="normalize-space(translate(*[local-name() = 'geoLocationPoint'],',',' '))"/>
</xsl:when>
</xsl:choose>