pwin / owlready2

GNU Lesser General Public License v3.0
137 stars 22 forks source link

Unload an ontology after load() call #12

Open dfsantamaria opened 3 years ago

dfsantamaria commented 3 years ago

Is there any way to 'unload' an ontology after a get_ontology().load() call?

ThomasThelen commented 2 years ago

You might get what you're after using the context manager,

ontology = owl.get_ontology('ontology.owl')
with ontology.load():
   Do things
dfsantamaria commented 2 years ago

My request concerns the need of unloading ontologies outside the CM, for example after the object "ontology" has been passed to a function.