Skip to content

Commit

Permalink
Merge pull request #70 from ncbo/66-retrieve-ontology-version-when-do…
Browse files Browse the repository at this point in the history
…wnloading-and-pass-it-to-the-transformer

Get more ontology metadata and pass to the transform step
  • Loading branch information
caufieldjh authored Sep 5, 2024
2 parents 3611c42 + ffc371a commit 7e07fd6
Show file tree
Hide file tree
Showing 4 changed files with 188 additions and 67 deletions.
128 changes: 88 additions & 40 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 15 additions & 1 deletion src/kg_bioportal/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import click

from kg_bioportal.downloader import Downloader
from kg_bioportal.downloader import Downloader, ONTOLOGY_LIST_NAME
from kg_bioportal.transformer import Transformer

__all__ = [
Expand Down Expand Up @@ -128,6 +128,20 @@ def download(

onto_list = []

# If no input args provided, use the full list of ontologies
# But if the full list isn't available, throw an error and remind
# the user to download it first
if not ontologies and not ontology_file:
try:
with open(f"{output_dir}/{ONTOLOGY_LIST_NAME}", "r") as f:
for line in f:
onto_list.append(line.strip())
except FileNotFoundError:
logging.error(
f"Ontology list file not found. Please run the 'get_ontology_list' command first."
)
return None

# Parse the ontologies argument
if ontologies:
for ontology in ontologies.split():
Expand Down
Loading

0 comments on commit 7e07fd6

Please sign in to comment.