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
lwesterhof and HarmdR authored Apr 21, 2023
1 parent 9330d1a commit 04a4413
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 @@ -98,9 +98,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 @@ -235,9 +237,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 Down Expand Up @@ -270,9 +274,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 04a4413

Please sign in to comment.