On Mon, Mar 28, 2016 at 10:46 AM, Lorenz B.
<[email protected]> wrote:
> Hi Joshua,
>
> just what I know about Jena so far:
>
> if a Query object is created first, yes it's parsed and probably converted
> into what you showed as being non-legal SPARQL. The parsing can be avoided
> with QueryEngineHttp which sends the plain query string.

Yeah, that's the approach that Andy has mentioned before on an
answers.semanticweb.com answer [2], and that's what I passed on to the
Stack Overflow user.  It's a really weird bug though, if that's what's
actually happening.

Unfortunately, the user said that he did ask on the Jena mailing list,
and got the same response that I initially provide, "it looks like
you've got a typo, are you **sure** that you're showing us the code
that you're running?".  (I think that's a completely reasonable
response, especially with non-minimal examples, though.)  I wonder if
this has bitten anyone else in recent times?

Joshua

[2] 
http://answers.semanticweb.com/questions/19935/jena-throws-queryparsingexception-on-correct-but-non-standard-sparql

>
> Kind regards,
> Lorenz
>
>> In a Stack Overflow question [1] a user seems to be running up against
>> a syntax error when running a query from Java that they're not getting
>> when they run the same query from a Fuseki web interface.  Looking
>> into it, there's something weird going on, and it shows up in
>> sparql.org's query parser [2].  If you enter the query
>>
>>      select (group_concat(distinct ?x) as ?y) (sum(distinct ?x) as ?z) {}
>>
>> into the parser, the formatted, parsed query appears as:
>>
>>      SELECT  (GROUP_CONCAT DISTINCT (?x) AS ?y) (SUM(DISTINCT ?x) AS ?z)
>> WHERE {}
>>
>> which is *not* legal. (Note the off placement of distinct with the
>> GROUP_CONCAT.)
>>
>> When a query is sent to a remote endpoint using Jena, does Jena first
>> parse the input query, and then send the reformatted query off to the
>> remote endpoint?  That would explain the user's weird experience, but
>> I'm not sure whether that's how things are implemented or not.
>>
>> Joshua
>>
>>
>> [1] http://stackoverflow.com/q/36137483/1281433
>> [2] http://sparql.org/validate/query
>>
> --
> Lorenz Bühmann
> AKSW group, University of Leipzig
> Group: http://aksw.org - semantic web research center
>



-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

Reply via email to