Skip to content

Commit 21090b2

Browse files
authored
fix: file dataset metadata with mononym creators (#11297)
1 parent 7a90a68 commit 21090b2

18 files changed

Lines changed: 44 additions & 44 deletions

osf/metadata/serializers/google_dataset_json_ld.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ def format_creators(basket):
7979
for creator_iri in basket[DCTERMS.creator]:
8080
creator_data.append({
8181
'@type': 'Person',
82-
'name': next(basket[creator_iri:FOAF.name]),
83-
'givenName': next(basket[creator_iri:FOAF.givenName]),
84-
'familyName': next(basket[creator_iri:FOAF.familyName]),
82+
'name': next(basket[creator_iri:FOAF.name], None),
83+
'givenName': next(basket[creator_iri:FOAF.givenName], None),
84+
'familyName': next(basket[creator_iri:FOAF.familyName], None),
8585
})
8686
return creator_data
8787

osf_tests/metadata/expected_metadata_files/file_basic.datacite.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"creators": [
2222
{
2323
"creatorName": {
24-
"creatorName": "Person McNamington",
24+
"creatorName": "PersonMcNamington",
2525
"nameType": "Personal"
2626
},
2727
"nameIdentifier": {
@@ -83,4 +83,4 @@
8383
"title": "my-file.blarg"
8484
}
8585
]
86-
}
86+
}

osf_tests/metadata/expected_metadata_files/file_basic.datacite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<identifier identifierType="URL">http://localhost:5000/w3ibb</identifier>
44
<creators>
55
<creator>
6-
<creatorName nameType="Personal">Person McNamington</creatorName>
6+
<creatorName nameType="Personal">PersonMcNamington</creatorName>
77
<nameIdentifier nameIdentifierScheme="URL">http://localhost:5000/w1ibb</nameIdentifier>
88
</creator>
99
</creators>

osf_tests/metadata/expected_metadata_files/file_basic.turtle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,8 @@
4141
<http://localhost:5000/w1ibb> a dcterms:Agent,
4242
foaf:Person ;
4343
dcterms:identifier "http://localhost:5000/w1ibb" ;
44-
foaf:givenName "Person" ;
45-
foaf:familyName "McNamington" ;
46-
foaf:name "Person McNamington" .
44+
foaf:givenName "PersonMcNamington" ;
45+
foaf:name "PersonMcNamington" .
4746

4847
<http://localhost:5000> a dcterms:Agent,
4948
foaf:Organization ;

osf_tests/metadata/expected_metadata_files/preprint_basic.datacite.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"creators": [
2222
{
2323
"creatorName": {
24-
"creatorName": "Person McNamington",
24+
"creatorName": "PersonMcNamington",
2525
"nameType": "Personal"
2626
},
2727
"nameIdentifier": {
@@ -120,4 +120,4 @@
120120
"title": "this is a preprint title!"
121121
}
122122
]
123-
}
123+
}

osf_tests/metadata/expected_metadata_files/preprint_basic.datacite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<identifier identifierType="DOI">11.pp/FK2osf.io/w4ibb_v1</identifier>
44
<creators>
55
<creator>
6-
<creatorName nameType="Personal">Person McNamington</creatorName>
6+
<creatorName nameType="Personal">PersonMcNamington</creatorName>
77
<nameIdentifier nameIdentifierScheme="URL">http://localhost:5000/w1ibb</nameIdentifier>
88
</creator>
99
</creators>

osf_tests/metadata/expected_metadata_files/preprint_basic.google-dataset.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
"creator": [
55
{
66
"@type": "Person",
7-
"familyName": "McNamington",
8-
"givenName": "Person",
9-
"name": "Person McNamington"
7+
"familyName": null,
8+
"givenName": "PersonMcNamington",
9+
"name": "PersonMcNamington"
1010
}
1111
],
1212
"dateCreated": "2123-05-04",
@@ -24,4 +24,4 @@
2424
"name": "Center For Open Science"
2525
},
2626
"url": "http://localhost:5000/w4ibb"
27-
}
27+
}

osf_tests/metadata/expected_metadata_files/preprint_basic.turtle

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,8 @@
7575
<http://localhost:5000/w1ibb> a dcterms:Agent,
7676
foaf:Person ;
7777
dcterms:identifier "http://localhost:5000/w1ibb" ;
78-
foaf:givenName "Person" ;
79-
foaf:familyName "McNamington" ;
80-
foaf:name "Person McNamington" .
78+
foaf:givenName "PersonMcNamington" ;
79+
foaf:name "PersonMcNamington" .
8180

8281
<http://localhost:8000/v2/providers/preprints/preprovi/subjects/> a skos:ConceptScheme ;
8382
dcterms:title "preprovi" .

osf_tests/metadata/expected_metadata_files/project_basic.datacite.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"creators": [
2222
{
2323
"creatorName": {
24-
"creatorName": "Person McNamington",
24+
"creatorName": "PersonMcNamington",
2525
"nameType": "Personal"
2626
},
2727
"nameIdentifier": {
@@ -118,4 +118,4 @@
118118
"title": "this is a project title!"
119119
}
120120
]
121-
}
121+
}

osf_tests/metadata/expected_metadata_files/project_basic.datacite.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<identifier identifierType="DOI">10.70102/FK2osf.io/w2ibb</identifier>
44
<creators>
55
<creator>
6-
<creatorName nameType="Personal">Person McNamington</creatorName>
6+
<creatorName nameType="Personal">PersonMcNamington</creatorName>
77
<nameIdentifier nameIdentifierScheme="URL">http://localhost:5000/w1ibb</nameIdentifier>
88
</creator>
99
</creators>

0 commit comments

Comments
 (0)