Skip to content

Commit e352e09

Browse files
sh-andriyfelliott
authored andcommitted
feat(osf): Update OSF metadata model code and tests for ROR funder identifier support
1 parent a4976ea commit e352e09

File tree

9 files changed

+33
-22
lines changed

9 files changed

+33
-22
lines changed

osf/metadata/schemas/datacite.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,7 @@
470470
"ISNI",
471471
"GRID",
472472
"Crossref Funder ID",
473+
"ROR",
473474
"Other"
474475
]
475476
}

osf_tests/metadata/expected_metadata_files/file_full.turtle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
dcterms:title "this is a project title!"@en ;
3030
dcterms:type <https://schema.datacite.org/meta/kernel-4/#Dataset> ;
3131
owl:sameAs <https://doi.org/10.70102/FK2osf.io/w2ibb> ;
32-
osf:funder <https://doi.org/10.$>,
33-
<https://doi.org/10.$$$$> ;
32+
osf:funder <https://doi.org/10.$$$$>,
33+
<https://ror.org/0example> ;
3434
osf:hasFunding <https://moneypockets.example/millions>,
3535
<https://moneypockets.example/millions-more> .
3636

@@ -63,8 +63,8 @@
6363
dcterms:identifier "https://doi.org/10.$$$$" ;
6464
foaf:name "Mx. Moneypockets" .
6565

66-
<https://doi.org/10.$> a dcterms:Agent ;
67-
dcterms:identifier "https://doi.org/10.$" ;
66+
<https://ror.org/0example> a dcterms:Agent ;
67+
dcterms:identifier "https://ror.org/0example" ;
6868
foaf:name "Caring Fan" .
6969

7070
<http://localhost:5000/w1ibb> a dcterms:Agent,

osf_tests/metadata/expected_metadata_files/preprint_full.turtle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@
5555
dcterms:title "this is a project title!"@en ;
5656
dcterms:type <https://schema.datacite.org/meta/kernel-4/#Dataset> ;
5757
owl:sameAs <https://doi.org/10.70102/FK2osf.io/w2ibb> ;
58-
osf:funder <https://doi.org/10.$>,
59-
<https://doi.org/10.$$$$> ;
58+
osf:funder <https://doi.org/10.$$$$>,
59+
<https://ror.org/0example> ;
6060
osf:hasFunding <https://moneypockets.example/millions>,
6161
<https://moneypockets.example/millions-more> .
6262

@@ -121,8 +121,8 @@
121121
dcterms:identifier "https://doi.org/10.$$$$" ;
122122
foaf:name "Mx. Moneypockets" .
123123

124-
<https://doi.org/10.$> a dcterms:Agent ;
125-
dcterms:identifier "https://doi.org/10.$" ;
124+
<https://ror.org/0example> a dcterms:Agent ;
125+
dcterms:identifier "https://ror.org/0example" ;
126126
foaf:name "Caring Fan" .
127127

128128
<http://localhost:8000/v2/subjects/subjwibbb> a skos:Concept ;

osf_tests/metadata/expected_metadata_files/project_full.datacite.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@
7474
},
7575
{
7676
"funderIdentifier": {
77-
"funderIdentifier": "https://doi.org/10.$",
78-
"funderIdentifierType": "Crossref Funder ID"
77+
"funderIdentifier": "https://ror.org/0example",
78+
"funderIdentifierType": "ROR"
7979
},
8080
"funderName": "Caring Fan"
8181
}

osf_tests/metadata/expected_metadata_files/project_full.datacite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
</fundingReference>
5151
<fundingReference>
5252
<funderName>Caring Fan</funderName>
53-
<funderIdentifier funderIdentifierType="Crossref Funder ID">https://doi.org/10.$</funderIdentifier>
53+
<funderIdentifier funderIdentifierType="ROR">https://ror.org/0example</funderIdentifier>
5454
</fundingReference>
5555
</fundingReferences>
5656
<relatedIdentifiers>

osf_tests/metadata/expected_metadata_files/project_full.turtle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
owl:sameAs <https://doi.org/10.70102/FK2osf.io/w2ibb> ;
2828
dcat:accessService <http://localhost:5000> ;
2929
osf:contains <http://localhost:5000/w3ibb> ;
30-
osf:funder <https://doi.org/10.$>,
31-
<https://doi.org/10.$$$$> ;
30+
osf:funder <https://doi.org/10.$$$$>,
31+
<https://ror.org/0example> ;
3232
osf:hasFunding <https://moneypockets.example/millions>,
3333
<https://moneypockets.example/millions-more> ;
3434
osf:hostingInstitution <https://cos.io/> ;
@@ -116,8 +116,8 @@
116116
dcterms:identifier "https://doi.org/10.$$$$" ;
117117
foaf:name "Mx. Moneypockets" .
118118

