Fix: query over empty optional aggregate; added test and fix for issue #2229 by WhiteGobo · Pull Request #2448 · RDFLib/rdflib (original) (raw)

testing counting of optional nodes. Zero optional nodes may throw a NotBoundError
Added fix for NotBoundError, for this test.

Summary of changes

As stated in issue 2229 a sparql query fails, if you count over an aggregate of optional values and zero values where found.
This patch catches the resulting NotBoundError and enables with that the count over the empty value-list. Also added the reason for the catch as comment.
Also added a test, that makes such a query.

Checklist