Skip to content

Commit

Permalink
adding the ability to set a specific biolink model version with an en…
Browse files Browse the repository at this point in the history
…v var
  • Loading branch information
EvanDietzMorris committed Mar 8, 2024
1 parent 80d24a6 commit 4579908
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,9 @@ qgraph = {

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.
```commandline
export BL_VERSION=4.1.6
```
8 changes: 7 additions & 1 deletion reasoner_transpiler/matching.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""MATCHing tools."""
import os
from typing import Dict, List

from bmt import Toolkit
Expand All @@ -7,7 +8,12 @@
from .nesting import Query
from .util import ensure_list, snake_case, space_case, pascal_case

bmt = Toolkit()

BIOLINK_MODEL_VERSION = os.environ.get('BL_VERSION', '4.1.6')
BIOLINK_MODEL_SCHEMA_URL = f"https://raw.githubusercontent.com/biolink/biolink-model/v{BIOLINK_MODEL_VERSION}/biolink-model.yaml"
PREDICATE_MAP_URL = f"https://raw.githubusercontent.com/biolink/biolink-model/v{BIOLINK_MODEL_VERSION}/predicate_mapping.yaml"

bmt = Toolkit(schema=BIOLINK_MODEL_SCHEMA_URL, predicate_map=PREDICATE_MAP_URL)
ALL_BIOLINK_ENUMS = bmt.view.all_enums().keys()

def cypher_prop_string(value):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

setup(
name="reasoner-transpiler",
version="2.0.6",
version="2.0.7",
author="Patrick Wang",
author_email="[email protected]",
maintainer="Yaphet Kebede",
Expand Down

0 comments on commit 4579908

Please sign in to comment.