Fix for issue with calling world.as_rdflib_graph().query_owlready()

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

Fix for issue with calling world.as_rdflib_graph().query_owlready()

jesper-friis
Hi,
I get an error when calling world.as_rdflib_graph().query_owlready() since the rdflib store has no attribute `onto`. The following patch fixed the issue:


diff -r 8963962cac34 rdflib_store.py
--- a/rdflib_store.py   Tue Mar 24 15:14:56 2020 +0100
+++ b/rdflib_store.py   Sat Apr 11 07:38:57 2020 +0200
@@ -272,7 +272,7 @@
   
   def _rdflib_2_owlready(self, o):
     if   isinstance(o, rdflib.term.URIRef ): o = self.store.world[str(o)]
-    elif isinstance(o, rdflib.term.BNode  ): o = (self.store.onto or self.store.world)._parse_bnode(o)
+    elif isinstance(o, rdflib.term.BNode  ): o = self.store.world._parse_bnode(o)
     elif isinstance(o, rdflib.term.Literal):
       if o.language is None:
         if o.datatype:


Regards
/Jesper
Reply | Threaded
Open this post in threaded view
|

Re: Fix for issue with calling world.as_rdflib_graph().query_owlready()

Jiba
Administrator
Hi,

Thank you for pointing out this problem. I think it should be self.onto; I fixed it in the development version.

Jiba