// remove axioms that differ only because of n-ary equivalence
// axioms
// http://www.w3.org/TR/owl2-mapping-to-rdf/#Axioms_that_are_Translated_to_Multiple_Triples
for (OWLAxiom ax : new ArrayList<>(axioms1)) {
if (ax instanceof OWLEquivalentClassesAxiom) {
OWLEquivalentClassesAxiom ax2 = (OWLEquivalentClassesAxiom) ax;
if (ax2.getClassExpressions().size() > 2) {
Set<OWLEquivalentClassesAxiom> pairs = ax2
.splitToAnnotatedPairs();
if (removeIfContainsAll(axioms2, pairs, destination)) {
axioms1.remove(ax);
axioms2.removeAll(pairs);
}
}
} else if (ax instanceof OWLEquivalentDataPropertiesAxiom) {
OWLEquivalentDataPropertiesAxiom ax2 = (OWLEquivalentDataPropertiesAxiom) ax;
if (ax2.getProperties().size() > 2) {
Set<OWLEquivalentDataPropertiesAxiom> pairs = ax2
.splitToAnnotatedPairs();
if (removeIfContainsAll(axioms2, pairs, destination)) {
axioms1.remove(ax);
axioms2.removeAll(pairs);
}
}
} else if (ax instanceof OWLEquivalentObjectPropertiesAxiom) {
OWLEquivalentObjectPropertiesAxiom ax2 = (OWLEquivalentObjectPropertiesAxiom) ax;
if (ax2.getProperties().size() > 2) {
Set<OWLEquivalentObjectPropertiesAxiom> pairs = ax2
.splitToAnnotatedPairs();
if (removeIfContainsAll(axioms2, pairs, destination)) {
axioms1.remove(ax);
axioms2.removeAll(pairs);
}