Unexpected results with non aggregate expressions
The behavior of Tracker with a query like:
SELECT ?c ?u {
?u nfo:belongsToContainer ?c
}
GROUP BY ?c
is non-canon. We essentially do the equivalent to:
SELECT ?c (SAMPLE(?u) AS ?sample) {
?u nfo:belongsToContainer ?c
}
GROUP BY ?c
According to https://www.w3.org/TR/sparql11-query/#aggregateRestrictions, In a query level which uses aggregates, only expressions consisting of aggregates and constants may be projected, (besides) [...] GROUP BY [...] simple expressions consisting of just a variable.
And wikidata seems to agree, returning a BadAggregate error.
I don't think this behavior was consciously intended, so it might make sense to adopt sparql1.1 behavior, now that we implement SAMPLE
for it...