Re: UnboundLocalError: local variable 'entity' referenced before assignment
Posted by Jiba on
URL: http://owlready.306.s1.nabble.com/UnboundLocalError-local-variable-entity-referenced-before-assignment-tp2349p2371.html
Hi,
If feo:SeasonCharateristic is a subclass of feo:SystemCharacteristic, which is itself a subclass of feo:Charateristic, any individual classified as feo:SeasonCharateristic will not be classified as feo:Charateristic and feo:SeasonCharateristic, in order to limit multiple instantiations, and because these inferences are rather trivial, and already performed by Python, e.g. when you use the isinstance() function.
If you really need them, you can use the .INDIRECT_is_a attribute to get them (even before calling the reasoner if you only need trivial inferences):
ancestors = individual.INDIRECT_is_a
Jiba