W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2011

test agg-err-02

From: Gregory Williams <greg@evilfunhouse.com>
Date: Wed, 28 Sep 2011 19:25:39 -0400
Message-Id: <7A09CDC2-9322-48CB-B4B9-1B6A9E009740@evilfunhouse.com>
To: SPARQL Working Group <public-rdf-dawg@w3.org>
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 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:46 GMT