diff --git a/src/mods4pandas/mods4pandas.py b/src/mods4pandas/mods4pandas.py index 5a05cc3..fa18c18 100755 --- a/src/mods4pandas/mods4pandas.py +++ b/src/mods4pandas/mods4pandas.py @@ -162,12 +162,16 @@ def mods_to_dict(mods, raise_errors=True): .descend(raise_errors) ) elif tag == "{http://www.loc.gov/mods/v3}recordIdentifier": + def no_uuid(record_identifier): + return record_identifier.attrib.get("type") != "uuid" + # By default we assume source="gbv-ppn" mods:recordIdentifiers (= PPNs), # however, in mods:relatedItems, there may be source="dnb-ppns", # which we need to distinguish by using a separate field name. try: value["recordIdentifier"] = ( TagGroup(tag, group) + .filter(no_uuid) .is_singleton() .has_attributes({"source": "gbv-ppn"}) .text()