mirror of
https://github.com/qurator-spk/modstool.git
synced 2025-08-07 00:29:55 +02:00
🧹 MODS: Filter UUID
This commit is contained in:
parent
c25de380b4
commit
feb8d09126
1 changed files with 4 additions and 0 deletions
|
@ -162,12 +162,16 @@ def mods_to_dict(mods, raise_errors=True):
|
||||||
.descend(raise_errors)
|
.descend(raise_errors)
|
||||||
)
|
)
|
||||||
elif tag == "{http://www.loc.gov/mods/v3}recordIdentifier":
|
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),
|
# By default we assume source="gbv-ppn" mods:recordIdentifiers (= PPNs),
|
||||||
# however, in mods:relatedItems, there may be source="dnb-ppns",
|
# however, in mods:relatedItems, there may be source="dnb-ppns",
|
||||||
# which we need to distinguish by using a separate field name.
|
# which we need to distinguish by using a separate field name.
|
||||||
try:
|
try:
|
||||||
value["recordIdentifier"] = (
|
value["recordIdentifier"] = (
|
||||||
TagGroup(tag, group)
|
TagGroup(tag, group)
|
||||||
|
.filter(no_uuid)
|
||||||
.is_singleton()
|
.is_singleton()
|
||||||
.has_attributes({"source": "gbv-ppn"})
|
.has_attributes({"source": "gbv-ppn"})
|
||||||
.text()
|
.text()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue