Hi Jiba,
I have a question about the type relations of individuals.
I have attached a small ontology with one individual which
has two types HasEggs and Animal. Note that, HasEggs is a
subclass of Animal but the Animal type is explicitly set for the
individual anyway.
If we now remove the HasEggs type from the individual, the
Animal type is gone too (See the code below).
However, since the Animal type was explicitly set, it should still be there.
Saving the ontology and loading it again does behave correctly.
I guess, the is_a attribute would have to be updated then after the
removal of the first type?
Or if that’s already possible what would be the best way to
update it?
Thanks!
animals.owl################################
from owlready2 import get_ontology
onto = get_ontology("file://animals.owl").load()
ind = list(onto.individuals())[0]
print(ind.is_a) # HasEggs
print(ind.INDIRECT_is_a) # HasEggs, Animal, Thing
haseggs = ind.is_a[0]
ind.is_a.remove(haseggs)
print(ind.is_a) # Thing
print(ind.INDIRECT_is_a) # Thing
#################################
[hidden email]