Get representative classes from an OWL "or" class expression

80 Views Asked by At

I have 3 classes: Reptile, Mammal and Cat, with Cat is a subclass of Mammal.

I have an "or" class expression:

Reptile or Mammal or Cat

How can I infer with a reasoner to get the most representative classes for any given "or" class expression? Like in this case, they're Reptile and Mammal.

2

There are 2 best solutions below

5
On BEST ANSWER

It seems that getDirectSubclasses(yourOrExpression) gives you the answers you are looking for.

0
On

Another approach: given a disjunction, generate all disjunctions which have one less element than the original and check if they are equivalent. If true, then the element that was removed is 'redundant' - either subclass of another class in the disjunction, or included in the disjunction of two or more elements (thus covered by the other elements).

The same applies to conjunctions.

You can repeat the process - it will terminate when no element can be removed without making the new expression not equivalent to the old one.