@Test public void testDelete() throws Exception { RyaIRI predicate = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "pred")); RyaIRI subj = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, "subj")); int statement_count = 10000; for (int i = 0 ; i < statement_count ; i++){ RyaIRI obj = RdfToRyaConversions.convertIRI(VF.createIRI(litdupsNS, String.format("object%050d",i))); RyaStatement stmt = new RyaStatement(subj, predicate, obj); dao.add(stmt); } CloseableIteration<RyaStatement, RyaDAOException> iter; RyaStatement subjQuery = new RyaStatement(subj, null, null); iter = dao.getQueryEngine().query(subjQuery, conf); List<RyaStatement> stmts = new ArrayList<RyaStatement>(); while (iter.hasNext()) { stmts.add(iter.next()); } assertEquals(statement_count, stmts.size()); dao.delete(stmts.iterator(), conf); RyaStatement predQuery = new RyaStatement(null, predicate, null); iter = dao.getQueryEngine().query(predQuery, conf); int count = 0; while (iter.hasNext()) { count++; } iter.close(); assertEquals(0, count); }
@Override public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException { this.delete(Iterators.singletonIterator(stmt), aconf); }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException { this.delete(Iterators.singletonIterator(stmt), aconf); } }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException { this.delete(Iterators.singletonIterator(stmt), aconf); }  }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException { this.delete(Iterators.singletonIterator(stmt), aconf); }  @Override boolean isInitialized(); @Override void init(); @Override String getVersion(); @Override void add(final RyaStatement statement); @Override void add(final Iterator<RyaStatement> iter); @Override void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf); @Override void delete(final Iterator<RyaStatement> statements, final AccumuloRdfConfiguration conf); @Override void dropGraph(final AccumuloRdfConfiguration conf, final RyaIRI... graphs); @Override void destroy(); @Override void addNamespace(final String pfx, final String namespace); @Override String getNamespace(final String pfx); @Override void removeNamespace(final String pfx); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override CloseableIteration<Namespace, RyaDAOException> iterateNamespace(); @Override RyaNamespaceManager<AccumuloRdfConfiguration> getNamespaceManager(); @Override void purge(final RdfCloudTripleStoreConfiguration configuration); @Override void dropAndDestroy(); synchronized Connector getConnector(); synchronized void setConnector(final Connector connector); BatchWriterConfig getBatchWriterConfig(); void setBatchWriterConfig(final BatchWriterConfig batchWriterConfig); @Override synchronized AccumuloRdfConfiguration getConf(); @Override synchronized void setConf(final AccumuloRdfConfiguration conf); RyaTableMutationsFactory getRyaTableMutationsFactory(); void setRyaTableMutationsFactory(final RyaTableMutationsFactory ryaTableMutationsFactory); @Override AccumuloRyaQueryEngine getQueryEngine(); void setQueryEngine(final AccumuloRyaQueryEngine queryEngine); @Override void flush(); }
AccumuloRyaDAO implements RyaDAO<AccumuloRdfConfiguration>, RyaNamespaceManager<AccumuloRdfConfiguration> { @Override public void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf) throws RyaDAOException { this.delete(Iterators.singletonIterator(stmt), aconf); }  @Override boolean isInitialized(); @Override void init(); @Override String getVersion(); @Override void add(final RyaStatement statement); @Override void add(final Iterator<RyaStatement> iter); @Override void delete(final RyaStatement stmt, final AccumuloRdfConfiguration aconf); @Override void delete(final Iterator<RyaStatement> statements, final AccumuloRdfConfiguration conf); @Override void dropGraph(final AccumuloRdfConfiguration conf, final RyaIRI... graphs); @Override void destroy(); @Override void addNamespace(final String pfx, final String namespace); @Override String getNamespace(final String pfx); @Override void removeNamespace(final String pfx); @SuppressWarnings({ "unchecked", "rawtypes" }) @Override CloseableIteration<Namespace, RyaDAOException> iterateNamespace(); @Override RyaNamespaceManager<AccumuloRdfConfiguration> getNamespaceManager(); @Override void purge(final RdfCloudTripleStoreConfiguration configuration); @Override void dropAndDestroy(); synchronized Connector getConnector(); synchronized void setConnector(final Connector connector); BatchWriterConfig getBatchWriterConfig(); void setBatchWriterConfig(final BatchWriterConfig batchWriterConfig); @Override synchronized AccumuloRdfConfiguration getConf(); @Override synchronized void setConf(final AccumuloRdfConfiguration conf); RyaTableMutationsFactory getRyaTableMutationsFactory(); void setRyaTableMutationsFactory(final RyaTableMutationsFactory ryaTableMutationsFactory); @Override AccumuloRyaQueryEngine getQueryEngine(); void setQueryEngine(final AccumuloRyaQueryEngine queryEngine); @Override void flush();  }