RepositoryModel extends AbstractLockingModel implements Model { @Override public void removeAll(Iterator<? extends Statement> iterator) throws ModelRuntimeException { if (this.isLocked()) { throw new ModelRuntimeException("Model is locked, cannot perform an update."); } assertModel(); try { ensureTransaction(); try { try { while (iterator.hasNext()) { org.eclipse.rdf4j.model.Statement s = ConversionUtil.toRDF4J(iterator.next(), this.valueFactory); this.connection.remove(s, this.rdf4jContext); } ensureAutoCommitted(); } catch (RepositoryException x) { this.connection.rollback(); } } finally { ensureAutoCommitted(); } } catch (RepositoryException x) { throw new ModelRuntimeException(x); } } RepositoryModel(Repository repository);  RepositoryModel(URI context, Repository repository); org.eclipse.rdf4j.model.IRI getRDF4JContextURI(); @Override Model open(); @Override boolean isOpen(); @Override void close(); @Override BlankNode createBlankNode(); @Override BlankNode createBlankNode(String internalID); @Override boolean isValidURI(String uriString); @Override void addStatement(Resource subject, URI predicate, Node object); @Override void removeAll(Iterator<? extends Statement> iterator); @Override void removeAll(); @Override void addAll(Iterator<? extends Statement> iterator); @Override void removeStatement(Resource subject, URI predicate, Node object); @Override ClosableIterator<org.ontoware.rdf2go.model.Statement> findStatements(
			ResourceOrVariable subject, UriOrVariable predicate, NodeOrVariable object); @Override boolean sparqlAsk(String query); @Override ClosableIterable<Statement> sparqlDescribe(String query); @Override ClosableIterable<Statement> sparqlConstruct(String query); @Override QueryResultTable querySelect(String query, String queryLanguage); @Override ClosableIterable<Statement> queryConstruct(String query, String querylanguage); @Override QueryResultTable sparqlSelect(String queryString); @Override ClosableIterator<Statement> iterator(); @Override Object getUnderlyingModelImplementation(); @Override long size(); @Override URI getContextURI(); @Override synchronized boolean isLocked(); @Override synchronized void lock(); @Override synchronized void unlock(); synchronized void rollback(); @Override void dump(); @Override void readFrom(InputStream stream); @Override void readFrom(InputStream stream, Syntax syntax); @Override void readFrom(InputStream stream, Syntax syntax, String baseURI); @Override void readFrom(Reader reader, Syntax syntax, String baseURI); void readFrom(InputStream stream, RDFFormat format, String baseURI); @Override void readFrom(Reader reader); @Override void readFrom(Reader reader, Syntax syntax); void readFrom(Reader reader, RDFFormat format, String baseURL); @Override void writeTo(OutputStream stream); @Override void writeTo(OutputStream stream, Syntax syntax); @Override void writeTo(Writer writer); @Override void writeTo(Writer writer, Syntax syntax); static RDFFormat getRDFFormat(Syntax syntax); void writeTo(RDFWriter writer); @Override @Deprecated void commit(); @Override @Deprecated void setAutocommit(boolean autocommit); @Override void finalize(); @Override boolean isIsomorphicWith(Model other); @Override synchronized void update(DiffReader diff); @Override String getNamespace(String prefix); @Override Map<String, String> getNamespaces(); @Override void removeNamespace(String prefix); @Override void setNamespace(String prefix, String namespaceURI); static final String DEFAULT_CONTEXT; static final org.eclipse.rdf4j.model.IRI DEFAULT_RDF4J_CONTEXT; }
@Override @Test public void testRemoveAll() throws Exception { Repository repo = new SailRepository(new MemoryStore()); repo.initialize(); RepositoryModelSet modelSet = new RepositoryModelSet(repo); modelSet.open(); URI context1 = new URIImpl("uri:context1"); URI context2 = new URIImpl("uri:context2"); modelSet.addStatement(context1, new URIImpl("uri:r1"), new URIImpl( "uri:p1"), new URIImpl("uri:r2")); modelSet.addStatement(context1, new URIImpl("uri:r1"), new URIImpl( "uri:p1"), new URIImpl("uri:r3")); modelSet.addStatement(context2, new URIImpl("uri:r4"), new URIImpl( "uri:p2"), new URIImpl("uri:r5")); modelSet.addStatement(context2, new URIImpl("uri:r4"), new URIImpl( "uri:p2"), new URIImpl("uri:r6")); Model model1 = modelSet.getModel(context1); model1.open(); Model model2 = modelSet.getModel(context2); model2.open(); assertEquals(4, modelSet.size()); assertEquals(2, model1.size()); assertEquals(2, model2.size()); model2.removeAll(); assertEquals(2, modelSet.size()); assertEquals(2, model1.size()); assertEquals(0, model2.size()); model1.close(); model2.close(); }