Skip to content

Commit bcaad4e

Browse files
committed
serializers: DataCite to DCAT-AP: fix missing prov namespace for contributors project roles
1 parent aa1b47b commit bcaad4e

File tree

3 files changed

+40
-6
lines changed

3 files changed

+40
-6
lines changed

invenio_rdm_records/resources/serializers/dcat/datacite-to-dcat-ap.xsl

+1
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@
162162
<xsl:param name="skos">http://www.w3.org/2004/02/skos/core#</xsl:param>
163163
<xsl:param name="bibo">http://purl.org/ontology/bibo/</xsl:param>
164164
<xsl:param name="citedcat">https://w3id.org/citedcat-ap/</xsl:param>
165+
<xsl:param name="prov">http://www.w3.org/ns/prov#</xsl:param>
165166

166167
<!-- MDR NALs and other code lists -->
167168

tests/conftest.py

+24-4
Original file line numberDiff line numberDiff line change
@@ -686,7 +686,7 @@ def enhanced_full_record(users):
686686
],
687687
},
688688
"role": {
689-
"id": "other",
689+
"id": "datamanager",
690690
"title": {
691691
"de": "DatenmanagerIn",
692692
"en": "Data manager",
@@ -702,10 +702,10 @@ def enhanced_full_record(users):
702702
"type": "personal",
703703
},
704704
"role": {
705-
"id": "other",
705+
"id": "projectmanager",
706706
"title": {
707-
"de": "VerteilerIn",
708-
"en": "Other",
707+
"de": "ProjektmanagerIn",
708+
"en": "Project manager",
709709
},
710710
},
711711
},
@@ -1361,6 +1361,26 @@ def contributors_role_type(app):
13611361
@pytest.fixture(scope="module")
13621362
def contributors_role_v(app, contributors_role_type):
13631363
"""Contributor role vocabulary record."""
1364+
vocabulary_service.create(
1365+
system_identity,
1366+
{
1367+
"id": "datamanager",
1368+
"props": {"datacite": "DataManager"},
1369+
"title": {"en": "Data manager"},
1370+
"type": "contributorsroles",
1371+
},
1372+
)
1373+
1374+
vocabulary_service.create(
1375+
system_identity,
1376+
{
1377+
"id": "projectmanager",
1378+
"props": {"datacite": "ProjectManager"},
1379+
"title": {"en": "Project manager"},
1380+
"type": "contributorsroles",
1381+
},
1382+
)
1383+
13641384
vocab = vocabulary_service.create(
13651385
system_identity,
13661386
{

tests/resources/serializers/test_dcat_serializer.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_dcat_serializer(running_app, enhanced_full_record):
6363
" </foaf:Project>",
6464
" </citedcat:isFundedBy>",
6565
' <citedcat:funder rdf:resource="https://ror.org/00k4n6c32"/>', # noqa
66-
" <dct:contributor>",
66+
" <citedcat:dataManager>",
6767
' <rdf:Description rdf:about="https://orcid.org/0000-0001-8135-3489">', # noqa
6868
' <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>', # noqa
6969
" <foaf:name>Nielsen, Lars Holm</foaf:name>",
@@ -81,7 +81,7 @@ def test_dcat_serializer(running_app, enhanced_full_record):
8181
" </foaf:Organization>",
8282
" </org:memberOf>",
8383
" </rdf:Description>",
84-
" </dct:contributor>",
84+
" </citedcat:dataManager>",
8585
" <dct:contributor>",
8686
" <rdf:Description>",
8787
' <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>', # noqa
@@ -90,6 +90,19 @@ def test_dcat_serializer(running_app, enhanced_full_record):
9090
" <foaf:familyName>Dirk</foaf:familyName>",
9191
" </rdf:Description>",
9292
" </dct:contributor>",
93+
" <prov:wasGeneratedBy>",
94+
" <foaf:Project>",
95+
' <rdf:type rdf:resource="http://www.w3.org/ns/prov#Activity"/>',
96+
" <citedcat:projectManager>",
97+
" <rdf:Description>",
98+
' <rdf:type rdf:resource="http://xmlns.com/foaf/0.1/Person"/>',
99+
" <foaf:name>Dirk, Dirkin</foaf:name>",
100+
" <foaf:givenName>Dirkin</foaf:givenName>",
101+
" <foaf:familyName>Dirk</foaf:familyName>",
102+
" </rdf:Description>",
103+
" </citedcat:projectManager>",
104+
" </foaf:Project>",
105+
" </prov:wasGeneratedBy>",
93106
' <dct:issued rdf:datatype="http://www.w3.org/2001/XMLSchema#dateTime">2018/2020-09</dct:issued>', # noqa
94107
' <dct:date rdf:datatype="http://www.w3.org/2001/XMLSchema#date">1939/1945</dct:date>', # noqa
95108
' <dct:language rdf:resource="http://publications.europa.eu/resource/authority/language/DAN"/>', # noqa

0 commit comments

Comments
 (0)