Problems with reasoner

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

Problems with reasoner

Vladimir Zarayskiy
I have a problem with reasoning. I setting up several classes with different conditions. When the reasoner is synchronized, it turns out that these classes become equivalent to each other (this is normal for my app). Then, i try to change 'equivalent_to' parameter to another restrictions, I get this exception:

  File "C:\Projects\www\osp\functions\reasoner.py", line 74, in fn_search_request
   ontology['products_all_features'].equivalent_to = []
  File "C:\Users\v-zar\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\owlready2\util.py", line 81, in __delitem__
    def __delitem__(self, i):     old = list(self); super().__delitem__(i)    ; self._callback(self._obj, old)
  File "C:\Users\v-zar\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\owlready2\entity.py", line 210, in _class_equivalent_to_changed
    for x2 in x.equivalent_to._indirect: x2._equivalent_to._indirect = None
  File "C:\Users\v-zar\AppData\Local\Programs\Python\Python38-32\Lib\site-packages\owlready2\class_construct.py", line 216, in __getattr__
    return super().__getattribute__(attr)
AttributeError: 'And' object has no attribute '_equivalent_to'

Is there any way to stop reasoning after executing 'sync_reasoner()' function, or how can i change 'equivalent_to' parameter of class after sync_reasoner()?

I use 'And()' and 'Or()' functions to get restriction, because i have list of ObjectProperties classes, so i can't not use this functions.

The version of my Owlready2 package is 0.25. The version of python is 3.8.2.
Reply | Threaded
Open this post in threaded view
|

Re: Problems with reasoner

Jiba
Administrator
Hi,

Could you try the development version of Owlready2 (on Bitbucket) please ? I have fixed a similar error a few weeks ago so I think it is Ok now.

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Problems with reasoner

Vladimir Zarayskiy
Hi, thank you very much. It helps me.