Worlds and quadstores

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

Worlds and quadstores

emir
I tried searching for a detailed explanation of worlds and quadstores in the documentation and on the forum but I couldn't find what I wanted.

I can't understand the purpose of the quadstore and worlds. When I save the world, and if I want to query the same ontology again, why do I have to load the ontology? And how can I access the already created world? By World(filename=...)? and is it possible to have the inferred facts saved in a world but not in the ontology?
Reply | Threaded
Open this post in threaded view
|

Re: Worlds and quadstores

Jiba
Administrator
Hi,

Each world corresponds to a separate quadstore (so basically, world = quadstore). The purpose is to have separated quadstore. This can be interesting, e.g. if you have a website that manages several unrelated application that use Owlready: each application can have its own quadstore / world.

> And how can I access the already created world? By World(filename=...)?

Yes (if you have a single world, which is the most common case, you should use default_world.set_backend(filename = ...)).


> When I save the world, and if I want to query the same ontology again, why do I have to load the ontology?

You need to load the ontology if you want to use the ontology object (however, when querying the quadstore, all ontologies in the quadstore are considered, even unloaded ones).


> is it possible to have the inferred facts saved in a world but not in the ontology?

You can create a separate ontology for storing the inferred facts, in the same world. This is often a good idea, since it allows distinguishing asserted and inferred facts. It also allows removing all inferred facts, before calling the reasoner again, in case you modify the asserted facts.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Worlds and quadstores

emir
Thank you for such a detailed answer!