public boolean isResultSet() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; return resultSet != null ; }
public boolean isResultSet() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; return resultSet != null ; }
public boolean isGraph() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; return model != null ; }
public boolean isBoolean() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; return booleanResult != null ; }
public ResultSet getResultSet() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; if ( ! isResultSet() ) throw new ResultSetException("Not a ResultSet result") ; return resultSet ; }
public ResultSet getResultSet() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; if ( ! isResultSet() ) throw new ResultSetException("Not an ResultSet result") ; return resultSet ; }
public Model getModel() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; if ( ! isModel() ) throw new ResultSetException("Not a graph result") ; return model ; }
public boolean getBooleanResult() { if ( ! hasBeenSet ) throw new ResultSetException("Not set") ; if ( ! isBoolean() ) throw new ResultSetException("Not a boolean result") ; return booleanResult.booleanValue() ; }
public boolean getBooleanResult() { if ( isResultSet() ) throw new ResultSetException("Not a boolean result") ; return askResult ; }
private void staxError(String msg) { Log.warn(this, "StAX error: "+msg) ; throw new ResultSetException(msg) ; }
private void staxError(String msg, Throwable th) { Log.warn(this, "StAX error: "+msg, th) ; throw new ResultSetException(msg, th) ; } }
public boolean hasNext() { if (!isResultSet) throw new ResultSetException("Not an XML result set"); if (finished) return false; if (binding == null) { binding = getOneSolution(); row++; } return binding != null; }
private static void checkContains(JsonObject term, String...keys) { List<String> x = Arrays.asList(keys) ; for ( String k : term.keys() ) { if ( !x.contains(k) ) throw new ResultSetException("Expected only object keys "+Arrays.asList(keys)+" but encountered '"+k+"'") ; } } }
private static JsonObject toJSON(InputStream in) { try { JsonObject json = JSON.parse(in) ; return json; } catch (JsonException e) { throw new ResultSetException(e.getMessage(), e); } }
public static boolean booleanFromXML(InputStream in) { { JSONInput jin = new JSONInput(in, null) ; if(!jin.isResultSet() ) return jin.getBooleanResult() ; throw new ResultSetException("Not a boolean result") ; } }
private void processResults() { try { JsonObject results = json.get(dfResults).getAsObject() ; // ordered = results.getAsBoolean(dfOrdered) ; // distinct = results.getBoolean(dfDistinct) ; } catch (JsonException e) { throw new ResultSetException(e.getMessage(), e) ; } }
public void binding(String varName, RDFNode node) { if (node == null && !outputExplicitUnbound) return; try { JsonObject val = valueAsJSON(node) ; currentSolution.put(varName, val) ; } catch (JsonException ex) { throw new ResultSetException(ex.getMessage(), ex); } }
public static ResultSet fromXML(String str, Model model) { XMLInputStAX x = new XMLInputStAX(str, model) ; if ( !x.isResultSet() ) throw new ResultSetException("Not a result set") ; return x.getResultSet() ; }
private void processBoolean() { try { askResult = json.get(dfBoolean).getAsBoolean().value(); } catch (JsonException e) { throw new ResultSetException(e.getMessage(), e) ; } }
private static String stringOrNull(JsonObject obj, String key) { JsonValue v = obj.get(key) ; if ( v == null ) return null ; if ( ! v.isString() ) throw new ResultSetException("Not a string: key: "+key) ; return v.getAsString().value(); }