/** Add triples into the destination (arg 1) from the source (arg 2)*/ public static void addInto(Graph dstGraph, Graph srcGraph ) { addIteratorWorker(dstGraph, GraphUtil.findAll( srcGraph )); dstGraph.getEventManager().notifyAddGraph( dstGraph, srcGraph ); }
public void event(Object dest, Event event) { graph.getEventManager().notifyEvent( graph , GraphEvents.startRead ) ; } } ;
@Override public boolean accept(Triple t) { if (t.getSubject().isLiteral()) return true; if (t.getPredicate().isBlank() || t.getPredicate().isLiteral()) return true; return false; } } ) );
public static long hashTriple(Triple t) { long result = 0; Node S = t.getSubject(), P = t.getPredicate(), O = t.getObject(); if (!S.isBlank()) result = (long) S.hashCode() << 32; if (!P.isBlank()) result ^= (long) P.hashCode() << 16; if (!O.isBlank()) result ^= (long) O.hashCode(); return result; }
@Override public boolean accept( Triple t) { if (t.getSubject().isLiteral()) return true; Node n = t.getObject(); return n.isLiteral() && n.getLiteralDatatype() == FunctorDatatype.theFunctorDatatype; } };
@Override public boolean accept(Triple triple) { return triple.getPredicate().equals(subject) || triple.getPredicate().equals(predicate) || triple.getPredicate().equals(object) || ( triple.getPredicate().equals(rdfType) && triple.getObject().equals(statement) ) ; }} ;
protected static boolean equalsObjectOK( Triple t ) { Node o = t.getObject(); return o.isLiteral() ? o.getLiteralDatatype() == null : true; }
/** Answer true iff this triple can be compared for sameValueAs by .equals(), ie, it is a concrete triple with a non-literal object. */ protected final boolean isSafeForEquality( Triple t ) { return t.isConcrete() && !t.getObject().isLiteral(); } }
/** * An enhanced node is equal to another enhanced node n iff the underlying * nodes are equal. We generalise to allow the other object to be any class * implementing asNode, because we allow other implemementations of * Resource than EnhNodes, at least in principle. * This is deemed to be a complete and correct interpretation of enhanced node * equality, which is why this method has been marked final. * * @param o An object to test for equality with this node * @return True if o is equal to this node. */ @Override final public boolean equals( Object o ) { return o instanceof FrontsNode && node.equals(((FrontsNode) o).asNode()); }
@Override public void remove(Node s, Node p, Node o) { base.remove(s,p,o) ; getEventManager().notifyEvent(this, GraphEvents.remove(s, p, o) ) ; }
/** Delete triples the destination (arg 1) as given in the source (arg 2) */ public static void deleteFrom(Graph dstGraph, Graph srcGraph) { deleteIteratorWorker(dstGraph, GraphUtil.findAll( srcGraph )); dstGraph.getEventManager().notifyDeleteGraph( dstGraph, srcGraph ); }
/** Remove all triples that match by find(s, p, o) */ @Override public void remove( Node s, Node p, Node o ) { GraphUtil.remove(this, s, p, o) ; getEventManager().notifyEvent(this, GraphEvents.remove(s, p, o) ) ; }
@Override public void remove( Node s, Node p, Node o ) { getRawGraph().remove( s, p, o ); discardState(); rebind(); getEventManager().notifyEvent( this, GraphEvents.remove( s, p, o ) ); }
@Override @Deprecated public void remove( Node s, Node p, Node o ) { base.remove( s, p, o ); manager.notifyEvent( graph, GraphEvents.remove( s, p, o ) ); }
/** Answer a new graph which is the reachable subgraph from <code>node</code> in <code>graph</code> with the terminating condition given by the TripleBoundary passed to the constructor. */ public Graph extract( Node node, Graph graph ) { return extractInto( Factory.createGraphMem(), node, graph ); }
protected static boolean equalsObjectOK( Triple t ) { Node o = t.getObject(); return o.isLiteral() ? o.getLiteralDatatype() == null : true; }
@Override public void event(Object dest, Event event) { graph.getEventManager().notifyEvent( graph , GraphEvents.finishRead ) ; } } ;
public void event(Object dest, Event event) { graph.getEventManager().notifyEvent( graph , GraphEvents.finishRead ) ; } } ;
@Override public void event(Object dest, Event event) { graph.getEventManager().notifyEvent( graph , GraphEvents.startRead ) ; } } ;