}
Set<Set<NonLiteral>> unitedEquivalenceSets = uniteSetsWithCommonElement(ifp2nodesMap.values());
Map<NonLiteral, NonLiteral> current2ReplacementMap = new HashMap<NonLiteral, NonLiteral>();
final MGraph owlSameAsGraph = new SimpleMGraph();
for (Set<NonLiteral> equivalenceSet : unitedEquivalenceSets) {
final NonLiteral replacement = getReplacementFor(equivalenceSet, owlSameAsGraph);
for (NonLiteral current : equivalenceSet) {
if (!current.equals(replacement)) {
current2ReplacementMap.put(current, replacement);
}
}
}
final Set<Triple> newTriples = new HashSet<Triple>();
for (Iterator<Triple> it = mGraph.iterator(); it.hasNext();) {
final Triple triple = it.next();
Triple replacementTriple = null;
final NonLiteral subject = triple.getSubject();
NonLiteral subjectReplacement =
current2ReplacementMap.get(subject);
final Resource object = triple.getObject();
@SuppressWarnings("element-type-mismatch")
Resource objectReplacement = current2ReplacementMap.get(object);
if ((subjectReplacement != null) || (objectReplacement != null)) {