use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractDatasetGraphFindPatterns method find_pattern_g.
@Test
public void find_pattern_g() {
DatasetGraph dsg = create(dataPattern);
List<Quad> quads1 = Iter.toList(dsg.find(node(":gx"), null, null, null));
List<Quad> quads2 = Arrays.asList(q_g, q_gs, q_gp, q_go, q_gsp, q_gso, q_gpo, q_gspo);
BaseTest.assertEqualsUnordered("find(g)", quads1, quads2);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractDatasetGraphFindPatterns method find_pattern_spo.
@Test
public void find_pattern_spo() {
DatasetGraph dsg = create(dataPattern);
List<Quad> quads1 = Iter.toList(dsg.find(null, node(":sx"), node(":px"), node(":ox")));
List<Quad> quads2 = Arrays.asList(q_spo, q_gspo);
BaseTest.assertEqualsUnordered("find(spo)", quads1, quads2);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractDatasetGraphFindPatterns method find_pattern_gs.
@Test
public void find_pattern_gs() {
DatasetGraph dsg = create(dataPattern);
List<Quad> quads1 = Iter.toList(dsg.find(node(":gx"), node(":sx"), null, null));
List<Quad> quads2 = Arrays.asList(q_gs, q_gsp, q_gso, q_gspo);
BaseTest.assertEqualsUnordered("find(gs)", quads1, quads2);
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractDatasetGraphTests method quad_02.
@Test
public void quad_02() {
DatasetGraph dsg = emptyDataset();
assertNotNull(dsg);
Quad quad = SSE.parseQuad("(quad <g> <s> <p> <o>)");
dsg.add(quad);
dsg.containsGraph(NodeFactory.createURI("g"));
dsg.delete(quad);
assertTrue(dsg.isEmpty());
assertTrue(dsg.getDefaultGraph().isEmpty());
assertTrue(dsg.getGraph(NodeFactory.createURI("g")).isEmpty());
}
use of org.apache.jena.sparql.core.DatasetGraph in project jena by apache.
the class AbstractDatasetGraphTests method deleteAny_01.
@Test
public void deleteAny_01() {
DatasetGraph dsg = emptyDataset();
Node subject = NodeFactory.createURI("http://example/s");
Node predicate = NodeFactory.createURI("http://example/p");
Node object = NodeFactory.createBlankNode();
dsg.add(new Quad(Quad.defaultGraphIRI, subject, predicate, object));
dsg.deleteAny(Node.ANY, subject, null, null);
}
Aggregations