public ResultSet getResultSet() { if ( !hasBeenSet ) throw new ResultSetException("Not set"); if ( !isResultSet() ) throw new ResultSetException("Not a ResultSet result"); return resultSet; }
public Iterator<JsonObject> getJsonItems() { if ( !hasBeenSet ) throw new ResultSetException("Not set"); if ( !isJson() ) throw new ResultSetException("Not a JSON result"); return jsonItems; }
public Boolean getBooleanResult() { if ( !hasBeenSet ) throw new ResultSetException("Not set"); if ( !isBoolean() ) throw new ResultSetException("Not a boolean result"); return booleanResult; }
@Test public void test_RS_3() { ResultSetRewindable rs1 = new ResultSetMem() ; Model model = RDFOutput.encodeAsModel(rs1) ; rs1.reset() ; ResultSet rs2 = RDFInput.fromRDF(model) ; assertTrue(ResultSetCompare.equalsByTerm(rs1, rs2)) ; }
public static ResultSet fromXML(InputStream in, Model model) { return make(in, model).getResultSet(); }
public static boolean booleanFromXML(InputStream in) { return make(in, null).getBooleanResult(); }
public static boolean booleanFromJSON(InputStream input) { return make(input).getBooleanResult(); }
/** * Take a copy of a result set - the result set returns is an in-memory * copy. It is not attached to the original query execution object which can * be closed. * * @param results * @return ResultSet */ static public ResultSetRewindable copyResults(ResultSet results) { return new ResultSetMem(results); }
public Model getModel() { if ( !hasBeenSet ) throw new ResultSetException("Not set"); if ( !isModel() ) throw new ResultSetException("Not a graph result"); return model; }
public Dataset getDataset() { if ( !hasBeenSet ) throw new ResultSetException("Not set"); if ( !isDataset() ) throw new ResultSetException("Not a dataset result"); return dataset; }
/** * Output an ASK answer * @param out OutputStream * @param answer The boolean answer */ public static void out(OutputStream out, boolean answer) { TextOutput tFmt = new TextOutput((SerializationContext)null) ; tFmt.format(out, answer) ; }
public static void apply(ResultSet rs, ResultSetProcessor proc) { ResultSetApply rsa = new ResultSetApply(rs, proc); rsa.apply(); } }
/** Output a result set in the XML format, inserting a style sheet in the XML output * * @param outStream output stream * @param qresults result set * @param stylesheet The URL of the stylesheet */ static public void outputAsXML(OutputStream outStream, ResultSet qresults, String stylesheet) { XMLOutput xOut = new XMLOutput(stylesheet) ; xOut.format(outStream, qresults) ; }
/** Moves onto the next result possibility. * The returned object should be of class QuerySolution */ @Override public QuerySolution next() { return nextSolution() ; }
public static ResultSet fromXML(Reader in, Model model) { return make(in, model).getResultSet(); }
public static boolean booleanFromXML(String str) { return make(str, null).getBooleanResult(); }
public static ResultSet fromXML(String str, Model model) { return make(str, model).getResultSet(); }