@Override final public long removeStatements(final Resource s, final URI p, final Value o) { return removeStatements(s, p, o, null/* c */); }
@Override final public long removeStatements(final Resource s, final URI p, final Value o) { return removeStatements(s, p, o, null/* c */); }
public long removeStatements(final IChunkedOrderedIterator<ISPO> itr) { return removeStatements(itr, true/*computeClosureForStatementIdentifiers*/); }
public long removeStatements(final IChunkedOrderedIterator<ISPO> itr) { return removeStatements(itr, true/*computeClosureForStatementIdentifiers*/); }
public long removeStatements(final ISPO[] stmts, final int numStmts) { return removeStatements(new ChunkedArrayIterator<ISPO>(numStmts, stmts, null/* keyOrder */), true/*computeClosureForStatementIdentifiers*/); }
public long removeStatements(final ISPO[] stmts, final int numStmts) { return removeStatements(new ChunkedArrayIterator<ISPO>(numStmts, stmts, null/* keyOrder */), true/*computeClosureForStatementIdentifiers*/); }
/** * Removes the last statement visited from the database (non-batch API). * <p> * Note If you are trying to remove a set of statements then you are MUCH * better off collecting up a set of SPOs to be removed and then batching * the remove requests on all indices in parallel. * * @throws UnsupportedOperationException * if a ctor variant was used that did not convey the database * reference. */ public void remove() { assertOpen(); if (db == null) { throw new UnsupportedOperationException(); } if (current == null) { throw new IllegalStateException(); } db.removeStatements(new ISPO[] { current }, 1); // clear the reference. current = null; }
/** * Removes the last statement visited from the database (non-batch API). * <p> * Note If you are trying to remove a set of statements then you are MUCH * better off collecting up a set of SPOs to be removed and then batching * the remove requests on all indices in parallel. * * @throws UnsupportedOperationException * if a ctor variant was used that did not convey the database * reference. */ public void remove() { assertOpen(); if (db == null) { throw new UnsupportedOperationException(); } if (current == null) { throw new IllegalStateException(); } db.removeStatements(new ISPO[] { current }, 1); // clear the reference. current = null; }
@Override public Void call() throws Exception { final boolean bindsC = sids | quads; // Build set of distinct ISPOs. final Set<ISPO> b = acceptSolutions(context, bindsC); // Convert into array. final ISPO[] stmts = b.toArray(new ISPO[b.size()]); // System.err.println("before:\n" + tripleStore.dumpStore()); // Write on the database. final long nmodified = tripleStore.removeStatements(stmts, stmts.length); // Increment by the #of statements written. context.getStats().mutationCount.add(nmodified); // done. return null; }
@Override public Void call() throws Exception { final boolean bindsC = sids | quads; // Build set of distinct ISPOs. final Set<ISPO> b = acceptSolutions(context, bindsC); // Convert into array. final ISPO[] stmts = b.toArray(new ISPO[b.size()]); // System.err.println("before:\n" + tripleStore.dumpStore()); // Write on the database. final long nmodified = tripleStore.removeStatements(stmts, stmts.length); // Increment by the #of statements written. context.getStats().mutationCount.add(nmodified); // done. return null; }
/** * Overridden to delegate to * {@link AbstractTripleStore#removeStatements(IChunkedOrderedIterator)} in * order to (a) write on all access paths; (b) handle statement identifiers, * including truth maintenance for statement identifiers; and (c) if * justifications are being maintained, then retract justifications having * no support once the statements visitable by this access path have been * retracted. */ @Override public long removeAll() { return getRelation().getContainer().removeStatements(iterator()); }
/** * Overridden to delegate to * {@link AbstractTripleStore#removeStatements(IChunkedOrderedIterator)} in * order to (a) write on all access paths; (b) handle statement identifiers, * including truth maintenance for statement identifiers; and (c) if * justifications are being maintained, then retract justifications having * no support once the statements visitable by this access path have been * retracted. */ @Override public long removeAll() { return getRelation().getContainer().removeStatements(iterator()); }
public int flush() { if (isEmpty()) return 0; final long n; if (changeLog == null) { n = store.removeStatements(new ChunkedArrayIterator<ISPO>(numStmts,stmts, null/*keyOrder*/), computeClosureForStatementIdentifiers); } else { n = StatementWriter.removeStatements( store, new ChunkedArrayIterator<ISPO>( numStmts,stmts,null/*keyOrder*/), computeClosureForStatementIdentifiers, changeLog); } // reset the counter. numStmts = 0; // FIXME Note: being truncated to int, but whole class is deprecated. return (int) Math.min(Integer.MAX_VALUE, n); }
public int flush() { if (isEmpty()) return 0; final long n; if (changeLog == null) { n = store.removeStatements(new ChunkedArrayIterator<ISPO>(numStmts,stmts, null/*keyOrder*/), computeClosureForStatementIdentifiers); } else { n = StatementWriter.removeStatements( store, new ChunkedArrayIterator<ISPO>( numStmts,stmts,null/*keyOrder*/), computeClosureForStatementIdentifiers, changeLog); } // reset the counter. numStmts = 0; // FIXME Note: being truncated to int, but whole class is deprecated. return (int) Math.min(Integer.MAX_VALUE, n); }
public static long removeStatements(final AbstractTripleStore database, final ISPO[] stmts, final int numStmts, final boolean computeClosureForStatementIdentifiers, final IChangeLog changeLog) { final long n = database.removeStatements( new ChunkedArrayIterator<ISPO>(numStmts, stmts, null/* keyOrder */), computeClosureForStatementIdentifiers); // Copy the state of the isModified() flag and notify changeLog for (int i = 0; i < numStmts; i++) { if (stmts[i].isModified()) { // just to be safe stmts[i].setModified(ModifiedEnum.REMOVED); changeLog.changeEvent( new ChangeRecord(stmts[i], ChangeAction.REMOVED)); } } return n; }
public static long removeStatements(final AbstractTripleStore database, final ISPO[] stmts, final int numStmts, final boolean computeClosureForStatementIdentifiers, final IChangeLog changeLog) { final long n = database.removeStatements( new ChunkedArrayIterator<ISPO>(numStmts, stmts, null/* keyOrder */), computeClosureForStatementIdentifiers); // Copy the state of the isModified() flag and notify changeLog for (int i = 0; i < numStmts; i++) { if (stmts[i].isModified()) { // just to be safe stmts[i].setModified(ModifiedEnum.REMOVED); changeLog.changeEvent( new ChangeRecord(stmts[i], ChangeAction.REMOVED)); } } return n; }
if (c != null && c.length > 0) { for (Resource r : c) { nmodified += conn.getTripleStore().removeStatements(s, p, o, r); nmodified += conn.getTripleStore().removeStatements(s, p, o, null);
if (c != null && c.length > 0) { for (Resource r : c) { nmodified += conn.getTripleStore().removeStatements(s, p, o, r); nmodified += conn.getTripleStore().removeStatements(s, p, o, null);
log.info("\n" + store.dumpStore()); assertEquals(1L, store.removeStatements(null, null, B));
log.info("\n" + store.dumpStore()); assertEquals(1L, store.removeStatements(null, null, B));