StringWriter stringWriter = new StringWriter();
JenaUtil.getModelFromGraph(graph).write(stringWriter);
log.debug("Anonymized graph: ");
log.debug(stringWriter);
}
ReferenceGroundedDecomposition refDec = new ReferenceGroundedDecompositionImpl(graph);
ReferenceGroundedDecomposition leanifiedDec = getLeanVersionWithoutAnonymizing(refDec);
Graph nonNaturalGraph = new SimpleGraph();
for (Iterator<MaximumContextualMolecule> iter = leanifiedDec
.getContextualMolecules().iterator(); iter.hasNext();) {
nonNaturalGraph.addAll(iter.next());
}
for (Iterator<TerminalMolecule> iter = leanifiedDec.getTerminalMolecules()
.iterator(); iter.hasNext();) {
nonNaturalGraph.addAll(iter.next());
}
try {
SimpleGraph result = new NaturalizedGraph(nonNaturalGraph, leanifiedDec
.getFunctionallyGroundedNodes());
result.markFinalized();
/*System.out.println("DEBUG not anonymized:");
JenaUtil.getModelFromGraph(result).write(System.out, "N3");*/
return result;