NCATS-Gamma / robokop

Master UI for ROBOKOP
MIT License
15 stars 3 forks source link

named node query failing #499

Closed cbizon closed 4 years ago

cbizon commented 4 years ago

https://robokop.renci.org/q/640cba17-8e22-4766-967c-6208882b0b23/

This is a query that just goes (HGNC:11396)--(namedthing)--(namedthing)--(MONDO:0007179).

There are many such paths in the database, but this query returns nothing.

patrickkwang commented 4 years ago

Weird. This resolves into the following Cypher query:

MATCH (n0:gene {})-[e0]-(n1:named_thing {})
USING INDEX n0:gene(id) WHERE (n0.id = 'HGNC:11396')
MATCH (n1)-[e1]-(n2:named_thing {})
MATCH (n2)-[e2]-(n3:disease_or_phenotypic_feature {})
USING INDEX n3:disease_or_phenotypic_feature(id) WHERE (n3.id = 'MONDO:0007179')
WITH n0.id as n0, n1.id as n1, n2.id as n2, n3.id as n3, collect(distinct e0.id) as e0, collect(distinct e1.id) as e1, collect(distinct e2.id) as e2
RETURN {n0:n0, n1:n1, n2:n2, n3:n3} as nodes, {e0:e0, e1:e1, e2:e2} as edges

which returns results in a pretty reasonable time. Possibly it's getting jammed up downstream and not reporting the error nicely?

cbizon commented 4 years ago

Can't tell if it's related to this run or not, but this is in messenger:

[2020-02-24 17:17:49,518: ERROR/messenger.server(MainProcess)]: Exception on /yank [POST]
    raise RuntimeError(f'Went looking for {len(batch)} edges but only found {len(edge_ids)}; could not find {set(batch) - set(edge_ids)}')
RuntimeError: Went looking for 1024 edges but only found 1023; could not find {'c83ecd0b5bd78bc54f7dba3ccfd86268'}
patrickkwang commented 4 years ago

That's it. This edge that couldn't be found is of type 'Unmapped_Relation', which was not indexed. I've updated the index to include that type, so the question might work now.

cbizon commented 4 years ago

OK, this fixed it. Thanks!