TranslatorSRI/Plater

Inefficient TRAPI

Closed this issue · 0 comments

I want to find all chemicals connected to a disease by 2 hops. If I run as a cypher query:

cypher={"query": "MATCH (n:`biolink:Disease` {id:'MONDO:0008078'})-[x]-(q0)-[x1]-(c:`biolink:ChemicalEntity`) RETURN *"}

It runs fine in a few minutes

But if I send the equivalent TRAPI

{
    "message": {
        "query_graph": {
            "nodes": {
                "disease": {
                    "ids": [
                        "MONDO:0008078"
                    ]
                },
                "nt_0": {
                    "categories": [
                        "biolink:NamedThing"
                    ]
                },
                "chemical": {
                    "categories": [
                        "biolink:ChemicalEntity"
                    ]
                }
            },
            "edges": {
                "edge_0": {
                    "subject": "disease",
                    "object": "nt_0"
                },
                "dedge": {
                    "subject": "nt_0",
                    "object": "chemical"
                }
            }
        }
    }
}

It never returns.