Evaluation when there are errors in aggregates

I tried to make ARQ exactly follow the process in the spec and found 
that the aggregate tests don't seem to have any error coverage.

- - - - - - - - - - - - - - - - - -

Steve,

I don't understand the new example in rq25:
--------------
PREFIX : <http://example.com/data/#>
SELECT ?g (AVG(?p) AS ?avg) ((MIN(?p) + MAX(?p)) / 2 AS ?c)
WHERE {
   ?g :p ?p .
}
GROUP BY ?g
--------------
Result:
?g ?avg ?c
<x> 2.5 2.5
<z> 2.5 2.5
--------------

Why not

Result:
?g ?avg ?c
<x> 2.5 2.5
<y>             2.5
<z> 2.5 2.5
representation

If AVG(?p) is an error, then the expression in the SELECT line is an 
error and so binding does not happen.

I've worked through the formal definitions and it seems to come down to:

eval(D(G), AggregateJoin(A, P) = { (aggi, eval(D(G), Ai)) | Ai in A }

and eval(D(G), Ai) being an error.

I suggest adding:

eval(D(G), AggregateJoin(A, P) =
     { (aggi, eval(D(G), Ai)) | Ai in A , eval(D(G), Ai) not an error }
     # If eval(D(G), Ai) is an error, it is ignored.

then the value for AVG is just not defined, and so (AVG(?p) AS ?avg) is 
handled by the usual mechanism.

 Andy

Received on Tuesday, 1 March 2011 11:46:57 UTC