Joshua TAYLOR
2016-03-28 14:42:17 UTC
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
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
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/