Commit bb9dfa6c authored by Alessandro CERIONI's avatar Alessandro CERIONI
Browse files

Splitting organisation and individual name for Dublin Core metadata

parent 74dbf6bf
......@@ -89,13 +89,20 @@ def list_to_dictlist( the_input, the_context=None ):
if the_context == 'responsibleParty':
try:
# the following applies to legacy metadata
parent_organisation, child_organisation = out_item['organisationName'].split('/')
parent_organisation = parent_organisation.strip()
child_organisation = child_organisation.strip()
except:
parent_organisation, child_organisation = out_item['organisationName'], None
parent_organisation = parent_organisation.strip()
child_organisation = None
try:
# the following applies to Dublin Core metadata
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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment