use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestSolverTDB method solve_01.
@Test
public void solve_01() {
RowSet rs1 = exec("(bgp (:s :p :o))");
RowSet rs2 = results("unit");
equals(rs1, rs2);
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestSolverTDB method solve_05.
@Test
public void solve_05() {
RowSet rs1 = exec("(project (?s ?y) (bgp (?s :p ?z) (?z :q ?y)))");
RowSet rs2 = results("(row (?s :s) (?y :y))");
equals(rs1, rs2);
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestQueryExecHTTP method query_select_01.
@Test
public void query_select_01() {
try (QueryExecHTTP qExec = QueryExecHTTP.newBuilder().endpoint(dsURL).queryString("SELECT * { ?s ?p ?o }").build()) {
RowSet rs = qExec.select();
assertTrue(rs.hasNext());
rs.next();
assertFalse(rs.hasNext());
assertTrue(qExec.getHttpResponseContentType().startsWith("application/sparql-results+json"));
}
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestQueryExecHTTP method query_select_post_body.
@Test
public void query_select_post_body() {
try (QueryExecHTTP qExec = QueryExecHTTP.newBuilder().postQuery().endpoint(dsURL).queryString("SELECT * { ?s ?p ?o }").build()) {
RowSet rs = qExec.select();
assertTrue(rs.hasNext());
rs.next();
assertFalse(rs.hasNext());
assertTrue(qExec.getHttpResponseContentType().startsWith("application/sparql-results+json"));
}
}
use of org.apache.jena.sparql.exec.RowSet in project jena by apache.
the class TestQueryExecHTTP method query_select_accept_1.
@Test
public void query_select_accept_1() {
// Explicitly set the Accept header
try (QueryExecHTTP qExec = QueryExecHTTP.newBuilder().endpoint(dsURL).queryString("SELECT * { ?s ?p ?o }").acceptHeader("application/sparql-results+xml").build()) {
RowSet rs = qExec.select();
assertTrue(rs.hasNext());
rs.next();
assertFalse(rs.hasNext());
assertEquals("application/sparql-results+xml", qExec.getHttpResponseContentType());
}
}
Aggregations