Skip to content

Commit

Permalink
Merge pull request #265 from ranking-agent/normalize_qgraph
Browse files Browse the repository at this point in the history
Normalize qgraph
  • Loading branch information
maximusunc authored Jul 24, 2024
2 parents 378aeda + fef706e commit 8ac5f31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 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.8.1
version: 2.8.2
tags:
- name: translator
- name: ARA
Expand Down
6 changes: 2 additions & 4 deletions src/service_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ async def lookup(message, params, guid, infer=False, caller="ARAGORN", answer_qn
:param caller:
:return:
"""

message = await normalize_qgraph_ids(message)
if caller == "ARAGORN":
return await aragorn_lookup(message, params, guid, infer, answer_qnode, bypass_cache)
elif caller == "ROBOKOP":
Expand Down Expand Up @@ -833,7 +833,7 @@ async def normalize_qgraph_ids(m):
for qid, qnode in qnodes.items():
if ("ids" in qnode) and (qnode["ids"] is not None):
qnode_ids.update(qnode["ids"])
nnp = { "curies": list(qnode_ids), "conflate": True }
nnp = { "curies": list(qnode_ids), "conflate": True, "drug_chemical_conflate": True }
async with httpx.AsyncClient(timeout=httpx.Timeout(timeout=120)) as client:
nnresult = await client.post(
url,
Expand All @@ -851,8 +851,6 @@ async def normalize_qgraph_ids(m):


async def robokop_lookup(message, params, guid, infer, question_qnode, answer_qnode) -> (dict, int):
# For robokop, gotta normalize
message = await normalize_qgraph_ids(message)
if not infer:
kg_url = os.environ.get("ROBOKOPKG_URL", "https://automat.renci.org/robokopkg/")
return await subservice_post("robokopkg", f"{kg_url}query", message, guid)
Expand Down

0 comments on commit 8ac5f31

Please sign in to comment.