I have the following setting:
- an owl-ontology (accessed via owlready with this class hierarchy:
owl:Thing
├── ClassA1
└── ClassB1
└── ClassB2
└── ClassB3
└── ClassB4
- one instance of each class, say
A1
,B1
, etc. - a property
prop1
which relatesA1
toB4
:prop1(A1, B4)
I want a SWRL-rule which, given prop1(A1, B4)
, relates A1
to B3
and B2
via prop1
.
I imagine there must be something like this (partially invented syntax):
ClassA(?a), prop1(?a, ?i1), rdfs:type(?i1, ?c),
direct_subclass(?c ,?d), rdfs:type(?i2, ?d), not rdfs:type(?i2, ClassB1) -> prop(?a, ?i2)
However, I did not find anything about "variables representing classes" in SWRL (cf direct_subclass(?c, ?d)
or rdfs:type(?i2, ?d)
).
How can I formulate my rule?