Skip to content

A library for converting TRAPI queries into cypher queries, taking into account the biolink predicate hierarchy

Notifications You must be signed in to change notification settings

ranking-agent/reasoner-transpiler

Repository files navigation

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

About

A library for converting TRAPI queries into cypher queries, taking into account the biolink predicate hierarchy

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages