Skip to content
Amy Glen edited this page Nov 15, 2024 · 40 revisions

RTX-KG2 Knowledge Provider Wiki Page

Back to Home

RTX-KG2 is a Translator System Knowledge Provider created/supported/maintained by Team Expander Agent. RTX-KG2 can answer Translator queries that are expressed in the JSON-based Translator Reasoner API (TRAPI) format, with query graphs that contain one node or two nodes connected by an edge (i.e., a "one-hop" query). RTX-KG2 is backed by the RTX-KG2c knowledge graph, which integrates dozens of upstream knowledge sources into a Biolink-compliant system hosted in a custom in-memory database called PloverDB. For technical information about the RTX-KG2c knowledge graph and how we build it, see the RTX-KG2 build system GitHub project area. For more information about Plover, see the PloverDB GitHub project area. RTX-KG2 is one of the KPs that is used by the Translator reasoning agent, ARAX. For more information about ARAX, see the Expander Agent Wiki Page. For more information about Translator Knowledge Providers, see this page (biothings.ncats.io).

  • Technical User Guide to RTX-KG2 - (instructions should allow a reasonably-competent user to make a test query using a specific example, retrieve the results, then create their own query, with tips and common errors described – similar to https://github.com/NCATSTranslator/Relay/wiki/ARS-Query-Process) For information on the RTX-KG2 API, see the SmartAPI registry
  • Modes of Access (provide a link) - Reasoner API v.1.4, SmartAPI registry, KGX - formatted Knowledge Graph
  • Issues using the RTX-KG2 KP should be logged in the RTX-KG2 issue tracker; please check the open issues first to see if your issue is already logged in the tracker.
  • How to build your own instance for NCATS Deployment pipeline

Use Cases-

  • one-hop query:
cat <<EOF >onehop.json 
{
  "message":{
    "query_graph":{
      "nodes":{
        "n00":{
          "ids":["CHEMBL.COMPOUND:CHEMBL112"],
          "categories":[
            "biolink:Drug"
          ],
          "is_set":false
        },
        "n01":{
          "categories":[
            "biolink:Gene",
            "biolink:Protein"
          ],
          "is_set":false
        }
      },
      "edges":{
        "e00":{
          "predicates":[
            "biolink:interacts_with"
          ],
          "subject":"n00",
          "object":"n01",
          "exclude":false
        }
      }
    }
  }
}
EOF

curl -X POST \
     "https://kg2cploverdb.transltr.io/query" \
     -H  "accept: application/json" \
     -H  "Content-Type: application/json" \
     -d @onehop.json

should result in this response:

{
  "logs":[
    {
      "level":"INFO",
      "message":"kg2c: Converting qnode n00's 'ids' to equivalent ids we recognize",
      "timestamp":"Fri, 15 Nov 2024 21:11:02 GMT"
    },
    ...
  "message": {
    "knowledge_graph": {
      "edges": {
        "30759528": {
          "attributes":[
            {
              "attribute_source":"infores:rtx-kg2",
              "attribute_type_id":"biolink:knowledge_level",
              "value":"knowledge_assertion"
            },
            {
              "attribute_source":"infores:rtx-kg2",
              "attribute_type_id":"biolink:original_predicate",
              "description":"The IDs of the original RTX-KG2pre edge(s) corresponding to this edge prior to any synonymization or remapping.",
              "value":[
                "CHEMBL.COMPOUND:CHEMBL112---biolink:physically_interacts_with---None---None---None---CHEMBL.TARGET:CHEMBL2094253---identifiers_org_registry:chembl.compound"
              ],
              "value_type_id":"metatype:String"
            },
            {
              "attribute_source":"infores:rtx-kg2",
              "attribute_type_id":"biolink:agent_type",
              "value":"manual_agent"
            }
          ],
          "object":"CHEMBL.TARGET:CHEMBL4523964",
          "predicate":"biolink:physically_interacts_with",
          "sources":[
            {
              "resource_id":"infores:chembl",
              "resource_role":"primary_knowledge_source"
            },
            {
              "resource_id":"infores:rtx-kg2",
              "resource_role":"aggregator_knowledge_source",
              "upstream_resource_ids":[
                "infores:chembl"
              ]
            }
          ],
          "subject":"CHEBI:46195"
        },
        ...

(Several use cases and detailed curl commands to retrieve the results using the most current Translator standards (eg: TRAPI, biolink, Architecture Principles) (with any that are NOT using these standards marked as such) Please store these use cases in the NCATS Translator Testing Repo and provide a link to the use cases in this wiki page.)

Knowledge Sources Accessed - See the FAQ entry "What data sources are used in KG2?" for details.

Source Code - (include links to your source code). See example below

External Documentation (List of urls for documentation sites). See example below.

Clone this wiki locally