Hi Jiba, congrats with your book! If only i could read french i would use it surely!
Anyway i've read this part
https://owlready2.readthedocs.io/en/latest/world.html#persistent-world-storing-the-quadstore-in-an-sqlite3-file-database.
And I was trying to using worlds like this:
"manager class"
def __init__(self)
..........................
self.my_world = World()
self.big_world = World()
self.big_world.set_backend(filename=PATH_DB, exclusive=True)
self.onto = self.my_world.get_ontology(iri)
I create the ontology in my_world and i store in .owl file.
I need the same base ontology for reasoning on different scenarios but i'm missing something.
here it is what i'm trying to do
for .....
new world with base ontology
adding classes and Property for this particular situation
reasoning
storing result (not .owl)
Repeat x times (where x is the number of situation)
I've had some problems:
Database is locked
Database is closed
TypeError: issubclass() arg 1 must be a class
And here some method of my "manager" class
def save_base_world(self):
#self.onto.save(os.path.dirname(__file__) + "/.idea/onto.owl")
self.onto.destroy()
#self.my_world.save()
#self.my_world.close()
def create_new_world(self):
#self.big_world = World(filename=PATH_DB)
self.onto = self.big_world.get_ontology("file://" + os.path.dirname(__file__) + "/.idea/onto.owl").\
load() #True, None, True
def close_new_world(self):
self.onto.destroy()
self.big_world.save()
self.big_world.graph.commit()
connect(PATH_DB).close()
#self.big_world.close()
Thanks for your time
Demian