ranking-agent / reasoner-transpiler

A library for converting TRAPI queries into cypher queries, taking into account the biolink predicate hierarchy
0 stars 1 forks source link
ncats-translator

TRAPI → Cypher transpiler

Test status via GitHub Actions Code coverage on Codecov

Installation

pip install reasoner-transpiler

Usage

from reasoner_transpiler.cypher import get_query

qgraph = {
    "nodes": {
        "diabetes": {
            "ids": ["MONDO:0005148"],
        },
        "phenotype": {
            "categories": ["biolink:PhenotypicFeature"],
        },
    },
    "edges": {
        "has phenotype": {
            "subject": "diabetes",
            "predicates": ["biolink:has_phenotype"],
            "object": "phenotype",
        },
    },
}

cypher = get_query(qgraph)

Biolink Model

This package uses the Biolink Model Toolkit to access the Biolink Model. Optionally, choose a specific version of the Biolink Model with the environment variable BL_VERSION. Otherwise, the latest version used by the Biolink Model Toolkit will be used.

export BL_VERSION=4.1.6