return getFgNodeFromPathNode(zipFile, pathNode, describingResource);
}
private FunctionallyGroundedNode getFgNodeFromPathNode(ZipFile zipFile,
PathNode pathNode, NamedNode describingResource) throws IOException {
Node afgn = null;
FunctionallyGroundedNodeImpl result = functionallyGroundedBuilder.createFGNode();
descriptionPathToFgNode.put(describingResource, result);
for (String moleculeNodeName : pathNode.list()) {
PathNode moleculePathNode = pathNode.getSubPath(moleculeNodeName);
Model model = ModelFactory.createDefaultModel();
model
.read(moleculePathNode.getInputStream(),
ReferencingNaturalizer.rootURL
+ moleculePathNode.getPath());
/*
* StmtIterator specialStmtIter = model.listStatements(null,
* MODELDIFF.functionallyGroundedIn, (Resource)null); Statement
* specialStmt = specialStmtIter.nextStatement();
* specialStmtIter.close(); Resource groundedNodedRes =
* specialStmt.getSubject(); specialStmt.remove();
*/
Graph graph = JenaUtil.getGraphFromModel(model, false);
Graph tripleSet = new SimpleGraph();
Node currentAfgn = null;
Map<Node, FunctionallyGroundedNode> innerReplacements = new HashMap<Node, FunctionallyGroundedNode>();
for (Triple triple : graph) {
if (triple.getPredicate().equals(
new PropertyNodeImpl(MODELDIFF.functionallyGroundedIn
.getURI()))) {
Node subject = triple.getSubject();
if (!describingResource.equals(triple.getObject())) {
// throw new RuntimeException("invalid diff");
// now legal as fg-nodes may reference to others in
// their nt-molecules
//infinite recursion by cache