/** Answer the event manager for this graph; allocate a new one if required. Subclasses may override if they have a more specialised event handler. The default is a SimpleEventManager. */ public GraphEventManager getEventManager() { if (gem == null) gem = new SimpleEventManager( this ); return gem; }
/** * override graphBaseFind to return an iterator that will report when * a deletion occurs. */ @Override protected final ExtendedIterator<Triple> graphBaseFind( TripleMatch m ) { return SimpleEventManager.notifyingRemove( this, this._graphBaseFind( m ) ); }
@Override public void notifyDeleteIterator( Graph g, Iterator<Triple> it ) { notifyDeleteIterator( g, IteratorCollection.iteratorToList( it ) ); }
@Override public void notifyAddIterator( Graph g, Iterator<Triple> it ) { notifyAddIterator( g, IteratorCollection.iteratorToList( it ) ); }
@Override public ExtendedIterator<Triple> find( Node s, Node p, Node o ) { return SimpleEventManager.notifyingRemove( this, base.find( s, p, o ) ); }
@Override public ExtendedIterator<Triple> find( TripleMatch m ) { return SimpleEventManager.notifyingRemove( this, base.find( m ) ); }
/** Answer the event manager for this graph; allocate a new one if required. Subclasses may override if they have a more specialised event handler. The default is a SimpleEventManager. */ @Override public GraphEventManager getEventManager() { if (gem == null) gem = new SimpleEventManager( this ); return gem; }
@Override public ExtendedIterator<Triple> find( Node s, Node p, Node o ) { return SimpleEventManager.notifyingRemove( this, base.find( s, p, o ).filterDrop( new Filter<Triple>() { @Override public boolean accept(Triple t) { if (t.getSubject().isLiteral()) return true; if (t.getPredicate().isBlank() || t.getPredicate().isLiteral()) return true; return false; } } ) ); }
@Override public GraphEventManager getEventManager() { if (eventManager == null) { eventManager = new SimpleEventManager(this); } return eventManager; }
@Override public ExtendedIterator<Triple> graphBaseFind( TripleMatch m ) { Iterator<Triple> iter = triples.iterator() ; return SimpleEventManager.notifyingRemove( this, iter ) .filterKeep ( new TripleMatchFilterEquality( m.asTriple() ) ); }
@Override public GraphEventManager getEventManager() { if (gem == null) gem = new SimpleEventManager( this ); return gem; }
@Override protected ExtendedIterator<Triple> graphBaseFind(TripleMatch m) { Iterator<Triple> iter = triples.iterator() ; return SimpleEventManager.notifyingRemove( this, iter ) .filterKeep ( new TripleMatchFilterEquality( m.asTriple() ) ); }
@Override protected ExtendedIterator<Triple> graphBaseFind( final TripleMatch m ) { ExtendedIterator<Triple> iter =null; if (iteratorDeleteAllowed) { iter = SimpleEventManager.notifyingRemove( this, triples.iterator() ); } else { iter = WrappedIterator.createNoRemove( triples.iterator() ); } return iter .filterKeep ( new TripleMatchFilterEquality( m.asTriple() ) ); }
/** * <p> * Answer an iterator over the triples in the union of the graphs in this composition. <b>Note</b> * that the requirement to remove duplicates from the union means that this will be an * expensive operation for large (and especially for persistent) graphs. * </p> * * @param t The matcher to match against * @return An iterator of all triples matching t in the union of the graphs. */ @Override public ExtendedIterator<Triple> graphBaseFind( final TripleMatch t ) { // optimise the case where there's only one component graph. ExtendedIterator<Triple> found = optimiseOne() ? singleGraphFind( t ) : multiGraphFind( t ); return SimpleEventManager.notifyingRemove( MultiUnion.this, found ); }