triples.iterator().close();
return molecules;
}
private Molecule convertTripleToMolecule(Molecule molecule) throws GraphException {
Triple currentTriple = molecule.getHeadTriple();
boolean blankSubject = isBlankNode(currentTriple.getSubject());
boolean blankObject = isBlankNode(currentTriple.getObject());
if (blankObject) {
molecule = findEnclosedTriples(molecule, graph.find(ANY_SUBJECT_NODE, ANY_PREDICATE_NODE,
currentTriple.getObject()));
molecule = findEnclosedTriples(molecule, graph.find((SubjectNode) currentTriple.getObject(),
ANY_PREDICATE_NODE, ANY_OBJECT_NODE));
}
if (blankSubject) {
molecule = findEnclosedTriples(molecule, graph.find(currentTriple.getSubject(), ANY_PREDICATE_NODE,
ANY_OBJECT_NODE));
molecule = findEnclosedTriples(molecule, graph.find(ANY_SUBJECT_NODE, ANY_PREDICATE_NODE,
(ObjectNode) currentTriple.getSubject()));
}
return molecule;
}