How re-open closed world?

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

How re-open closed world?

Arciniegas
Hi, i'm new in owlready and the ontology programming, but my college degree is about this and i'm learning.

So, i'm working on a micro-services architecture in a web app, and i wanna close a world when i didn't need more, to save memory for other tasks, but i have an error like "Cannot use a closed database" or something similar.

It's necessary to keep the world open? Is there a way to re-open a closed world and keep it open only when it's being used?

Tanks :3
Reply | Threaded
Open this post in threaded view
|

Re: How re-open closed world? [closed]

Arciniegas
It's interesting but i do not understand very well why...

You can close and reopen a world a lot of times using
close_world(myWorld)

but if you use myWorld.close() the program trows exception when you wanna re open the world.

( ¬.¬)
Reply | Threaded
Open this post in threaded view
|

Re: How re-open closed world? [closed]

Jiba
Administrator
Hi,

close_world() and World.close() are not the same at all.

World.close() close the database connection for this World.

close_world(entity) automatically generates OWL constructs for considering the given entity in a closed-world : i.e., everything that is not known on this entity is considered as false : the entity cannot have additional relations that are not already known.

I understand that both name are very ambiguous... the problem is that the word "close" is used both in the database domain and the knowledge representation domain, with totally different meaning.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: How re-open closed world? [u-u]

Arciniegas
Well, i see, but i return to my question.

It's necessary to keep the world open? Is there a way to re-open a closed world and keep it open only when it's being used?

____
Sorry, i hope your family is fine now.
Salut.
Reply | Threaded
Open this post in threaded view
|

Re: How re-open closed world? [u-u]

Jiba
Administrator
I think you can keep the database connection open.

If you really want to close it, you need to create a new World for re-opening it.

Jiba