use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestService method service_query_bad_no_dataset.
@Test(expected = QueryExceptionHTTP.class)
public void service_query_bad_no_dataset() {
DatasetGraph dsg = env.dsg();
dsg.executeWrite(() -> dsg.add(SSE.parseQuad("(_ :s :p :o)")));
// Not a dataset of the server
String queryString = "SELECT * { SERVICE <" + env.serverPath("JUNK") + "> { ?s ?p ?o }} ";
// Connect to local, unused, permanently empty dataset
try (RDFLink link = RDFLinkFactory.connect(localDataset())) {
try (QueryExec qExec = link.query(queryString)) {
// Where it should go wrong.
RowSet rs = qExec.select();
// Should go on execution.
rs.hasNext();
fail("Should not get here");
}
}
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestService method service_query_silent_nosite.
@Test
public void service_query_silent_nosite() {
logOnlyErrors(QueryIterService.class, () -> {
DatasetGraph dsg = env.dsg();
String queryString = "SELECT * { SERVICE SILENT <http://nosuchsite/> { VALUES ?X { 1 2 } }} ";
try (RDFLink link = RDFLinkFactory.connect(localDataset())) {
try (QueryExec qExec = link.query(queryString)) {
RowSet rs = qExec.select();
assertTrue(rs.hasNext());
Binding binding = rs.next();
assertFalse(rs.hasNext());
assertTrue(binding.isEmpty());
}
}
});
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestSolverTDB method solve_02.
@Test
public void solve_02() {
RowSet rs1 = exec("(bgp (:s :p :o2))");
RowSet rs2 = results("empty");
equals(rs1, rs2);
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestSolverTDB method solve_06.
@Test
public void solve_06() {
RowSet rs1 = exec("(bgp (:s ?p ?o))");
RowSet rs2 = results("(row (?p :p) (?o :o))", "(row (?p :p) (?o 10))", "(row (?p :p) (?o :x))");
equals(rs1, rs2);
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestSolverTDB method solve_03.
@Test
public void solve_03() {
// Above everything.
RowSet rs1 = exec("(bgp (:zzzz :p 999999))");
RowSet rs2 = results("empty");
equals(rs1, rs2);
}
Aggregations