From 93ce1505c45090d75969f2af141a7d51d7f1dfa6 Mon Sep 17 00:00:00 2001 From: "Gerber, Mike" Date: Thu, 31 Mar 2022 18:57:35 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Handle=20namePart=20+=20nameIdentif?= =?UTF-8?q?ier?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- qurator/modstool/modstool.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/qurator/modstool/modstool.py b/qurator/modstool/modstool.py index eecc5b8..bae82ea 100755 --- a/qurator/modstool/modstool.py +++ b/qurator/modstool/modstool.py @@ -330,6 +330,14 @@ def mods_to_dict(mods, raise_errors=True): .is_singleton().has_attributes({'authority': 'marcrelator', 'type': 'code'}) \ .text() elif tag == '{http://www.loc.gov/mods/v3}namePart': + for e in group: + if not e.attrib.get('type'): + value['namePart'] = e.text + else: + value['namePart-{}'.format(e.attrib['type'])] = e.text + elif tag == '{http://www.loc.gov/mods/v3}nameIdentifier': + # TODO Use this (e.g. 106168096) or the + # mods:name@valueURI to disambiguate pass elif tag == '{http://www.loc.gov/mods/v3}displayForm': value['displayForm'] = TagGroup(tag, group).is_singleton().has_no_attributes().text()