phillord / tawny-owl

Build OWL Ontologies in a Programmatic Environment
GNU Lesser General Public License v3.0
251 stars 54 forks source link

Save and reload dynamically created Ontologies #32

Closed timur-han closed 9 years ago

timur-han commented 9 years ago

Hi there,

Is it possible to load OWL files from disk using tawny? I couldn't see such a function but maybe I missed it. If not, is there a means of storing a re-storing dynamically created ontologies?

Thanks in advance.

phillord commented 9 years ago

Yes, there are a couple of ways to do this, depending on exactly what you want to do.

If you want to just load an ontology from disk into memory, then you want tawny.repl/load-ontology. This returns the OWL API ontology object. Also of use is "materialize-ontology" which given an URI, loads the ontology from the URI and any imports and saves them all to file. This is mostly if you want to manipulate an existing ontology, count the classes, do some searches that kind of thing.

If you want to include another ontology into yours, then you can use the "import functionality", which can read directly from URI or elsewhere.

Finally, if you want to use another ontology as if it were created by tawny, then you can use the functionality in tawny.read. This loads the ontology AND makes all of the ontology components available as Clojure vars, so that they can be refered to easily within Clojure.

Saving ontologies is with "tawny.owl/save-ontology".

Sorry for the long answer. It's just a slightly more involved question than it appears.

timur87 notifications@github.com writes:

Hi there,

Is it possible to load OWL files from disk using tawny? I couldn't see such a function but maybe I missed it. If not, is there a means of storing a re-storing dynamically created ontologies?

Thanks in advance.


Reply to this email directly or view it on GitHub: https://github.com/phillord/tawny-owl/issues/32

timur-han commented 9 years ago

Thanks for the fast answer. I think the most suitable option is load-ontology in my case. I want to create individuals of a class in an ontology dynamically and store them thereafter for persistency.

gigster99 commented 9 years ago

+1