|
Hello together,
I was wondering if it is possible to consider restriction from concept A during the definition of concept B.
Let me illustrate this with an example.
from owlready2 import *
onto = get_ontology("test")
with onto:
# "Concept A"
class Substance(Thing):
pass
class Attribute(Thing):
pass
class Liquid(Attribute):
pass
class has_attribute(Substance >> Attribute):
pass
# "Concept B"
class Cause(Thing):
pass
class cause_involves_attribute(Cause >> Attribute):
pass
class Leakage(Cause):
equivalent_to = [Cause & cause_involves_attribute.some(Liquid)]
attr1 = Liquid()
cause1 = Cause(cause_involves_attribute=[attr1])
sync_reasoner()
print("debug")
For now, I am modeling a "Substance" with an "Attribute" like "Liquid".
After that, I defined another concept, e.g., "Cause" which can depend on this "Attribute", which is done using the relation "cause_involves_attribute".
Is it possible to model the "Substance" with all "Attribute"(s) and somehow access these attributes within the "Leakage" class to restrict it? So the reasoner could implicitly consider the restriction that are already contained in the "Substance" definition. So I would not need the "cause_involves_attribute" relation and could use a "cause_involves_substance" relation instead!?
Thank you for your time in advance,
Jayson
|