@Override public void removeAll() throws ModelRuntimeException { this.jenaModel.removeAll(); }
public Model removeAll() { return model.removeAll(); }
/** * {@inheritDoc} */ @Override public Model removeAll() { return super.object.removeAll(); }
/** * {@inheritDoc} */ @Override public Model removeAll(Resource s, Property p, RDFNode r) { return super.object.removeAll(s, p, r); }
public Model removeAll(Resource s, Property p, RDFNode r) { return model.removeAll(s, p, r); }
/** * Removes all triples from the Jena Model and than calls {@link #close()} * to free remaining resources. Note that in Jena TDB a named model is * deleted if no more triples with the given context are present within * the {@link Quad} store of the Jena TDB {@link DatasetGraph}. */ public void delete(){ this.model.removeAll(); close(); }
/** * Lazy loader for the a local default model. * * @return the a local default model. */ Model model() { return localDataset.getDefaultModel().removeAll(); } }
public static Model removeAllContents() { return persistentModel().removeAll(); }
public void removeNamedModel(String uri) { getNamedModel(uri).removeAll(); }
@Override public void removeAll() throws ModelRuntimeException { // Empty the default graph this.dataset.getDefaultModel().removeAll(); // Remove all named graphs Iterator<String> it = this.dataset.listNames(); while (it.hasNext()) { it.next(); it.remove(); } }
public void replaceNamedModel(String uri, Model model) { Model m = getNamedModel(uri); m.removeAll(); m.add(model); }
public void clearNamedModel(String name) { if (name == null) { logger.info("cannot clear the model because the given name is null."); return; } if (!this.dataset.containsNamedModel(name)) { logger.info("The model " + name + " does not exist in the repository."); return; } this.dataset.getNamedModel(name).removeAll(); this.dataset.getNamedModel(name).commit(); }
public static void replaceModelElements(Model dest, Model src) { if (src == dest) { return; } dest.removeAll(); dest.add(src); dest.setNsPrefixes(src.getNsPrefixMap()); // dest.getGraph().getPrefixMapping().equals(obj) //if (src.getGraph() )dest.setNsPrefix("", src.getNsPrefixURI("")); ///dest.setNsPrefix("#", src.getNsPrefixURI("#")); }
public void setResource(Resource resource) { StmtIterator itr = resource.listProperties(); model.removeAll(); model.add(itr); res = (Resource) resource.inModel(model); }
/** * Lazy loader for a named model. * * @param uri the model URI. * @return the named model associated with the given URI. */ Model model(final String uri) { Model model = localDataset.getNamedModel(uri); if (model == null) { model = ModelFactory.createDefaultModel(); localDataset.addNamedModel(uri, model); } model.removeAll(); return model; }
public void addModel(Model m, String name) { if (name == null) { logger.info("cannot add the model because the given name is null."); return; } Model namedModel = this.dataset.getNamedModel(name); namedModel.removeAll(); namedModel.add(m.listStatements()); namedModel.setNsPrefixes(m.getNsPrefixMap()); namedModel.commit(); TDB.sync(this.dataset); }
private void restitchItemLists(Model given, Model recon) { Statement G = given.listStatements(ANY, API.items, ANY).toList().get(0); Resource page = G.getSubject(); // Statement S = recon.listStatements(ANY, API.items, ANY).toList().get(0); Resource items = S.getObject().asResource(); S.remove(); recon.add(page, API.items, items); recon.removeAll(ANY, others, ANY); }
@Test public void ensureRespectsDataypesByType() { Model m = ModelIOUtils.modelFromTurtle( spec ); m.removeAll( null, RDF.type, OWL.DatatypeProperty ); Resource ft = m.createResource( m.expandPrefix( ":faketype" ) ); m.add( ft, RDF.type, RDFS.Datatype ); // ensureRespectsDatatypes( m ); }
@Test public void update3() { Dataset ds = TDBFactory.createDataset() ; ds.asDatasetGraph().getDefaultGraph().add(t1) ; ds.getNamedModel(graphName).getGraph().add(t1) ; Model m = ds.getDefaultModel() ; m.removeAll() ; assertEquals(0, m.size()) ; // But still in the other graph assertTrue(ds.getNamedModel(graphName).getGraph().contains(t1)) ; }
@Test public void update4() { Dataset ds = TDBFactory.createDataset() ; ds.asDatasetGraph().getDefaultGraph().add(t1) ; ds.getNamedModel(graphName).getGraph().add(t1) ; Model m = ds.getNamedModel(graphName) ; m.removeAll() ; assertEquals(0, m.size()) ; // But still in the other graph assertTrue(ds.getDefaultModel().getGraph().contains(t1)) ; }