StringBuffer moleculePath = new StringBuffer(relativePath);
moleculePath.append(Util.createRandomString(8));
moleculePath.append(".rdf");
ZipEntry entry = new ZipEntry(moleculePath.toString());
zipOut.putNextEntry(entry);
Graph graph = new SimpleGraph();
Node naturalNode = naturalizer.naturalize(fgNode, graph);
Graph addition;
try {
addition = new GraphUtil<Graph>().replaceNode(molecule,
fgNode, naturalNode, new SimpleGraph());
} catch (SourceNodeNotFoundException e) {
// this is in fact the normal case of non-self-referencing
// fg-nodes (x mbox [mbox "foo"]. x mbox "foo")
addition = molecule;
}
try {
addition = new GraphUtil<Graph>().replaceNode(addition,
NonTerminalMolecule.GROUNDED_NODE, naturalNode,
new SimpleGraph());
} catch (SourceNodeNotFoundException e) {
// this is a bit strange ...
throw new RuntimeException(e);
}
graph.addAll(addition);
/*
* graph.addAll(molecule); graph.add(new
* TripleImp(naturalizer.naturalize(fgNode, null), new
* PropertyNodeImpl(MODELDIFF.functionallyGroundedIn .getURI()),
* namedNode));