Reply – Inferring Object Properties for Individuals Based on Asserted SomeValuesFrom
Your Name
Subject
Message
or Cancel
In Reply To
Inferring Object Properties for Individuals Based on Asserted SomeValuesFrom
— by Richard Richard
Hi!
Thank you so much for this awesome API bringing ontology work to the modern world in Python :)
I have an ontology (RDF/XML) built in Protege to the effect of:

----
Classes:
Thing
    Ingredient
        Kale <--- subClassOf: hasTaste some Bitter . EquivalentTo: {kale}
    Taste
        Bitter <--- EquivalentTo: {bitter}

Individuals:
    kale
    bitter

Object Properties:
    hasTaste

----------
Notice that I've closed/reified the Kale and Bitter classes to include exactly 1 individual each. When I run the following code:

from owlready2 import *
world = World()
onto = world.get_ontology('.../my/ontology/file.owl')

print(onto.Kale.instances()) # []
sync_reasoner(world)
print(onto.Kale.instances()) # [onto.kale]  GOOD!
print(onto.hasTaste[onto.kale]) # []  BAD; Expected: [onto.bitter]

Any ideas how to make this work? I've tried wrapping it in with onto: ... But that hasn't worked either.

Thanks in advance!