ranking-agent / AnswerCoalesce

A TRAPI-compliant component of ARAGORN that groups together similar results.
MIT License
2 stars 0 forks source link

AC 500 #105

Closed cbizon closed 2 years ago

cbizon commented 2 years ago

Given this question:

{
    "message": {
        "query_graph": {
            "edges": {
                "e00": {
                    "subject": "n01",
                    "object": "porphyria"
                }
            },
            "nodes": {
                "porphyria": 
                    "ids": [
                        "MONDO:0037939"
                    ]
                },
                "n01": {
                    "categories": [
                        "biolink:NamedThing"
                    ]
                }
            }
        }
    }
}

Strider produces about 2k results, and AC throws a 500. If you add a category to the porphyria node, AC works.

What happens: first we look for opportunities. The mental assumption is that all of the input answers will be onehops with MONDO:0037939 on one end. So the opportunities will be groupings at n01.

However, because there are subclasses of porphyria, you can also have the porphyria node as the merged node (porphyria merged with its subclassses). This is fine, but the opportunity selector is looking at the qgraph to get the type and there's not one for this node. So at some point somebody does something with a None and 500.

To fix: the opportunity finder needs to recognize that it didn't get a type and do something smarter. I think either reject that opportunity (probably the best) or dig around in the KG to get a type for the id.

cbizon commented 2 years ago

The work around is to always put a category even on a node with ids.