use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testDelete3.
@Test
public void testDelete3() {
DatasetGraph gStore = getEmptyDatasetGraph();
defaultGraphData(gStore, graph1);
QuadDataAcc acc = new QuadDataAcc();
UpdateDataDelete delete = new UpdateDataDelete(acc);
acc.addTriple(triple1);
UpdateAction.execute(delete, gStore);
assertTrue(graphEmpty(gStore.getDefaultGraph()));
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testBad.
private void testBad(String file, int expectedSize) {
DatasetGraph gStore = getEmptyDatasetGraph();
script(gStore, file);
assertEquals(expectedSize, countQuads(gStore));
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testDelete1.
@Test
public void testDelete1() {
DatasetGraph gStore = getEmptyDatasetGraph();
QuadAcc acc = new QuadAcc();
UpdateDeleteWhere delete = new UpdateDeleteWhere(acc);
UpdateAction.execute(delete, gStore);
assertTrue(graphEmpty(gStore.getDefaultGraph()));
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testUpdateScript1.
@Test
public void testUpdateScript1() {
DatasetGraph gStore = getEmptyDatasetGraph();
script(gStore, "update-1.ru");
assertTrue(graphContains(gStore.getDefaultGraph(), new Triple(s, p, NodeFactoryExtra.parseNode("123"))));
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractTestUpdateGraph method testInsert4.
@Test
public void testInsert4() {
DatasetGraph gStore = getEmptyDatasetGraph();
defaultGraphData(gStore, graph1);
UpdateModify insert = new UpdateModify();
insert.getInsertAcc().addTriple(SSE.parseTriple("(?s <http://example/p> 1066)"));
Element element = QueryFactory.createElement("{ ?s <http://example/p> 2007 }");
insert.setElement(element);
UpdateAction.execute(insert, gStore);
assertTrue(graphContains(gStore.getDefaultGraph(), triple2));
}
Aggregations