My understanding has always been that all errors are grouped together into
a single group.

Here's a nice simple query that illustrates this:

SELECT ?groupkey
WHERE
{
  VALUES ( ?a ?b)
  {
   ( 1 2 )
   ( UNDEF 2 )
   ( 1 UNDEF )
   ( UNDEF UNDEF )
  }
} 
GROUP BY (?a + ?b AS ?groupkey)

Running this will give two results, one with an unbound value for
?groupkey and one with 3 as the ?groupkey

As the editor of the query specification Andy will likely come along and
explain the mathematica better when he sees this thread

Rob



On 12/7/12 12:17 PM, "Graham Matthews" <[email protected]>
wrote:

>Hi
>
>This is kind of a JENA question, kind of a generic SPARQL question.
>
>The SPARQL 1.1 definition says:
>
>----
>Note that, although the result of a ListEval can be an error, and errors
>may be used to group, solutions containing error values are removed at
>projection time.
>
>ListEval((unbound), μ) = (error), as the evaluation of an unbound
>expression is an error.
>
>----
>
>
>I have looked at this many times and cannot figure out what it means to
>say that "errors may be used to group". To make sense of this requires
>that errors be comparable for equality (otherwise you can't group …),
>which I don't see any definition of anywhere in the SPARQL semantics.
>
>I don't even understand how it works in a really simple query grouping
>solutions from a basic graph pattern, for example:
>
>    select whatever from ..
>    where
>    {
>           ?a ?b ?c
>    }
>    group by ?a+1, ?b+2
>
>Suppose:
>-) ?a+1 produces a dynamic error but ?b+2 does not for one choice of ?a
>and ?b
>-) ?a+1 does not produce a dynamic error but ?b+2 does for a different
>choice of ?a and ?b
>
>Are these two choices place in the same group?
>
>And what happens if for two choices of ?a and ?b, ?a+1 and ?b+2 both
>produce produce dynamic errors, but different ones (we we have 4
>different kinds of errors)? Are they in the same group? And are they in
>the same group as the previous example?
>
>My gut says that what was intended here was SQL style null groupings
>(which are horrible, but ..). But the mathematics in the definition isn't
>clear.
>
>Any SPARQL gurus know what is meant to happen for grouping here?
>
>thanks
>graham
>

Reply via email to