test agg-err-02

Looking at some of the recently added tests, I ran across what I think is an error. In test aggregates/manifest#agg-err-02, there's an aggregate  run on the following group of values:

1, _:b2, 3, 4

The aggregate expression is:

AVG(IF(isNumeric(?p), ?p, COALESCE(xsd:double(?p),0)))

As a side note, I don't think the COALESCE is actually doing anything here, because the only non-numeric value in the data is the bnode for which the xsd:double cast will fail. If this test is supposed to be testing errors, this is really testing errors *with COALESCE*, not with aggregation.

I believe the above data and aggregate reduces to Average({ 1, 0, 3, 4 }), which should result in a value of "2"^^xsd:decimal (decimal because the operands to the underlying division are both integers). However, the srx file suggests the average operation should yield "2"^^xsd:integer.

Can somebody please take a look at the test and help me determine which of xsd:integer or xsd:decimal is the proper type for the result?

thanks,
.greg

Received on Wednesday, 28 September 2011 23:26:33 UTC