On 18/07/11 15:16, Schmitz, Jeffrey A wrote:
Hello, I've recently updated to the latest jena and arq libraries and
have noticed a change in how the COUNT aggregate works when counting
OPTIONAL variables.  Specifically, in the past if there were no
matches for an optional variable, the COUNT aggregate function would
fill its specified variable with a value of zero.  However, now no
results at all are returned for these cases.  E.g. for the following
query...

SELECT * WHERE { { SELECT ?class ((COUNT(?inst)) AS ?instCount) WHERE
{ ?class rdfs:subClassOf<http://www.boeing.com/IVHM/MySuperClass>  .
OPTIONAL { ?inst a ?class . } . } GROUP BY ?class } . }

If there are no matches for the ?inst variable for a particular
?class value, before upgrading the ?instCount variable would be
filled with the value 0 and the row would be returned.  Now however,
I get no matched rows returned.  Just wondering, is this a "bug", or
is this a new interpretation for how aggregates of OPTIONAL variables
are going to be handled.

Thanks, Jeff

What was the previous version you are upgrading from?

Try:

http://www.openjena.org/repo-dev/com/hp/hpl/jena/arq/2.8.9-SNAPSHOT/

which has fixes in subquery evaluation which might affect the execution and also some changes to make the way COUNT() operates in the presence of errors (evaluating ?inst is an error as it's unbound).

(Sample data and complete query would also be helpful)

        Andy


Reply via email to