Skip to content

Commit

Permalink
updated prov to version 2.0.1. Modified neo4j query to return only ce…
Browse files Browse the repository at this point in the history
…rtain fields for get_provenance, particularly omitting expensive ones like files and metadata
  • Loading branch information
DerekFurstPitt committed Jan 7, 2025
1 parent 9b09926 commit cbfde4b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/app_neo4j_queries.py
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,13 @@ def get_provenance(neo4j_driver, uuid, depth):
f"WHERE n.uuid = '{uuid}' "
f"CALL apoc.path.subgraphAll(n, {{ {max_level_str} relationshipFilter:'<ACTIVITY_INPUT|<ACTIVITY_OUTPUT', labelFilter:'-Lab' }}) "
f"YIELD nodes, relationships "
f"WITH [node in nodes | node {{ .*, label:labels(node)[0] }} ] as nodes, "
f"WITH [node in nodes | "
f" CASE "
f" WHEN 'Activity' IN labels(node) THEN node {{ created_by_user_displayname: node.created_by_user_displayname, created_by_user_sub: node.created_by_user_sub, created_by_user_email: node.created_by_user_email, creation_action: node.creation_action, uuid: node.uuid, status: node.status, created_timestamp: node.created_timestamp, label: labels(node)[0] }} "
f" WHEN 'Entity' IN labels(node) THEN node {{ group_uuid: node.group_uuid, created_by_user_displayname: node.created_by_user_displayname, created_by_user_sub: node.created_by_user_sub, created_by_user_email: node.created_by_user_email, uuid: node.uuid, dataset_type: node.dataset_type, hubmap_id: node.hubmap_id, entity_type: node.entity_type, status: node.status, created_timestamp: node.created_timestamp, label: labels(node)[0] }} "
f" ELSE node {{ label: labels(node)[0] }} "
f" END "
f"] as nodes, "
f"[rel in relationships | rel {{ .*, fromNode: {{ label:labels(startNode(rel))[0], uuid:startNode(rel).uuid }}, toNode: {{ label:labels(endNode(rel))[0], uuid:endNode(rel).uuid }}, rel_data: {{ type: type(rel) }} }} ] as rels "
f"WITH {{ nodes:nodes, relationships:rels }} as json "
f"RETURN json")
Expand Down
2 changes: 1 addition & 1 deletion src/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Flask==3.0.3
neo4j==5.20.0
prov==2.0.0
prov==2.0.1
Werkzeug==3.0.3
deepdiff==7.0.1

Expand Down

0 comments on commit cbfde4b

Please sign in to comment.