-
Notifications
You must be signed in to change notification settings - Fork 3
Home
Jason Reilly edited this page Mar 18, 2024
·
47 revisions
Welcome to the CQS wiki!
The Curated Query Service is a Rust based RESTful web application. There are 2 primary endpoints for submitting TRAPI queries:
- /query
- /asyncquery
These endpoints expect to receive a TRAPI Query that contain both an Edge with a "biolink:treats" predicate & a "knowledge_type" of "inferred".
{
"message": {
"query_graph": {
"nodes": {
"n0": {"categories": ["biolink:ChemicalEntity"]},
"n1": {"ids": ["MONDO:0009061"]}
},
"edges": {
"e0": {"subject": "n0", "object": "n1", "predicates": ["biolink:treats"], "knowledge_type": "inferred"}
}
}
}
}
In the above example, the "n1" Node contains an array of CURIE identifiers related to a Disease. Remember that the relevant question being asked here is "What drugs treat disease X?"
If an TRAPI Query input does NOT meet the 2 conditions, then the CQS will return the input as is, with no further action undertaken. However, if the TRAPI Query input DOES meet the criteria for further processing, then the following will occur:
- The "disease" identifiers will be extracted & used to populate more elaborate, curated TRAPI Query templates.
- Each curated TRAPI Query template will be sent to the Workflow Runner asynchronously.
- Each received Response from the Workflow Runner undergoes a number of further transformations. These include:
- Transform the Results such that a new Result is added where CQS is the Primary Knowledge Source and Auxiliary (Support) Graphs are added, preserving the Results from each curated TRAPI Query template Response from the Workflow Runner.
- Then merge the Responses.
- Then the Results are grouped using like NodeBinding identifiers.
- Then Analysis scores within each Result are sorted (descending order).
- Finally, each Result is sorted by the max Analysis score (descending order).
- Finally, the transformed Response is returned.