Problem while trying to create a sqlite3 file within a world

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

Problem while trying to create a sqlite3 file within a world

jo-aderkaoui
Hello everyone,

I'm newby with owlready2. When calling world().set_backend(filename, exclusive, read_only) I got  an error if I put True as value for readOnly. The error is:

sqlite3.OperationalError: unable to open database file

My code looks like this :  self.__world.set_backend(
            filename=KB_PATH + ".sqlite3",
            exclusive=False,
            read_only=readOnly
           
        )
where KB_PATH represents the path to an existant ontology.
Does anyone have any idea about how to deal with that issue?

Any help is welcomed.
Reply | Threaded
Open this post in threaded view
|

Re: Problem while trying to create a sqlite3 file within a world

Jiba
Administrator
Hello,

When using World.set_backend(), the file should not be an ontology file, but a quadstore file, which is in practice an SQLite3 database. If using read_only, it should be an SQLite3 file created with a previous call to set_backend() without read_only (so as you can write in the quadstore).

Jiba