From 4f4b8fc67f1a41635ca915c06c830eb841e47a8e Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Tue, 3 Sep 2024 15:17:41 -0400 Subject: [PATCH 1/5] output -> output_dir --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index ae9e4fa..47735cc 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,7 +74,7 @@ pipeline { dir('./gitrepo') { script { // Get the names of all BioPortal ontologies - sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY} --output data/raw/" + sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY} --output_dir data/raw/" // Now download all // or at least in the future, do them all. From 1ebbfb2ac06d678f55ae3dcfb20f15ac17bd596c Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Tue, 3 Sep 2024 15:22:55 -0400 Subject: [PATCH 2/5] Fix typo --- Jenkinsfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index 47735cc..2559e5f 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -82,7 +82,7 @@ pipeline { sh "printf 'ENVO\nPO\nSEPIO\n' > data/raw/ontologylist.tsv" // Download the ontologies - sh ". venv/bin/activate && kbbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv --output_dir data/raw/" + sh ". venv/bin/activate && kgbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv --output_dir data/raw/" } } From 67571d3082f1a98cb2fdbf365de47b35de38fb74 Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Tue, 3 Sep 2024 15:29:02 -0400 Subject: [PATCH 3/5] Fix another malformed CLI arg --- src/kg_bioportal/cli.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/kg_bioportal/cli.py b/src/kg_bioportal/cli.py index 8735bd5..bad3116 100644 --- a/src/kg_bioportal/cli.py +++ b/src/kg_bioportal/cli.py @@ -77,7 +77,7 @@ def get_ontology_list(output_dir, api_key) -> None: required=False, type=click.Path(exists=True), ) -@click.option("output_dir", "-o", required=True, default="data/raw") +@click.option("--output_dir", "-o", required=True, default="data/raw") @click.option( "--snippet_only", "-x", From bca27f3f2c0ad2f99b529400d8fce7b03ade1a9e Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 4 Sep 2024 13:56:26 -0400 Subject: [PATCH 4/5] Add check for API key --- src/kg_bioportal/downloader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/kg_bioportal/downloader.py b/src/kg_bioportal/downloader.py index 55d26f8..ceb721b 100644 --- a/src/kg_bioportal/downloader.py +++ b/src/kg_bioportal/downloader.py @@ -50,6 +50,9 @@ def __init__( if not os.path.exists(self.output_dir): os.makedirs(self.output_dir) + if not api_key: + raise ValueError("API key is required for downloading from BioPortal.") + return None # TODO: save NCBO ID and version for each ontology, then pass to transformer From b4bb2f22e20095400243bb757aa225e40ea44b9a Mon Sep 17 00:00:00 2001 From: caufieldjh Date: Wed, 4 Sep 2024 13:59:04 -0400 Subject: [PATCH 5/5] Remove output_dir value since it's using the default anyway --- Jenkinsfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Jenkinsfile b/Jenkinsfile index 2559e5f..1e211e9 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -74,7 +74,8 @@ pipeline { dir('./gitrepo') { script { // Get the names of all BioPortal ontologies - sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY} --output_dir data/raw/" + // This saves the list to data/raw/ontologylist.tsv + sh ". venv/bin/activate && kgbioportal get-ontology-list --api_key ${NCBO_API_KEY}" // Now download all // or at least in the future, do them all. @@ -82,7 +83,8 @@ pipeline { sh "printf 'ENVO\nPO\nSEPIO\n' > data/raw/ontologylist.tsv" // Download the ontologies - sh ". venv/bin/activate && kgbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv --output_dir data/raw/" + // This saves them to data/raw/ + sh ". venv/bin/activate && kgbioportal download --api_key ${NCBO_API_KEY} --ontology_file data/raw/ontologylist.tsv" } }