diff --git a/eossr/metadata/codemeta2zenodo.py b/eossr/metadata/codemeta2zenodo.py index 8771f1a84f017511b0a133b6b15127066cc9a46c..4233e338b14e7ae57ad648301455531090b9ca9e 100644 --- a/eossr/metadata/codemeta2zenodo.py +++ b/eossr/metadata/codemeta2zenodo.py @@ -47,12 +47,11 @@ def parse_person_schema_property(person_property, contributor_field): # author ID in CodeMeta can be anything, not only ORCID # if format is 0000-0000-0000-0000, it is assumed to be an ORCID - if "identifier" in person_property and ( - "orcid.org/" in person_property["identifier"] - or re.match(r'^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]$', person_property["identifier"]) + if "@id" in person_property and ( + "orcid.org/" in person_property["@id"] or re.match(r'^\d{4}-\d{4}-\d{4}-\d{3}[0-9X]$', person_property["@id"]) ): # reformat "https://orcid.org/0000-0002-5686-2078" to "0000-0002-5686-2078" - zenodo_person['orcid'] = person_property["identifier"].split('orcid.org/')[-1] + zenodo_person['orcid'] = person_property["@id"].split('orcid.org/')[-1] if "affiliation" in person_property: zenodo_person['affiliation'] = person_property['affiliation']['name'] diff --git a/eossr/metadata/tests/samples/codemeta_contributors_sample.json b/eossr/metadata/tests/samples/codemeta_contributors_sample.json index f220cfd84f14b9587c36129e2a6bc532c89c7ffd..6a27134359b673f93e613a31515a1b69aec20393 100644 --- a/eossr/metadata/tests/samples/codemeta_contributors_sample.json +++ b/eossr/metadata/tests/samples/codemeta_contributors_sample.json @@ -13,7 +13,7 @@ "name": "Author-and-Creator-same-person-affiliation" }, "email": "Author-and-Creator-same-person-email", - "identifier": "Author-and-Creator-same-person-identifier" + "@id": "Author-and-Creator-same-person-identifier" } ], "creator": { @@ -25,7 +25,7 @@ "name": "Author-and-Creator-same-person-affiliation" }, "email": "Author-and-Creator-same-person-email", - "identifier": "Author-and-Creator-same-person-identifier" + "@id": "Author-and-Creator-same-person-identifier" }, "maintainer": { "@type": "Person", @@ -35,7 +35,7 @@ "@type": "Organization", "name": "Maintainer-affiliation" }, - "identifier": "https://orcid.org/0000-0000-0000-0000" + "@id": "https://orcid.org/0000-0000-0000-0000" }, "contributor": [ {