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 )
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())) ;
Triple t = getTriple(node) ;
if ( t == null )
throw new CannotReifyException(node) ;
return node ;
}