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