use of org.apache.jena.sparql.modify.request.UpdateDataDelete in project jena by apache.
the class UpdateBuilderTest method testDeleteValueReplacement.
@Test
public void testDeleteValueReplacement() {
Var v = Var.alloc("v");
UpdateBuilder builder = new UpdateBuilder();
builder.addDelete(v, p, o);
builder.setVar(v, s);
Update update = builder.build();
assertTrue(update instanceof UpdateDataDelete);
UpdateDataDelete udd = (UpdateDataDelete) update;
List<Quad> quads = udd.getQuads();
assertEquals(1, quads.size());
Quad q = quads.get(0);
assertEquals(Quad.defaultGraphNodeGenerated, q.getGraph());
assertEquals(s, q.getSubject());
assertEquals(p, q.getPredicate());
assertEquals(o, q.getObject());
}
use of org.apache.jena.sparql.modify.request.UpdateDataDelete in project jena by apache.
the class UpdateBuilderTest method testDelete_GSPO.
@Test
public void testDelete_GSPO() {
UpdateBuilder builder = new UpdateBuilder();
builder.addDelete(g, s, p, o);
Update update = builder.build();
assertTrue(update instanceof UpdateDataDelete);
UpdateDataDelete udd = (UpdateDataDelete) update;
List<Quad> quads = udd.getQuads();
assertEquals(1, quads.size());
Quad q = quads.get(0);
assertEquals(g, q.getGraph());
assertEquals(s, q.getSubject());
assertEquals(p, q.getPredicate());
assertEquals(o, q.getObject());
}
Aggregations