Hi Andy,

I'm not using QueryExecution here, I'm trying to parse JSON read from HTTP
InputStream using ResultSetFactory.fromJSON().

Then I want to carry the result set, maybe do some logic based on it, and
possibly serialize it back using ResultSetFormatter.

Is that not possible with ASK result?

On Mon, Mar 12, 2018 at 9:46 AM, Andy Seaborne <a...@apache.org> wrote:

>
>
> 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(ResultSetFac
>> tory.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
>>
>>

Reply via email to