@Override protected void flushStatements(final List<Statement> m_inserts, final List<Statement> m_removes) { // handle batch removes try { final RemoveOp rop = m_removes.size() > 0 ? new RemoveOp(m_removes) : null; final AddOp iop = m_inserts.size() > 0 ? new AddOp(m_inserts) : null; if (rop != null && iop != null) { // Execute update. m_repo.update(rop, iop); } else if (iop != null) { // Execute add m_repo.add(iop); } else if (rop != null) { // Execute remove. m_repo.remove(rop); } } catch (Exception e) { throw new RuntimeException("Unable to flush statements", e); } }
@Override protected void flushStatements(final List<Statement> m_inserts, final List<Statement> m_removes) { // handle batch removes try { final RemoveOp rop = m_removes.size() > 0 ? new RemoveOp(m_removes) : null; final AddOp iop = m_inserts.size() > 0 ? new AddOp(m_inserts) : null; if (rop != null && iop != null) { // Execute update. m_repo.update(rop, iop); } else if (iop != null) { // Execute add m_repo.add(iop); } else if (rop != null) { // Execute remove. m_repo.remove(rop); } } catch (Exception e) { throw new RuntimeException("Unable to flush statements", e); } }
repo.remove(new RemoteRepository.RemoveOp(stmts), uuid);
repo.remove(new RemoteRepository.RemoveOp(stmts), uuid);
final long mutationCount = m_repo.remove(new RemoveOp(null/* s */, RDFS.LABEL/* p */, null/* o */));
final long mutationCount = m_repo.remove(new RemoveOp(null/* s */, RDFS.LABEL/* p */, null/* o */));
final long mutationCount = m_repo.remove(new RemoveOp(null/* s */, RDFS.LABEL/* p */, null/* o */));
final long mutationCount = m_repo.remove(new RemoveOp(null/* s */, RDFS.LABEL/* p */, null/* o */));
/** * Test supposed to check if constants in BIND expressions will be resolved */ public void test_ticket_1717() throws Exception { { // Clear DB per task description (Executing the query over the empty database) m_repo.remove(new RemoveOp(null, null, null)); String query = "SELECT ?z ?s1 { ?s ?p ?o . BIND(?o+1 AS ?z) BIND(?z+1 AS ?z2) }"; final TupleQuery tq = m_repo.getBigdataSailRemoteRepository().getConnection().prepareTupleQuery(QueryLanguage.SPARQL, query, null); final TupleQueryResult tqr = tq.evaluate(); try { int count = 0; while (tqr.hasNext()) { System.out.println(tqr.next()); count++; } assertEquals(0,count); // asserting successful execution of the query, as it was failing while parsing } finally { tqr.close(); } } }
/** * Test supposed to check if constants in BIND expressions will be resolved */ public void test_ticket_1717() throws Exception { { // Clear DB per task description (Executing the query over the empty database) m_repo.remove(new RemoveOp(null, null, null)); String query = "SELECT ?z ?s1 { ?s ?p ?o . BIND(?o+1 AS ?z) BIND(?z+1 AS ?z2) }"; final TupleQuery tq = m_repo.getBigdataSailRemoteRepository().getConnection().prepareTupleQuery(QueryLanguage.SPARQL, query, null); final TupleQueryResult tqr = tq.evaluate(); try { int count = 0; while (tqr.hasNext()) { System.out.println(tqr.next()); count++; } assertEquals(0,count); // asserting successful execution of the query, as it was failing while parsing } finally { tqr.close(); } } }
protected long doDeleteWithQuery(/*final String servlet, */final String query) throws Exception { final RemoveOp remove = new RemoveOp(query); return m_repo.remove(remove); }
protected long doDeleteWithQuery(/*final String servlet, */final String query) throws Exception { final RemoveOp remove = new RemoveOp(query); return m_repo.remove(remove); }
protected long doDeleteWithAccessPath(// // final String servlet,// final URI s,// final URI p,// final Value o,// final URI... c// ) throws Exception { final RemoveOp remove = new RemoveOp(s, p, o, c); return m_repo.remove(remove); }
@Override public void remove(final Iterable<? extends Statement> stmts, final Resource... c) throws RepositoryException { final RemoveOp op = new RemoveOp(stmts); remove(op, c); }
protected long doDeleteWithAccessPath(// // final String servlet,// final URI s,// final URI p,// final Value o,// final URI... c// ) throws Exception { final RemoveOp remove = new RemoveOp(s, p, o, c); return m_repo.remove(remove); }
protected void doDeleteWithBody( /* final String servlet, */final int ntriples, final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); final RemoveOp remove = new RemoveOp(data, format); assertEquals(ntriples, m_repo.remove(remove)); }
@Override public void remove(final Resource s, URI p, Value o, final Resource... c) throws RepositoryException { final RemoveOp op = new RemoveOp(s, p, o, c); remove(op, c); }
protected void doDeleteWithBody( /* final String servlet, */final int ntriples, final RDFFormat format) throws Exception { final byte[] data = genNTRIPLES(ntriples, format); final RemoveOp remove = new RemoveOp(data, format); assertEquals(ntriples, m_repo.remove(remove)); }