use of org.apache.jena.query.ResultSet in project jena by apache.
the class TestResultSet method test_RS_cmp_3.
@Test
public void test_RS_cmp_3() {
ResultSet rs1 = make("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
ResultSet rs2 = new ResultSetMem();
assertFalse(ResultSetCompare.equalsByTerm(rs1, rs2));
}
use of org.apache.jena.query.ResultSet in project jena by apache.
the class TestResultSet method test_RS_7.
// Into some format.
@Test
public void test_RS_7() {
ResultSet rs = ResultSetFactory.load("testing/ResultSet/output.srx");
test_RS_fmt(rs, ResultsFormat.FMT_RS_XML, true);
}
use of org.apache.jena.query.ResultSet in project jena by apache.
the class TestResultSet method test_RS_cmp_4.
@Test
public void test_RS_cmp_4() {
ResultSet rs1 = make("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
ResultSet rs2 = make("x", org.apache.jena.graph.NodeFactory.createURI("tag:local"));
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
use of org.apache.jena.query.ResultSet in project jena by apache.
the class TestResultSet method test_RS_peeking_5.
@Test
public void test_RS_peeking_5() {
// Peeking should be able to cope with people moving on the underlying result set independently
ResultSet inner = new ResultSetMem(make("x", NodeFactory.createURI("tag:local")), make("x", NodeFactory.createURI("tag:local")));
ResultSetPeekable rs = ResultSetFactory.makePeekable(inner);
assertTrue(rs.hasNext());
assertNotNull(rs.peek());
// Move on the inner result set independently
inner.next();
// Since we fiddled with the underlying result set there won't be further elements available anymore
assertFalse(rs.hasNext());
}
use of org.apache.jena.query.ResultSet in project jena by apache.
the class FusekiConfig method servicesAndDatasets.
private static List<DataAccessPoint> servicesAndDatasets(Model model) {
// Old style configuration file : server to services.
DatasetDescriptionRegistry dsDescMap = FusekiServer.registryForBuild();
// ---- Services
ResultSet rs = FusekiLib.query("SELECT * { ?s fu:services [ list:member ?service ] }", model);
List<DataAccessPoint> accessPoints = new ArrayList<>();
if (!rs.hasNext())
// No "fu:services ( .... )" so try looking for services directly.
// This means Fuseki2, service configuration files (no server section) work for --conf.
rs = FusekiLib.query("SELECT ?service { ?service a fu:Service }", model);
for (; rs.hasNext(); ) {
QuerySolution soln = rs.next();
Resource svc = soln.getResource("service");
DataAccessPoint acc = FusekiBuilder.buildDataAccessPoint(svc, dsDescMap);
accessPoints.add(acc);
}
return accessPoints;
}
Aggregations