result.notifyAllFinalized();
return result;
}
private NonTerminalMolecule functionalyze(NonTerminalMolecule molecule) {
SimpleNonTerminalMolecule result = new SimpleNonTerminalMolecule(NonTerminalMolecule.GROUNDED_NODE);
Triple origTriple = molecule.iterator().next();
Node subject = origTriple.getSubject();
if (subject instanceof GroundedNode) {
subject = functionalyze((GroundedNode)subject);
}
Node object = origTriple.getObject();
if (object instanceof GroundedNode) {
object = functionalyze((GroundedNode)object);
}
Triple newTriple = new TripleImpl(subject, origTriple.getPredicate(), object);
result.add(newTriple);
return result;
}