Worlds and Imported Ontologies

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Worlds and Imported Ontologies

Khainy
Hi everyone,

In the project I'm currently working on, I need to append an ontology B to the imported ontologies list of an ontology A. One thing I should specify is that the ontology B is loaded from a RDF file, which contents is often changed by another part of my program (I'm loading it after every change on this file).

I saw that loading multiple times an ontology doesn't refresh it because there is a cache for loaded ontologies and that, in this case, it is recommanded to use worlds, thanks to this post: http://owlready.8326.n8.nabble.com/Refreshing-a-pre-loaded-ontology-tp137.html.

So, I tried to create a new World and load the ontology B in it before appending the ontology B to the imported ontologies list of the ontology A. But when I look at the owl file of the ontology A (after saving it), I found out that the file used as an imported ontology is its own file and not the ontology B's one.

As a newcomer, I may have made something wrong but I'm stuck and I really don't know how to solve it and how to refresh my ontology B. Could someone help me with this please?

Thank you,

Khainy.
Reply | Threaded
Open this post in threaded view
|

Re: Worlds and Imported Ontologies

Jiba
Administrator
Hi,

Worlds are isolated one from each other. Consequently, if ontology A and B are not from the same world, A cannot import B.

To update your ontology, you can:

 - simply rerun your program, if the quadstore is not stored on disk.

 - load ontology B with get_ontology(<IRI>, reload = True). This will force reloading the ontology, however, the cached Python object will not be updated.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Worlds and Imported Ontologies

Khainy
Hi Jiba,

First of all, thank you for the fast reply.

To update my ontology I follow your first suggestion (the second one didn't work as expected) and it works now.

Thank you for your help.

Have a nice day.

Khainy