Skip to content
Snippets Groups Projects
Commit 9552a9ed authored by Swen Vermeul's avatar Swen Vermeul
Browse files

added extract_attr to return any attribute

parent 5a50ec42
No related branches found
No related tags found
No related merge requests found
...@@ -18,7 +18,7 @@ def parse_jackson(input_json): ...@@ -18,7 +18,7 @@ def parse_jackson(input_json):
interesting=['tags', 'registrator', 'modifier', 'owner', 'type', 'parents', interesting=['tags', 'registrator', 'modifier', 'owner', 'type', 'parents',
'children', 'containers', 'properties', 'experiment', 'sample', 'children', 'containers', 'properties', 'experiment', 'sample',
'project', 'space', 'propertyType', 'entityType', 'propertyType', 'propertyAssignment', 'project', 'space', 'propertyType', 'entityType', 'propertyType', 'propertyAssignment',
'externalDms', 'roleAssignments', 'user', 'authorizationGroup' 'externalDms', 'roleAssignments', 'user', 'authorizationGroup', 'vocabulary'
] ]
found = {} found = {}
def build_cache(graph): def build_cache(graph):
...@@ -152,6 +152,15 @@ def extract_deletion(obj): ...@@ -152,6 +152,15 @@ def extract_deletion(obj):
return del_objs return del_objs
def extract_attr(attr):
def attr(obj):
if isinstance(obj, dict):
return obj.get(attr, '')
else:
return str(obj)
return attr
def extract_identifier(ident): def extract_identifier(ident):
if not isinstance(ident, dict): if not isinstance(ident, dict):
return str(ident) return str(ident)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment