Hello, first of all thank you for this amazing ontology package. My question is not exactly related to the owlready2 itself.
When I was playing around with the reasoner example using one of my own made-ups, I got some missing classifications in the process. For example, let's say we have an ontology like this:
'''
import owlready2 as owl2
onto = owl2.get_ontology("
http://test.org/onto/")
with onto:
class Temperature(owl2.Thing):
pass
class Material(owl2.Thing):
pass
# Temperature Partition
class Cold(Temperature):
pass
class Hot(Temperature):
pass
Temperature.equivalent_to = [Cold | Hot]
owl2.AllDisjoint([Cold, Hot])
class canWithstandTemperature(owl2.ObjectProperty):
domain = [Material]
range = [Temperature]
python_name = "can_withstand_temperature"
# Material Partition
class SoftMaterial(Material):
equivalent_to = [Material & ~ canWithstandTemperature.some(Hot)]
class HardMaterial(Material):
equivalent_to = [Material & ~ SoftMaterial]
Material.equivalent_to = [SoftMaterial | HardMaterial]
owl2.AllDisjoint([SoftMaterial, HardMaterial])
# Test the reasoner
temp1 = Cold('15_deg')
temp2 = Hot('85_deg')
owl2.AllDifferent([temp1, temp2])
material1 = Material('Plastic', can_withstand_temperature = [temp1])
material2 = Material('Centric', can_withstand_temperature = [temp2])
material3 = Material('Glass', can_withstand_temperature = [temp1, temp2])
# Run reasoner
with onto:
owl2.sync_reasoner()
'''
The logic is, any SoftMaterial cannot withstand Hot temperature while HardMaterial has no problem with Cold or Hot. After I run the reasoner, material2 and 3 have no problem being classified as HardMaterial, while material1 is not classified as either SoftMaterial or HardMaterial.
Wonder if I misunderstand anything in detail.