On 08/12/12 02:00, Graham Matthews wrote:
OK I think I see the source of my confusion

The definition says

-----

Definition: ListEval

ListEval((expr1, ..., exprn), μ) returns a list (e1, ..., en), where ei = 
expri(μ) or error.

ListEval retains errors resulting from the evaluation of the list elements.

-----

The "or error", is that supposed to mean that e_i = expr_i(u) or error, or is 
it supposed to mean that the entire ListEval() can return error?

I read it the first way, which would allow a list of error entries, but I am 
guessing that you are reading the second way?

Yes - the latter.

it's a tuple of valid values or it is an error. Not a tuple of values / errors.

        Andy


graham



On Dec 7, 2012, at 3:05 PM, Andy Seaborne wrote:

On 07/12/12 21:13, Rob Vesse wrote:
My understanding has always been that all errors are grouped together into
a single group.

Yes.

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

I could waffle about "one point extension of the value space of the expression being 
grouped"

Or just say that all evaluations yielding 'error' get put into the same group.

If the group key is composite, any error makes the whole key an error ... see 
below ...


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 is always an error - can't have literals as subjects!

-) ?a+1 does not produce a dynamic error but ?b+2 does for a different
choice of ?a and ?b

The group key is the pair (?a+1, ?b+2) and if either are an error, then the 
whole key is an error.



Are these two choices place in the same group?

Yes.


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.

SQL Null is a bit different - it is a real value [*] you can talk about, whereas SPARQL 
treats the group key as (A,B) and if either A or B are an error, the whole key for the 
group is the "error" key.


        Andy

[*] aside from the that fact that "null = null" is false

Any SPARQL gurus know what is meant to happen for grouping here?

thanks
graham




-----

The information contained in this message (including any files transmitted with 
this message) may contain proprietary, trade secret or other confidential 
and/or legally privileged information. Any pricing information contained in 
this message (or in any files transmitted with this message) is confidential 
and cannot be shared with any third parties without prior written approval from 
OrangeDog. This message is intended to be read only by the individual or entity 
to whom it is addressed or by their designee. If the reader of this message is 
not the intended recipient, you are on notice that any use, disclosure, copying 
or distribution of this message, in any form, is strictly prohibited. If you 
have received this message in error, please immediately notify the sender 
and/or OrangeDog and destroy all copies of this message in your possession, 
custody or control.




Reply via email to