|
When I load an ontology from a DB using:
db_path = "./quadstore.sqlite3"
world = World(filename=db_path, exclusive=False, read_only=True)
and try to run a query using:
world.sparql(query, error_on_undefined_entities=False)
I get the error:
File ".../.venv/lib/python3.11/site-packages/owlready2/triplelite.py", line 362, in _abbreviate
self.execute("INSERT INTO resources VALUES (?,?)", (storid, iri))
sqlite3.OperationalError: attempt to write a readonly database
The query only runs if I put the read_only flag to False when loading the ontology from the DB.
Why is that? I don't understand why these two concepts are related. Am I doing something wrong?
P.S. if it's of any help, the reason why I'm trying to use error_on_undefined_entities is because I need to query some entities with the same UUID but a different IRI. I just want to retrieve them wherever a match is found. If there's a different way of doing this I would also appreciate any workaround.
Thanks for your help
|