Open knoan opened 9 years ago
I have been able to recreate this error locally and reported to development to look into ....
Not sure that my expectations are correct here… the ability to filter on projected aggregates is likely to be a (handy) extension of sesame/jena beyond what specified by the standard.
SPARQL 1.1 paragraph "18.2.4.2 HAVING" states that "expressions projected by the SELECT clause are not visible to the HAVING clause". In other words, variable ?count gets its value after filtering of grouped solutions by HAVING.
The right variant of the query would be
select ?s (count(?o) as ?count) from virtrdf: where { ?s ?p ?o } group by ?s having (count(?o) > 3)
( "from virtrdf:" added to make the sample practical on big databases)
Spot on…
Fails unexpectedly with