Conversation
|
@rjawesome Reviewed&tested and everything looks good. Hoping to get to dev today/monday. Regarding your comment about node constraints possibly behaving weirdly with subclassing, could you explain what ambiguities arise? |
|
@tokebe ie. if a result contains the edge |
|
Thanks! I think that'll probably be fine for now, since the majority of things being constrained on would be represented in |
|
@tokebe This PR should be good to go, with merge conflicts fixed, as well as working properly with subclassing. |
biothings/biothings_explorer#795
Note: for subclass edges, the constraint is applied to the underlying edge. Ie. if a subclass edge represents A--treats-->B--subclass-->C then the constraints are applied to the A->B edge (and A/B nodes).
Example Query:
{ "message": { "query_graph": { "edges": { "e0": { "predicates": [ "biolink:treats" ], "subject": "n0", "object": "n1", "attribute_constraints": [ { "name": "evidence_count_constraint", "id": "biolink:evidence_count", "operator": ">", "value": 30 } ] } }, "nodes": { "n0": { "categories": [ "biolink:ChemicalEntity" ], "constraints": [ { "name": "syn", "id": "biolink:synonym", "operator": "matches", "value": ".*MG.*" }, { "name": "xr", "id": "biolink:xref", "operator": "matches", "value": "DrugCentral:1.*" } ] }, "n1": { "categories": [ "biolink:DiseaseOrPhenotypicFeature" ], "ids": ["MONDO:0002050"] } } } } }