Skip to content
Snippets Groups Projects
Commit bb9dfa6c authored by Alessandro Cerioni's avatar Alessandro Cerioni
Browse files

Splitting organisation and individual name for Dublin Core metadata

parent 74dbf6bf
No related branches found
No related tags found
No related merge requests found
...@@ -89,13 +89,20 @@ def list_to_dictlist( the_input, the_context=None ): ...@@ -89,13 +89,20 @@ def list_to_dictlist( the_input, the_context=None ):
if the_context == 'responsibleParty': if the_context == 'responsibleParty':
try: try:
# the following applies to legacy metadata
parent_organisation, child_organisation = out_item['organisationName'].split('/') parent_organisation, child_organisation = out_item['organisationName'].split('/')
parent_organisation = parent_organisation.strip() parent_organisation = parent_organisation.strip()
child_organisation = child_organisation.strip() child_organisation = child_organisation.strip()
except: except:
parent_organisation, child_organisation = out_item['organisationName'], None try:
parent_organisation = parent_organisation.strip() # the following applies to Dublin Core metadata
child_organisation = None my_re = re.compile(r"(?P<organisationName>[^\(\)]+)(\((?P<individualName>.*)\))")
parent_organisation = my_re.match(out_item['organisationName']).groupdict()['organisationName'].strip()
child_organisation = my_re.match(out_item['organisationName']).groupdict()['individualName'].strip()
except:
parent_organisation, child_organisation = out_item['organisationName'], None
parent_organisation = parent_organisation.strip()
child_organisation = None
out_item['organisationName'] = parent_organisation out_item['organisationName'] = parent_organisation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment