@Override public Model getDefaultModel() { return this.baseModelSet.getDefaultModel(); }
public Model getDefaultModel() { return this.baseModelSet.getDefaultModel(); }
@Override public Model getDefaultModel() { log.debug("getDefaultModel"); return new LoggingModel(this.modelset.getDefaultModel()); }
/** * Copy data from the source modelset to the target modelset. Iterates * through all named models of the source and adds each to the target. If a * named graph already exists in the target, the data will be added to it, * target models will not be replaced. * * @param source the source, data from here is taken * @param target the target, data will be put here. * @throws ModelRuntimeException if the copying process has an error */ public static void copy(ModelSet source, ModelSet target) throws ModelRuntimeException { for(Iterator<? extends Model> i = source.getModels(); i.hasNext();) { Model m = i.next(); m.open(); Model tm = target.getModel(m.getContextURI()); tm.open(); copy(m, tm); } // copy default model Model m = source.getDefaultModel(); m.open(); Model tm = target.getDefaultModel(); tm.open(); copy(m, tm); }
/** * Remove data that is listed in the source modelset from the target * modelset. Iterates through all named models of the source and removes the * listed triples from the target. * * @param source the source, data from here is evaluated * @param target the target, data contained in source and target are removed * from here * @throws ModelRuntimeException if the deleting process has an error */ public static void removeFrom(ModelSet source, ModelSet target) throws ModelRuntimeException { // remove ClosableIterator<? extends Model> it = source.getModels(); while(it.hasNext()) { Model m = it.next(); ClosableIterator<Statement> modelIt = m.iterator(); target.getModel(m.getContextURI()).removeAll(modelIt); modelIt.close(); } it.close(); // remove stuff contained in default model ClosableIterator<Statement> modelIt = source.getDefaultModel().iterator(); target.getDefaultModel().removeAll(modelIt); modelIt.close(); }