use of org.apache.jena.graph.compose.DisjointUnion in project jena by apache.
the class TestDisjointUnion method testRightUnion.
public void testRightUnion() {
Graph g = graphWith("");
testSingleComponent(g, new DisjointUnion(Graph.emptyGraph, g));
}
use of org.apache.jena.graph.compose.DisjointUnion in project jena by apache.
the class TestDisjointUnion method testBothComponents.
public void testBothComponents() {
Graph L = graphWith(""), R = graphWith("");
Graph du = new DisjointUnion(L, R);
assertIsomorphic(Graph.emptyGraph, du);
L.add(triple("x P y"));
assertIsomorphic(graphWith("x P y"), du);
R.add(triple("A rdf:type Route"));
assertIsomorphic(graphWith("x P y; A rdf:type Route"), du);
}
use of org.apache.jena.graph.compose.DisjointUnion in project jena by apache.
the class TestDisjointUnion method testLeftUnion.
public void testLeftUnion() {
Graph g = graphWith("");
testSingleComponent(g, new DisjointUnion(g, Graph.emptyGraph));
}
use of org.apache.jena.graph.compose.DisjointUnion in project jena by apache.
the class TestDisjointUnion method testAddLeftOnlyIfNecessary.
public void testAddLeftOnlyIfNecessary() {
Graph L = graphWith(""), R = graphWith("x R y");
Graph du = new DisjointUnion(L, R);
graphAdd(du, "x R y");
assertEquals(true, L.isEmpty());
graphAdd(du, " a P b");
assertIsomorphic(graphWith("a P b"), L);
assertIsomorphic(graphWith("x R y"), R);
}
use of org.apache.jena.graph.compose.DisjointUnion in project jena by apache.
the class TestDisjointUnion method testRemoveBoth.
public void testRemoveBoth() {
Graph L = graphWith("x R y; a P b"), R = graphWith("x R y; p Q r");
Graph du = new DisjointUnion(L, R);
du.delete(triple("x R y"));
assertIsomorphic(graphWith("a P b"), L);
assertIsomorphic(graphWith("p Q r"), R);
}
Aggregations