ranking-agent/strider

Subclass handling difficulties

cbizon opened this issue · 1 comments

When a KP has information about a subclass, it returns it. Currently, dev strider is doing some odd things:

Test query:

{
    "message": {
        "query_graph": {
            "edges": {
                "e00": {
                    "subject": "chemical",
                    "object": "enrich_nodes",
                    "predicates": [
                        "biolink:has_adverse_event"
                    ]
                }
            },
            "nodes": {
                "chemical": {
                    "categories": [
                        "biolink:ChemicalEntity"
                    ]
                },
                "enrich_nodes": {
                    "ids": [
                        "HP:0001649"
                    ],
                    "categories": [
                        "biolink:NamedThing"
                    ]
                }
            }
        }
    },
    "workflow": [
        {
            "id": "lookup"
        }
    ]
}

Example result:

{
    "node_bindings": {
        "enrich_nodes": [
            {
                "id": "HP:0004755",
                "query_id": null,
                "attributes": null
            },
            {
                "id": "HP:0001649",
                "query_id": null,
                "attributes": null
            },
            {
                "id": "MONDO:0005477",
                "query_id": null,
                "attributes": null
            },
            {
                "id": "HP:0006688",
                "query_id": null,
                "attributes": null
            }
        ],
        "chemical": [
            {
                "id": "PUBCHEM.COMPOUND:1983",
                "query_id": null,
                "attributes": null
            }
        ]
    },
    "edge_bindings": {
        "e00": [
            {
                "id": "eaf304228027",
                "attributes": null
            },
            {
                "id": "74963d4d8451",
                "attributes": null
            },
            {
                "id": "bb883ccb0ef9",
                "attributes": null
            },
            {
                "id": "d72ec6cdce28",
                "attributes": null
            }
        ]
    },
    "score": null
}
  1. All the subclasses are merged into a single result when they hit the same chemicals. I think that this is incorrect; universal binding should dictate that these are all individual answers.
  2. in the cases where the subclass is bound to the qnode, the query_id should be "enrich_nodes" not null