I just came across a StackOverflow question,
http://stackoverflow.com/q/31496982/1281433, in which a user posted a
(slight variation of a) query that I was surprised to find is legal,
at least according to the validator at sparql.org.  It distills down
to something like this where the value of an aggregation function is
bound to a variable, but then that variable is also used in the `group
by` clause:

   select (sum(?x) as ?sum) {} group by ?sum

What are the semantics of this query?  It doesn't violate the "non
group key variable" property (like, e.g., `select (sum(?x) as ?sum) ?y
{} group by ?sum` would), but it seems like the groups have to be
determined *before* the aggregate could be computed to provide a value
on which to perform the grouping.

What's happening here?













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

Reply via email to