ranking-agent / strider

A TRAPI-compliant component of ARAGORN that queries distributed KPs and assembles answers to user questions.
MIT License
3 stars 0 forks source link

Killer 2 hop #365

Closed cbizon closed 2 years ago

cbizon commented 2 years ago

This one hop:

{"message": 
{
    "query_graph": {
        "edges": {
            "e01": {
                "object": "n2",
                "subject": "n1"
                }
        },
        "nodes": {
            "n1": {
                "ids": [
                "MONDO:0020747"
                ],
            },
            "n2": {
                "categories": [
                "biolink:NamedThing"
                ]
            }
        }
    }
}}

Finishes, returning 288 results in 20 seconds

This 1 hop finishes:

{"message": 
{
    "query_graph": {
        "edges": {
            "e02": {
                "object": "n2",
                "subject": "n3"
            }
        },
        "nodes": {
            "n2": {
                "categories": [
                "biolink:NamedThing"
                ]
            },
            "n3": {
                "ids": ["MONDO:0100096"]
            }
        }
    }
}}

Returns 1620 results in 1:22.

Combining the two one-hops into a pinned two-hop:

{"message": 
{
    "query_graph": {
        "edges": {
            "e01": {
                "object": "n2",
                "subject": "n1"
                },
            "e02": {
                "object": "n2",
                "subject": "n3"
            }
        },
        "nodes": {
            "n1": {
                "ids": [
                "MONDO:0008863"
                ],
            },
            "n2": {
                "categories": [
                "biolink:NamedThing"
                ]
            },
            "n3": {
                "ids": ["MONDO:0100096"]
            }
        }
    }
}}

Runs for over 10 minutes. I believe it would run longer based on other tests, but I have not tested this exact query longer than 10m.

maximusunc commented 2 years ago

Fixed in #371.