119-
<https://doi.org/10.$> a dcterms:Agent ;
120-
dcterms:identifier "https://doi.org/10.$" ;
119+
<https://ror.org/0example> a dcterms:Agent ;
120+
dcterms:identifier "https://ror.org/0example" ;
121121
foaf:name "Caring Fan" .
122122

123123
<http://localhost:5000/w1ibb> a dcterms:Agent,

osf_tests/metadata/expected_metadata_files/registration_full.turtle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@
4343
dcterms:title "this is a project title!"@en ;
4444
dcterms:type <https://schema.datacite.org/meta/kernel-4/#Dataset> ;
4545
owl:sameAs <https://doi.org/10.70102/FK2osf.io/w2ibb> ;
46-
osf:funder <https://doi.org/10.$>,
47-
<https://doi.org/10.$$$$> ;
46+
osf:funder <https://doi.org/10.$$$$>,
47+
<https://ror.org/0example> ;
4848
osf:hasFunding <https://moneypockets.example/millions>,
4949
<https://moneypockets.example/millions-more> .
5050

@@ -98,8 +98,8 @@
9898
dcterms:identifier "https://doi.org/10.$$$$" ;
9999
foaf:name "Mx. Moneypockets" .
100100

101-
<https://doi.org/10.$> a dcterms:Agent ;
102-
dcterms:identifier "https://doi.org/10.$" ;
101+
<https://ror.org/0example> a dcterms:Agent ;
102+
dcterms:identifier "https://ror.org/0example" ;
103103
foaf:name "Caring Fan" .
104104

105105
<http://localhost:5000/w1ibb> a dcterms:Agent,

osf_tests/metadata/test_osf_gathering.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -610,10 +610,16 @@ def test_gather_funding(self):
610610
'award_uri': 'https://nih.example/award',
611611
'award_number': '27',
612612
},
613+
{
614+
'funder_name': 'NSF',
615+
'funder_identifier': 'https://ror.org/021nxhr62',
616+
'funder_identifier_type': 'ROR',
617+
},
613618
]
614619
_bnode1 = rdflib.BNode()
615620
_award_uri = URIRef('https://nih.example/award')
616621
_funder_uri = URIRef('https://doi.org/10.fake/NIH')
622+
_ror_funder_uri = URIRef('https://ror.org/021nxhr62')
617623
assert_triples(osf_gathering.gather_funding(self.projectfocus), {
618624
(self.projectfocus.iri, OSF.funder, _bnode1),
619625
(_bnode1, RDF.type, DCTERMS.Agent),
@@ -628,6 +634,10 @@ def test_gather_funding(self):
628634
(_award_uri, DCTERMS.title, Literal('big fun')),
629635
(_award_uri, OSF.awardNumber, Literal('27')),
630636
(_award_uri, DCTERMS.contributor, _funder_uri),
637+
(self.projectfocus.iri, OSF.funder, _ror_funder_uri),
638+
(_ror_funder_uri, RDF.type, DCTERMS.Agent),
639+
(_ror_funder_uri, DCTERMS.identifier, Literal(_ror_funder_uri)),
640+
(_ror_funder_uri, FOAF.name, Literal('NSF')),
631641
})
632642
# focus: registration
633643
assert_triples(osf_gathering.gather_funding(self.registrationfocus), set())

osf_tests/metadata/test_serialized_metadata.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,10 @@ def _setUp_full(self):
328328
'award_number': '2000000',
329329
'award_uri': 'https://moneypockets.example/millions-more',
330330
'award_title': 'because reasons!',
331-
}, { # no award info, just a funder:
331+
}, { # no award info, just a funder with ROR identifier:
332332
'funder_name': 'Caring Fan',
333-
'funder_identifier': 'https://doi.org/10.$',
334-
'funder_identifier_type': 'Crossref Funder ID',
333+
'funder_identifier': 'https://ror.org/0example',
334+
'funder_identifier_type': 'ROR',
335335
'award_number': '',
336336
'award_uri': '',
337337
'award_title': '',

0 commit comments

Comments
 (0)