Skip to content

Commit

Permalink
Fixed bugs caused by empty messages
Browse files Browse the repository at this point in the history
  • Loading branch information
cbizon committed Jul 7, 2023
1 parent 1b558d5 commit 0539154
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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.12
version: 2.4.13
tags:
- name: translator
- name: ARA
Expand Down
4 changes: 2 additions & 2 deletions src/service_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ async def add_provenance(message):
each knowledge_graph edge and add an aggregated knowledge source of infores:robokop to it"""
new_provenance = {"resource_id": "infores:robokop", "resource_role": "aggregator_knowledge_source",
"upstream_resource_ids": ["infores:automat-robokop"]}
for edge in message["message"]["knowledge_graph"]["edges"].values():
for edge in message["message"].get("knowledge_graph",{}).get("edges",{}).values():
edge["sources"].append(new_provenance)
return message

Expand Down Expand Up @@ -984,7 +984,7 @@ async def combine_messages(answer_qnode, original_query_graph, lookup_query_grap
result["message"]["knowledge_graph"] = pydantic_kgraph.dict()
for rm in result_messages:
if "auxiliary_graphs" in result["message"]:
result["message"]["auxiliary_graphs"].update(rm["message"]["auxiliary_graphs"])
result["message"]["auxiliary_graphs"].update(rm["message"].get("auxiliary_graphs", {}))
# The result with the direct lookup needs to be handled specially. It's the one with the lookup query graph
lookup_results = [] # in case we don't have any
for result_message in result_messages:
Expand Down

0 comments on commit 0539154

Please sign in to comment.