diff --git a/test/simple-test.py b/test/simple-test.py index 8bfec72..0145ca7 100644 --- a/test/simple-test.py +++ b/test/simple-test.py @@ -10,8 +10,9 @@ def main(): # cached_onto = text2term.cache_ontology("EFO") # # df = cached_onto.map_terms(["asthma", "disease location", "obsolete food allergy"], excl_deprecated=True, term_type="classes") # print("Cache exists:", cached_onto.cache_exists()) - # df = text2term.map_terms(["asthma", "disease location", "obsolete food allergy"], "EFO", excl_deprecated=True, use_cache=True, term_type="classes") - df = text2term.map_terms(["contains", "asthma"], "EFO", term_type="classes") + caches = text2term.cache_ontology_set("text2term/resources/ontologies.csv") + df = text2term.map_terms(["asthma", "disease location", "obsolete food allergy"], "EFO", excl_deprecated=True, use_cache=True, term_type="classes") + # df = text2term.map_terms(["contains", "asthma"], "EFO", term_type="classes") print(df.to_string()) if __name__ == '__main__': diff --git a/text2term/config.py b/text2term/config.py index 7e8ebeb..9b332ca 100644 --- a/text2term/config.py +++ b/text2term/config.py @@ -1 +1 @@ -VERSION = "2.3.0" \ No newline at end of file +VERSION = "2.3.1" \ No newline at end of file diff --git a/text2term/onto_cache.py b/text2term/onto_cache.py index f15e737..7af3e40 100644 --- a/text2term/onto_cache.py +++ b/text2term/onto_cache.py @@ -3,6 +3,8 @@ import os from shutil import rmtree import sys +import pandas as pd +import owlready2 """ CACHING FUNCTIONS -- Public @@ -16,7 +18,8 @@ def cache_ontology_set(ontology_registry_path): cache = text2term.cache_ontology(row.url, row.acronym) cache_set.update({row.acronym : cache}) except Exception as err: - sys.stderr.write("Could not cache ontology", row.acronym, "due to error:", err) + err_message = "Could not cache ontology " + row.acronym + " due to error: " + str(err) + sys.stderr.write(err_message) owlready2.default_world.ontologies.clear() return cache_set