@Override public BiConsumer<Model, Model> accumulator() { return (m1, m2) -> m1.remove(m1.difference(m2)); } }
public void modify(Model model){ model.add(this.statementsToAdd); model.remove(this.statementsToRemove); } }
@Override public Statement removeEdge(RDFNode sourceVertex, RDFNode targetVertex) { Statement result = getEdge(sourceVertex, targetVertex); if(result != null) { model.remove(result); } return result; }
/** * <p>Remove the given individual from the set of instances that are members of * this class. This is effectively equivalent to the {@link Individual#removeOntClass} method, * but invoked via the class resource rather than via the individual resource.</p> * @param individual A resource denoting an individual that is no longer to be a member * of this class */ @Override public void dropIndividual( Resource individual ) { getModel().remove( individual, RDF.type, this ); }
/** * <p>Remove the specific RDF property-value pair from this DAML resource.</p> * * @param property The property to be removed * @param value The specific value of the property to be removed */ @Override public void removeProperty( Property property, RDFNode value ) { getModel().remove( this, property, value ); }
/** Remove a specified property-value pair, if it exists */ protected void removePropertyValue( Property prop, String name, RDFNode value ) { checkProfile( prop, name ); getModel().remove( this, prop, value ); }
@Override public SecuredModel remove(final List<Statement> statements) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException { checkUpdate(); if (!canDelete(Triple.ANY)) { for (final Statement s : statements) { checkDelete(s); } } holder.getBaseItem().remove(statements); return holder.getSecuredItem(); }
@Override public Alt setDefault(RDFNode o) { Statement stmt = getDefaultStatement(); if (stmt != null) getModel().remove( stmt ); getModel().add( this, RDF.li(1), o ); return this; }
@Override public SecuredModel remove(final Statement[] statements) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException { checkUpdate(); if (!canDelete(Triple.ANY)) { for (final Statement s : statements) { checkDelete(s); } } holder.getBaseItem().remove(statements); return holder.getSecuredItem(); }
@Override public Container remove(Statement s) { // System.err.println( "]] SeqImpl.remove " + s ); getModel().remove(s); // System.err.println( "]] SeqImpl.remove - about to shift down " + (s.getPredicate().getOrdinal()+1) + " to " + (size()+1) ); shiftDown(s.getPredicate().getOrdinal()+1, size()+1); // System.err.println( "]] SeqImpl.remov completed" ); return this; }
public void testDeleteStatementArray() { model.register(SL); final Statement[] s = ModelHelper.statements(model, "a P b; c Q d"); model.remove(s); SL.assertHas(new Object[] { "remove[]", Arrays.asList(s) }); }
public void testDeleteStatementList() { model.register(SL); final List<Statement> lst = Arrays.asList(ModelHelper.statements(model, "b I g; model U g")); model.remove(lst); SL.assertHas(new Object[] { "removeList", lst }); }
protected void shiftUp(int start, int finish) { Statement stmt = null; for (int i = finish; i >= start; i--) { stmt = getRequiredProperty(RDF.li(i)); getModel().remove(stmt); addProperty(RDF.li(i+1), stmt.getObject()); } } protected void shiftDown(int start, int finish) {
public void testBulkRemoveSelf() { final Model m = ModelHelper.modelWithStatements(this, "they sing together; he sings alone"); m.remove(m); Assert.assertEquals("", 0, m.size()); }
/** * <p>Remove the statement that the given string provides version information about * this resource. If this statement * is not true of the current model, nothing happens.</p> * @param info A version information string to be removed */ @Override public void removeVersionInfo( String info ) { checkProfile( getProfile().VERSION_INFO(), "VERSION_INFO" ); Literal infoAsLiteral = ResourceFactory.createPlainLiteral( info ); getModel().remove( this, getProfile().VERSION_INFO(), infoAsLiteral ); }
public void testDeleteModel() { model.register(SL); final Model m = ModelHelper.modelWithStatements(this, "NT beats S; S beats H; H beats D"); model.remove(m); SL.assertHas(new Object[] { "removeModel", m }); }
@Override public SecuredModel remove(final Resource s, final Property p, final RDFNode o) throws UpdateDeniedException, DeleteDeniedException, AuthenticationRequiredException { checkUpdate(); checkDelete(new Triple(s.asNode(), p.asNode(), o.asNode())); holder.getBaseItem().remove(s, p, o); return holder.getSecuredItem(); }
public void testRemoveSingleStatements() { final Statement S = ModelHelper.statement(model, "D E F"); model.register(SL); model.add(S); model.remove(S); SL.assertHas(new Object[] { "add", S, "remove", S }); }
@Override public Seq set(int index, Object o) { checkIndex(index); Statement s = getRequiredProperty(RDF.li(index)) ; Model m = s.getModel() ; Statement s2 = m.createLiteralStatement(s.getSubject(), s.getPredicate(), o) ; s.getModel().remove(s) ; s.getModel().add(s2) ; //getRequiredProperty(RDF.li(index)).changeObject(o); return this; }
public void testBulkDeleteByModelReifying() { final Model target = ModelHelper.modelWithStatements(this, ""); addReification(target, "x", "S P O"); addReification(target, "y", "A P B"); final Model remove = ModelHelper.modelWithStatements(this, ""); addReification(remove, "y", "A P B"); final Model answer = ModelHelper.modelWithStatements(this, ""); addReification(answer, "x", "S P O"); target.remove(remove); ModelHelper.assertIsoModels(answer, target); }