Closed tokebe closed 7 hours ago
Work on this will first require some example tables for testing, assigning @colleenXu to build these:
pathfinder
named pathfinder-newsystem
Example tables are now in pathfinder-newsystem
branch's data folder!
Note: I made these tables thinking of how to construct the existing Pathfinder MVP templates using templates 1 + 2, and not really 3.
Some things to account for @rjawesome @tokebe:
predicateTable.yaml
format: rather than a list of strings, we're using a list of dictionaries (only key used right now is predicate
). This should allow us to add qualifier-constraint sets to a predicate entry later if we want to. A few questions about the slides 1. Does this mean the edge should have no predicates (ie. "predicates": []) which would automatically make the query fail, or does this mean the edge should not have the predicates key (ie. basically have a predicate of "biolink:related_to")?
2 . If two adjacent nodes (ie. n0 & A) have multiple categories, then should all predicates from all category pairs be merged, or should a new query graph be generated for each category pair (with the predicates in a particular query graph determined by its category pair)?
3 (similar to 2). If n0 & A have multiple categories, then should all possible categories for node B be merged, or should a new query graph be generated for each category pair of n0 & A (with the categories for B in a particular query graph determined by its category pair)?
@rjawesome
After today's discussion with Jackson, we decided to drop "potential qualifier support" for now (it would maybe involve separate QGraph for a predicate+qualifier-set combo).
So I pushed a commit to adjust the predicateTable.yaml
format, making it simpler. Can you pull and adjust your code to account for this format change?
Done
(1) Lookup tables were adjusted right before Sept Translator Relay https://github.com/biothings/bte_trapi_query_graph_handler/pull/215.
(2) Hotfixes (direct commits) made during Sept Translator Relay to fix TRAPI validation errors for Pathfinder responses
Related changes deployed to Prod as of 11/13
Parent issue: #794
In order to better cover the space of possible pathfinder queries (in terms of pinned-node pairings), we need to revisit how Pathfinder acquires templates. Instead of manually-built TRAPI templates, we should instead generate templates on-the-fly based on the node categories presented in the pathfinder query.
Essentially, within the existing framework of the current prototype, we replace the "select templates" step as follows:
Assume two lookup tables:
These tables would be defined as yaml files (
categoryTable.yaml
andpredicateTable.yaml
) in the query_graph_handler data folder, with the following structure:These tables would then be used to generate templates as specified in these slides
At which point behavior returns to the current implementation of the prototype, with one exception:
When generating final results from the existing template results (see parent issue, current prototype), skip constructing a result for any intermediate node which is not equal to or a descendant of the unpinned node category (as a computational shortcut, if the unpinned node category is
biolink:NamedThing
, then no need to check, just proceed with making the result).