mirror of https://gitlab.com/bashrc2/epicyon
Obtain person for attributedTo
parent
f447293436
commit
be4795f5c4
9
utils.py
9
utils.py
|
@ -52,6 +52,15 @@ def get_attributed_to(field) -> str:
|
|||
if isinstance(field, str):
|
||||
return field
|
||||
elif isinstance(field, list):
|
||||
for attrib in field:
|
||||
if isinstance(attrib, dict):
|
||||
if attrib.get('type') and attrib.get('id'):
|
||||
if isinstance(attrib['type'], str) and \
|
||||
isinstance(attrib['id'], str):
|
||||
if attrib['type'] == 'Person' and \
|
||||
'://' in attrib['id'] and \
|
||||
'.' in attrib['id']:
|
||||
return attrib['id']
|
||||
if isinstance(field[0], str):
|
||||
return field[0]
|
||||
return None
|
||||
|
|
Loading…
Reference in New Issue