use of org.apache.jena.graph.compose.Delta in project jena by apache.
the class TestDelta method testDeleteThenAdd.
public void testDeleteThenAdd() {
Graph base = graphWith(DEFAULT_TRIPLES);
Delta delta = new Delta(base);
delta.delete(triple("p S q"));
delta.add(triple("p S q"));
assertIsomorphic(graphWith(DEFAULT_TRIPLES), base);
assertIsomorphic(graphWith(""), delta.getAdditions());
assertIsomorphic(graphWith(""), delta.getDeletions());
assertIsomorphic(graphWith(DEFAULT_TRIPLES), delta);
}
use of org.apache.jena.graph.compose.Delta in project jena by apache.
the class TestDelta method testTerms1.
public void testTerms1() {
Triple t1 = triple("s p 1");
Triple t01 = triple("s p 01");
Graph base = newGraph();
base.add(t1);
Delta delta = new Delta(base);
delta.add(t01);
assertTrue(delta.getAdditions().contains(triple("s p 01")));
assertFalse(delta.getAdditions().contains(triple("s p 1")));
assertTrue(delta.contains(t1));
assertTrue(delta.contains(t01));
}
Aggregations