stackProps.add(prop);
for (OWLOntology ont : ontologies) {
for (OWLSubObjectPropertyOfAxiom ax : ont
.getObjectSubPropertyAxiomsForSubProperty(prop)) {
if (ax.getSubProperty().equals(prop)) {
OWLObjectPropertyExpression supProp = ax.getSuperProperty();
if (!indexMap.containsKey(supProp)) {
tarjan(ontologies, supProp, index + 1, stack, indexMap,
lowlinkMap, result, processed, stackProps);
lowlinkMap.put(
prop,
Math.min(lowlinkMap.get(prop),
lowlinkMap.get(supProp)));
} else if (stackProps.contains(supProp)) {
lowlinkMap.put(
prop,
Math.min(lowlinkMap.get(prop),
indexMap.get(supProp)));
}
}
}
}
if (lowlinkMap.get(prop).equals(indexMap.get(prop))) {
Set<OWLObjectPropertyExpression> scc = new HashSet<>();
OWLObjectPropertyExpression propPrime;
while (true) {
propPrime = stack.pop();
stackProps.remove(propPrime);
scc.add(propPrime);
if (propPrime.equals(prop)) {
break;
}
}
if (scc.size() > 1) {
result.add(scc);