static Set<BlankNode> getBNodes(Collection<Triple> s) { Set<BlankNode> result = new HashSet<BlankNode>(); for (Triple triple : s) { if (triple.getSubject() instanceof BlankNode) { result.add((BlankNode) triple.getSubject()); } if (triple.getObject() instanceof BlankNode) { result.add((BlankNode) triple.getObject()); } } return result; }
private static boolean isGrounded(Triple triple) { if (triple.getSubject() instanceof BlankNode) { return false; } if (triple.getObject() instanceof BlankNode) { return false; } return true; }