OperationalError: circular reference: prelim1_objs

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

OperationalError: circular reference: prelim1_objs

jeff
I am getting this error:
OperationalError: circular reference: prelim1_objs

When I do a list(onto.val.instances()) on an owl file. I did not get this error in v0.33, but now it it in version v0.34. Here is the rest of the relevant portions of the error message:

/databricks/python/lib/python3.8/site-packages/owlready2/sparql/main.py in execute_flat(self, params)
    341
    342   def execute_flat(self, params = ()):
--> 343     for l in PreparedQuery.execute(self, params):
    344       i = 0
    345       while i < len(l):

/databricks/python/lib/python3.8/site-packages/owlready2/sparql/main.py in execute(self, params)
    319     sql_params = [self.world._to_rdf(param)[0] for param in params]
    320     for i in self.parameter_datatypes: sql_params.append(self.world._to_rdf(params[i])[1])
--> 321     return self.world.graph.execute(self.sql, sql_params)
    322
    323 class PreparedSelectQuery(PreparedQuery):
Reply | Threaded
Open this post in threaded view
|

Re: OperationalError: circular reference: prelim1_objs

Jiba
Administrator
Hi,

In v0.34, I rewrote .instances() in SPARQL for better performances and for taking equivalent classes into account.

Could you send me your ontology so I can experiment the problem ?

Additionally, could you give me the version of SQLite3 you are using ? You can get it in Python with :

import sqlite3
print("SQLite3  version : %s"   % sqlite3.sqlite_version)

It seems that version 0.35.2 may have a bug related to recursive query, but that bug is fixed in 0.36.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: OperationalError: circular reference: prelim1_objs

Akshay
Hi Jiba,
I also faced the same error on python 3.8 on owlready version 0.34. However, upgrading the python to version 3.9 seems to have resolved the issue.
Reply | Threaded
Open this post in threaded view
|

Re: OperationalError: circular reference: prelim1_objs

Jiba
Administrator
Hi,

I finally found the cause of this problem. Some versions of SQLite3 have a bug in the support of recursive queries. Version 3.33 is affected, while version 3.36 is not.

I added a workaround in the development version of Owlready (on BitBucket). I will make a new release soon.

Jiba