On 11/03/18 23:03, Martynas Jusevičius wrote:
Hi,
I'm getting the following JSON result from an ASK query:
{ "head": {}, "boolean": true }
However, the method that usually works fine, will not parse it from
InputStream (Jena 3.0.1):
org.apache.jena.sparql.resultset.ResultSetException: Not a ResultSet
result
org.apache.jena.sparql.resultset.SPARQLResult.getResultSet(SPARQLResult.java:94)
org.apache.jena.sparql.resultset.JSONInput.fromJSON(JSONInput.java:64)
org.apache.jena.query.ResultSetFactory.fromJSON(ResultSetFactory.java:331)
I stepped inside the code and I see that JSONObject is parsed fine, but
afterwards SPARQLResult.resultSet field is not being set for some reason.
Any ideas?
The outcome of an ASK query is a boolean, not a ResultSet.
See execAsk.
SPARQLResult is the class for a holder of any SPARQL result type.
Andy
Martynas