// center part of the chain must be smaller in any case
for (int i = 1; i < chain.size() - 1; i++) {
OWLObjectPropertyExpression propB = chain.get(i);
assert propB != null;
if (getPropertyManager().isLessThan(superProp, propB)) {
profileViolations.add(new UseOfPropertyInChainCausesCycle(
getCurrentOntology(), axiom, propB));
}
}
if (first.equals(superProp)) {
// first equals, last must be smaller
if (getPropertyManager().isLessThan(superProp, last)) {
profileViolations.add(new UseOfPropertyInChainCausesCycle(
getCurrentOntology(), axiom, last));
}
} else {
// first not equal, it must be smaller
if (getPropertyManager().isLessThan(superProp, first)) {
profileViolations.add(new UseOfPropertyInChainCausesCycle(
getCurrentOntology(), axiom, first));
}
}
if (last.equals(superProp)) {
// last equals, first must be smaller
if (getPropertyManager().isLessThan(superProp, first)) {
profileViolations.add(new UseOfPropertyInChainCausesCycle(
getCurrentOntology(), axiom, first));
}
} else {
// last not equal, it must be smaller
if (getPropertyManager().isLessThan(superProp, last)) {
profileViolations.add(new UseOfPropertyInChainCausesCycle(
getCurrentOntology(), axiom, last));
}
}
// neither first and last equal: they both must be smaller, checked
// already in the else branches