use of org.apache.jena.sparql.syntax.Element in project jena by apache.
the class AbstractTestUpdateGraph method testModify2.
@Test
public void testModify2() {
// Use blank nodes (will expose any problems in serialization when spill occurs)
Triple t = new Triple(org.apache.jena.graph.NodeFactory.createBlankNode(), p, o2);
DatasetGraph gStore = getEmptyDatasetGraph();
// Set the threshold to in order to force spill to disk
gStore.getContext().set(ARQ.spillToDiskThreshold, 0L);
defaultGraphData(gStore, data(t));
namedGraphData(gStore, graphIRI, data(t));
UpdateModify modify = new UpdateModify();
Element element = QueryFactory.createElement("{ ?s <http://example/p> ?o }");
modify.setElement(element);
modify.getInsertAcc().addQuad(new Quad(graphIRI, triple1));
modify.getDeleteAcc().addTriple(SSE.parseTriple("(?s <http://example/p> ?o)"));
modify.getDeleteAcc().addQuad(SSE.parseQuad("(<http://example/graph> ?s <http://example/p> ?o)"));
UpdateAction.execute(modify, gStore);
assertFalse(graphEmpty(gStore.getGraph(graphIRI)));
assertTrue(graphEmpty(gStore.getDefaultGraph()));
assertTrue(graphContains(gStore.getGraph(graphIRI), triple1));
assertFalse(graphContains(gStore.getGraph(graphIRI), t));
}
Aggregations