use of org.apache.jena.query.ResultSetRewindable in project Info-Evaluation by TechnionYP5777.
the class SqlTablesFiller method fillBasicInfoTable.
public void fillBasicInfoTable() throws SQLException, ParseException, ClassNotFoundException, IOException {
connector.clearBasicInfoTable();
Extractor ext = new Extractor();
ext.executeQuery(QueryTypes.BASIC_INFO);
ResultSetRewindable results = ext.getResults();
results.reset();
for (int i = 0; i < results.size(); ++i) fillBasicInfoTable(results);
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_peeking_7.
@Test
public void test_RS_peeking_7() {
// Peeking may fail if someone moves backwards in the result set
// If we hadn't moved pass the first item this should be safe
ResultSetRewindable inner = makeRewindable("x", NodeFactory.createURI("tag:local"));
ResultSetPeekable rs = ResultSetFactory.makePeekable(inner);
assertTrue(rs.hasNext());
assertNotNull(rs.peek());
// Reset the inner result set independently
inner.reset();
// Since we moved the underlying result set backwards but we hadn't gone anywhere
// we should still be able to safely access the underlying results
assertTrue(rs.hasNext());
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method make2Rewindable.
private ResultSetRewindable make2Rewindable(String var, Node val) {
ResultSet rs = make2(var, val);
ResultSetRewindable rsw = ResultSetFactory.makeRewindable(rs);
return rsw;
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_1_str.
@Test
public void test_RS_1_str() {
ResultSetRewindable rs1 = new ResultSetMem();
String x = ResultSetFormatter.asXMLString(rs1);
rs1.reset();
ResultSet rs2 = ResultSetFactory.fromXML(x);
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
use of org.apache.jena.query.ResultSetRewindable in project jena by apache.
the class TestResultSet method test_RS_cmp_1.
// Test comparison
@Test
public void test_RS_cmp_1() {
ResultSetRewindable rs1 = new ResultSetMem();
ResultSetRewindable rs2 = new ResultSetMem();
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
rs1.reset();
rs2.reset();
assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2));
}
Aggregations