Skip to content

Commit

Permalink
add qualifiers to creative edge
Browse files Browse the repository at this point in the history
  • Loading branch information
cbizon committed Jul 14, 2023
1 parent 9ff3e4f commit 0cbfd38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion openapi-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ servers:
# url: http://127.0.0.1:5000
termsOfService: http://robokop.renci.org:7055/tos?service_long=ARAGORN&provider_long=RENCI
title: ARAGORN
version: 2.4.15
version: 2.4.16
tags:
- name: translator
- name: ARA
Expand Down
6 changes: 6 additions & 0 deletions src/service_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,10 @@ def add_knowledge_edge(result_message, aux_graph_ids, answer):
qnode_subject = answer
qnode_object = query_graph["nodes"][qnode_object_id]["ids"][0]
predicate = qedge["predicates"][0]
if "qualifier_constraints" in qedge:
qualifiers = qedge["qualifier_constraints"][0]["qualifier_set"]
else:
qualifiers = None
# Create a new knowledge edge
new_edge_id = str(uuid.uuid4())
new_edge = {
Expand All @@ -766,6 +770,8 @@ def add_knowledge_edge(result_message, aux_graph_ids, answer):
# Aragorn is the primary ks because aragorn inferred the existence of this edge.
"sources": [{"resource_id":"infores:aragorn", "resource_role":"primary_knowledge_source"}]
}
if qualifiers is not None:
new_edge["qualifiers"] = qualifiers
result_message["message"]["knowledge_graph"]["edges"][new_edge_id] = new_edge
return new_edge_id

Expand Down

0 comments on commit 0cbfd38

Please sign in to comment.