Discussion:
GROUP_CONCAT problem from Jena
Andy Seaborne
2016-03-28 10:43:54 UTC
Permalink
Encountered " "distinct" "DISTINCT "" at line 6, column 129

Check the syntax at that point.

(GROUP_CONCAT DISTINCT (?x) ...

is wrong.

Andy
Hi there,
list, or you sent a message before replying to the acknowledgement. Your
email has ended up in the moderators inbox. If you are not subscribed,
you will not see replies to your question.
Please could you subscribe by sending an email to
then reply to the confirmation.
After that, please could you re-send the message.
You will then receive all replies that are sent to the list.
http://jena.apache.org/help_and_support/index.html
Andy
Dears,
I've been having this problem since a long time and unfortunately no
one on StackOverFlow could find the solution. It is definitely a bug
in Jena, could you have a look please?
https://stackoverflow.com/questions/36137483/sparql-query-works-on-the-fuseki-interface-but-in-jena
Joshua TAYLOR
2016-03-28 15:27:40 UTC
Permalink
Post by Andy Seaborne
Encountered " "distinct" "DISTINCT "" at line 6, column 129
Check the syntax at that point.
(GROUP_CONCAT DISTINCT (?x) ...
is wrong.
Andy,

I actually started another thread about this (not knowing about this
one), and that error looks like it might on Jena's end. If you throw,
e.g.,

select (group_concat(distinct ?x) as ?y) {}

into the validator on sparql.org, it parses it and formats it as

select (group_concat distinct (?x) as ?y) where {}

If Jena's parsing it and sending the re-formatted query along, the
remote endpoint would complain about the injected syntax error.
Post by Andy Seaborne
Andy
Hi there,
list, or you sent a message before replying to the acknowledgement. Your
email has ended up in the moderators inbox. If you are not subscribed,
you will not see replies to your question.
Please could you subscribe by sending an email to
then reply to the confirmation.
After that, please could you re-send the message.
You will then receive all replies that are sent to the list.
http://jena.apache.org/help_and_support/index.html
Andy
Dears,
I've been having this problem since a long time and unfortunately no
one on StackOverFlow could find the solution. It is definitely a bug
in Jena, could you have a look please?
https://stackoverflow.com/questions/36137483/sparql-query-works-on-the-fuseki-interface-but-in-jena
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Joshua TAYLOR
2016-03-28 15:33:50 UTC
Permalink
Post by Joshua TAYLOR
Post by Andy Seaborne
Encountered " "distinct" "DISTINCT "" at line 6, column 129
Check the syntax at that point.
(GROUP_CONCAT DISTINCT (?x) ...
is wrong.
Andy,
I actually started another thread about this (not knowing about this
one), and that error looks like it might on Jena's end. If you throw,
e.g.,
select (group_concat(distinct ?x) as ?y) {}
into the validator on sparql.org, it parses it and formats it as
select (group_concat distinct (?x) as ?y) where {}
If Jena's parsing it and sending the re-formatted query along, the
remote endpoint would complain about the injected syntax error.
Is it significant that

https://github.com/apache/jena/blob/0653392c24d6ec0d83c97c77f789a85b3c3b79de/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggGroupConcat.java#L71

appends a group_concat with a following (, whereas

https://github.com/apache/jena/blob/0653392c24d6ec0d83c97c77f789a85b3c3b79de/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggGroupConcat.java#L91

doesn't?
Post by Joshua TAYLOR
Post by Andy Seaborne
Andy
Hi there,
list, or you sent a message before replying to the acknowledgement. Your
email has ended up in the moderators inbox. If you are not subscribed,
you will not see replies to your question.
Please could you subscribe by sending an email to
then reply to the confirmation.
After that, please could you re-send the message.
You will then receive all replies that are sent to the list.
http://jena.apache.org/help_and_support/index.html
Andy
Dears,
I've been having this problem since a long time and unfortunately no
one on StackOverFlow could find the solution. It is definitely a bug
in Jena, could you have a look please?
https://stackoverflow.com/questions/36137483/sparql-query-works-on-the-fuseki-interface-but-in-jena
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Andy Seaborne
2016-03-28 16:51:57 UTC
Permalink
Post by Joshua TAYLOR
Post by Joshua TAYLOR
Post by Andy Seaborne
Encountered " "distinct" "DISTINCT "" at line 6, column 129
Check the syntax at that point.
(GROUP_CONCAT DISTINCT (?x) ...
is wrong.
Andy,
I actually started another thread about this (not knowing about this
one), and that error looks like it might on Jena's end. If you throw,
e.g.,
select (group_concat(distinct ?x) as ?y) {}
into the validator on sparql.org, it parses it and formats it as
select (group_concat distinct (?x) as ?y) where {}
If Jena's parsing it and sending the re-formatted query along, the
remote endpoint would complain about the injected syntax error.
Is it significant that
https://github.com/apache/jena/blob/0653392c24d6ec0d83c97c77f789a85b3c3b79de/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggGroupConcat.java#L71
appends a group_concat with a following (, whereas
https://github.com/apache/jena/blob/0653392c24d6ec0d83c97c77f789a85b3c3b79de/jena-arq/src/main/java/org/apache/jena/sparql/expr/aggregate/AggGroupConcat.java#L91
doesn't?
Hi Joshua,

Thanks for taking the time to investigate.

Good news - this is a fixed bug.
https://issues.apache.org/jira/browse/JENA-1091

so it is not in 3.0.1 release, getting fix on the day of the release, 3
days after the build.

asSparqlExpr is the method that creates SPARQL syntax:
and it says:

x.append("GROUP_CONCAT(") ;
if ( isDistinct )
x.append("DISTINCT ") ;

so it is GROUP_CONCAT(DISTINCT ...) now.

prefixGroupConcatString creates syntax for the algebra form.

sparql.org is not up-to-date - unfortunately that machine (it's part of
the Apache infrastructure and a FreeBSD host machine running with jails
to isolate services) does not have an installable Java8 so it is not
up-to-date. It needs migrating sometime.

Andy

The OP is currently bombarding the users@ moderator with emails due to
not subscribing.
Post by Joshua TAYLOR
Post by Joshua TAYLOR
Post by Andy Seaborne
Andy
Hi there,
list, or you sent a message before replying to the acknowledgement. Your
email has ended up in the moderators inbox. If you are not subscribed,
you will not see replies to your question.
Please could you subscribe by sending an email to
then reply to the confirmation.
After that, please could you re-send the message.
You will then receive all replies that are sent to the list.
http://jena.apache.org/help_and_support/index.html
Andy
Dears,
I've been having this problem since a long time and unfortunately no
one on StackOverFlow could find the solution. It is definitely a bug
in Jena, could you have a look please?
https://stackoverflow.com/questions/36137483/sparql-query-works-on-the-fuseki-interface-but-in-jena
--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/
Joshua TAYLOR
2016-03-28 17:09:09 UTC
Permalink
Post by Andy Seaborne
Hi Joshua,
Thanks for taking the time to investigate.
Good news - this is a fixed bug.
https://issues.apache.org/jira/browse/JENA-1091
Great!
Post by Andy Seaborne
subscribing.
That's unfortunate. I'm not quite sure that the OP understands
exactly what mailing lists are [1].

[1] http://stackoverflow.com/questions/36137483/sparql-query-works-on-the-fuseki-interface-but-in-jena/36261611?noredirect=1#comment60159162_36261611
--
Joshua Taylor
Loading...