public Node reifyAs(Node node, Triple triple) { if ( node == null ) node = Node.createAnon() ; else { Triple t = getTriple(node) ; if ( t != null && ! t.equals(triple) ) throw new AlreadyReifiedException(node) ; if ( t != null ) // Already there return node ; } graph.add(new Triple(node, rdfType, statement)) ; graph.add(new Triple(node, subject, triple.getSubject())) ; graph.add(new Triple(node, predicate, triple.getPredicate())) ; graph.add(new Triple(node, object, triple.getObject())) ; // Check it's a well-formed reification by Jena's uniqueness rules Triple t = getTriple(node) ; if ( t == null ) throw new CannotReifyException(node) ; return node ; }
throw new AlreadyReifiedException(node) ; if ( t != null )