NCATSTranslator / ReasonerAPI

NCATS Biomedical Translator Reasoners Standard API
33 stars 28 forks source link

Main README example TRAPI Query needs updating #436

Open RichardBruskiewich opened 1 year ago

RichardBruskiewich commented 1 year ago

Just a placeholder issue pointing out the fact that the main repository README needs updating to TRAPI 1.4. This may just mean transferring some of the examples from the implementation guidelines into the root README.

For example, extending the entire example to be closer to 1.4 spec (i.e. with addition (i.e. "auxiliary_graphs") and restructuring (results.edge_bindings moved into "analyses").

Roughed in (not totally right for sure...):

{
  "response": {
    "message": {
    "query_graph": {
        "nodes": {
            "type-2 diabetes": {"ids": ["MONDO:0005148"]},
            "drug": {"categories": ["biolink:Drug"]}
        },
        "edges": {
            "treats": {"subject": "drug", "predicates": ["biolink:treats"], "object": "type-2 diabetes"}
        }
    },
    "knowledge_graph": {
        "nodes": {
            "MONDO:0005148": {"name": "type-2 diabetes"},
            "CHEBI:6801": {"name": "metformin", "categories": ["biolink:Drug"]}
        },
        "edges": {
            "df87ff82": {"subject": "CHEBI:6801", "predicate": "biolink:treats", "object": "MONDO:0005148", "sources": [{"resource_id": "infores:molepro", "resource_role": "primary_knowledge_source"}]}
        }
    },
    "auxiliary_graphs": {
        "a0": {
            "edges": [
                "e02",
                "e12"
            ]
        },
        "a1": {
            "edges": [
                "extra_edge0"
            ]
        },
        "a2": {
            "edges": [
                "extra_edge1"
            ]
        }
    },
    "results": [
        {
            "node_bindings": {
                "type-2 diabetes": [{"id": "MONDO:0005148"}],
                "drug": [{"id": "CHEBI:6801"}]
            },
            "analyses":[
                {
                    "resource_id": "infores:ara0",
                    "edge_bindings": {"treats": [{"id": "df87ff82"}]},
                    "support_graphs": [],
                    "score": 0.7
                }
            ]
        }
    ]
}
  }
}
edeutsch commented 1 year ago

Looking for volunteers?