Re: Evaluation when there are errors in aggregates

On 2011-03-01, at 11:46, Andy Seaborne wrote:

> 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

Are you suggesting that the result with 3 solutions is correct as per working group decisions, or as per the algebra as it stands?

> 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.

I was hoping to make it bubble up to use the same mechanism as Project Expressions, wouldn't think happen?

The next stage after AggregateJoin will be a Project, and doesn't Project discard solutions that contain errors?

- Steve

-- 
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD

Received on Tuesday, 1 March 2011 12:03:38 UTC