Skip to content

Commit

Permalink
Absence of personal identifier caused problems for datacite metadataP…
Browse files Browse the repository at this point in the history
…refix.

Co-authored-by: Harm de Raaff <[email protected]>
  • Loading branch information
2 people authored and stsnel committed Feb 19, 2024
1 parent 524d5af commit 21c4a45
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions moai/metadata/datacite.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,11 @@ def __call__(self, element, metadata):
if not isinstance(idf_list, list):
idf_list = [idf_list]
for identifier in idf_list:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
creator.append(nameIdf)
if 'Name_Identifier' in identifier:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
if 'Name_Identifier_Scheme' in identifier:
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
creator.append(nameIdf)

creators.append(creator)
datacite.append(creators)
Expand Down Expand Up @@ -214,9 +216,11 @@ def __call__(self, element, metadata):
if not isinstance(idf_list, list):
idf_list = [idf_list]
for identifier in idf_list:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
contributor.append(nameIdf)
if 'Name_Identifier' in identifier:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
if 'Name_Identifier_Scheme' in identifier:
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
contributor.append(nameIdf)

contributors.append(contributor)

Expand All @@ -242,9 +246,12 @@ def __call__(self, element, metadata):
if not isinstance(idf_list, list):
idf_list = [idf_list]
for identifier in idf_list:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
contributor.append(nameIdf)

if 'Name_Identifier' in identifier:
nameIdf = NONE.nameIdentifier(identifier['Name_Identifier'])
if 'Name_Identifier_Scheme' in identifier:
nameIdf.attrib['nameIdentifierScheme'] = identifier['Name_Identifier_Scheme']
contributor.append(nameIdf)

contributors.append(contributor)
except KeyError:
Expand Down

0 comments on commit 21c4a45

Please sign in to comment.