Error after multiple loadings

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

Error after multiple loadings

wema
Hello everyone,

recently I'm facing a suspicious error:

AttributeError: '_define_inverse_property' annotation property is not defined.

which occurs in the load() function. The suspicious thing is that it doesn't occur everytime, only after a few runs. So currently I cannot replicate it properly, i.e. I cannot really tell when it appears and when it doesn't and what it depends on. Maybe someone has ever run into this error or has a suggestion why this error occurs .

Thanks and best regards
Reply | Threaded
Open this post in threaded view
|

Re: Error after multiple loadings

Jiba
Administrator
Hello,

_define_inverse_property() is actually a method of ObjectProperty. It is called when loading the property, to search for the corresponding inverse property (if it exists).

You probably obtain an "AttributeError" because the method is not found (when an unknown keyword is used, e.g. Property.unknown_keyword, Owlready assume it is an annotation).

For a strange reason, it seems that your property is not loaded as expected, but I can difficulty say more without a running example. Perhaps you can write a script that loads the ontology repetitively until the bug occurs?

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: Error after multiple loadings

wema
Hello,

thank you for your reply. I think I might have found the problem. One ObjectProperty in my ontology did belong to more than one entity type. Owlready2 even put out a warning for this, but I didn't take a closer look to it, since my code worked during the first runs. Anyways, I fixed it and after looping over the .load() about 200 times it did not occur again.

Thank you very much!