Replies: 3 comments 1 reply
-
|
I think this query should give an error, because ?bookCount is an aggregate alias and should not be used inside GROUP BY. Conceptually, grouping happens before projection and aliasing, so ?bookCount doesn't exist yet at that stage. |
Beta Was this translation helpful? Give feedback.
-
It may be counter-intuitive but isn't an error per se. It's an outcome of the scoping rules: https://www.w3.org/TR/sparql11-query/#variableScope . A variable is in-scope if is potentially defined. If it is not mentioned, it isn't potentially defined, so it is not "in-scope". The The The output of the group stage can not contain a setting for If you want the intuition to happen, the variable scope table would need a new row saying any variable mentioned in There is a case to made that it should be like |
Beta Was this translation helpful? Give feedback.
-
|
Thanks Andy. Can we at least agree that including ?bookCount in GROUP BY doesn't change the query result? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a SPARQL query that had been working a while in Fuseki but recently got a report that in case of GraphDB/RDF4J implementation where it seemingly got rejected: NatLibFi/Skosmos#1857 / NatLibFi/Skosmos#1860. From that rather convoluted case I extracted this minimal example:
As it is, works in Fuseki. Should it work? SPARQL 1.1 specification does not clarify this use case. A colleague of mine thinks it should not work, however, I see a point here. In any case, this would be a great example to the SPARQL test cases to bring conforming implementations in line.
Beta Was this translation helpful? Give feedback.
All reactions