public void run(RepositoryConnection con) throws RepositoryException { con.remove(subj, pred, obj, contexts); } });
@Override public boolean remove(Resource resource, IRI iri, Value value, Resource... resources) { rc.remove(resource, iri, value, resources); // note: we don't know whether any statements are removed return false; }
public void run(RepositoryConnection con) throws RepositoryException { con.remove(subj, pred, obj, contexts); } });
@Override protected synchronized void removeIteration(Iterator<Statement> iter, Resource subj, URI pred, Value obj, Resource... contexts) { try { con.remove(subj, pred, obj, contexts); size = -1; } catch (RepositoryException e) { throw new ModelException(e); } }
protected void removeStatementsInternal(Resource subj, IRI pred, Value obj, Resource... contexts) throws SailException { try { repoConnection.remove(subj, pred, obj, contexts); } catch (RepositoryException e) { throw new SailException(e); } }
@Override public void remove(final Iterable<? extends Statement> statements) throws IOException, IllegalStateException { Preconditions.checkNotNull(statements); checkWritable(); try { this.dirty = true; this.connection.remove(statements); } catch (final RepositoryException ex) { throw new DataCorruptedException("Error while removing statements", ex); } }
@Override protected boolean doRemove(@Nullable final Resource subj, @Nullable final URI pred, @Nullable final Value obj, final Resource[] ctxs) { try { final long size = this.connection.size(); this.connection.remove(subj, pred, obj, ctxs); return this.connection.size() != size; } catch (final RepositoryException ex) { throw new ModelException(ex); } }
@Override protected synchronized void addWithoutCommit(Resource subject, URI predicate, Value object, Resource... contexts) throws RepositoryException { if (!removed.hasStatement(subject, predicate, object, false, contexts)) { added.add(subject, predicate, object, contexts); } removed.remove(subject, predicate, object, contexts); }
@Override public boolean removeAll(Iterator<? extends Atom> atom) throws AtomSetException { try { this.connection.remove(new StatementIterator(atom)); } catch (RepositoryException e) { throw new AtomSetException("Error while removing the atoms.", e); } return true; }
private void doDelete(final RepositoryConnection conn, final int loop, final int index) throws RepositoryException { final ValueFactory vf = conn.getValueFactory(); final URI context = vf.createURI("context:loop:" + loop + ":item:" + index); final Collection<Statement> statements = getStatementsForContext(conn, context); for (Statement statement : statements) { conn.remove(statement, context); } }
@Test public void testGetContextIDs() throws Exception { assertThat(Iterations.asList(testCon.getContextIDs()).size(), is(equalTo(0))); // load data testCon.add(bob, name, nameBob, context1); assertThat(Iterations.asList(testCon.getContextIDs()), is(equalTo(Arrays.asList((Resource)context1)))); testCon.remove(bob, name, nameBob, context1); assertThat(Iterations.asList(testCon.getContextIDs()).size(), is(equalTo(0))); testCon.add(bob, name, nameBob, context2); assertThat(Iterations.asList(testCon.getContextIDs()), is(equalTo(Arrays.asList((Resource)context2)))); }
@Override public Object execute(Object repository, Map<String, Object> operationParam) { String relationName = (String) operationParam.get("relationName"); Repository repo = (Repository) repository; try { repo.getConnection().remove((Resource)null, repo.getConnection().getValueFactory().createURI(relationName), (Resource)null,(Resource)null); } catch (Exception e) { return e; } return null; }
@Test public void testInferredStatementCount() throws Exception { assertThat(testCon.isEmpty(), is(equalTo(true))); int inferred = getTotalStatementCount(testCon); URI root = vf.createURI("urn:root"); testCon.add(root, RDF.TYPE, RDF.LIST); testCon.remove(root, RDF.TYPE, RDF.LIST); assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(getTotalStatementCount(testCon), is(equalTo(inferred))); }
@Override public void removeStatement(Statement statement) throws ModelRuntimeException { this.assertModel(); try { org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(statement, this.valueFactory); this.connection.remove(s, s.getContext()); } catch(RepositoryException e) { throw new ModelRuntimeException(e); } }
public void removeStatement(Statement statement) throws ModelRuntimeException { this.assertModel(); try { org.openrdf.model.Statement s = ConversionUtil.toOpenRDF(statement, this.valueFactory); this.connection.remove(s, s.getContext()); } catch (RepositoryException e) { throw new ModelRuntimeException(e); } }
public void execute(RepositoryConnection con) throws RepositoryException { con.remove(getSubject(), getPredicate(), getObject(), getContexts()); }
public void testInferencerUpdates() throws Exception { testCon.setAutoCommit(false); testCon.add(bob, name, nameBob); testCon.remove(bob, name, nameBob); testCon.setAutoCommit(true); assertFalse(testCon.hasStatement(bob, RDF.TYPE, RDFS.RESOURCE, true)); }
private void doDelete(final RepositoryConnection conn, final int loop, final int index) throws RepositoryException { final ValueFactory vf = conn.getValueFactory(); final URI context = vf.createURI("context:loop:" + loop + ":item:" + index); final Collection<Statement> statements = getStatementsForContext(conn, context); for (Statement statement : statements) { conn.remove(statement, context); } }
@Test public void testInferredStatementCount() throws Exception { assertThat(testCon.isEmpty(), is(equalTo(true))); int inferred = getTotalStatementCount(testCon); URI root = vf.createURI("urn:root"); testCon.add(root, RDF.TYPE, RDF.LIST); testCon.remove(root, RDF.TYPE, RDF.LIST); assertThat(testCon.isEmpty(), is(equalTo(true))); assertThat(getTotalStatementCount(testCon), is(equalTo(inferred))); }
public void testInferredStatementCount() throws Exception { assertTrue(testCon.isEmpty()); int inferred = getTotalStatementCount(testCon); URI root = vf.createURI("urn:root"); testCon.add(root, RDF.TYPE, RDF.LIST); testCon.remove(root, RDF.TYPE, RDF.LIST); assertTrue(testCon.isEmpty()); assertEquals(inferred, getTotalStatementCount(testCon)); }