All,

I have a question about what the expected results are of a query with
multiple aggregates when there are no matching solutions, specifically
if one of them is COUNT.

Take the following query for example:

PREFIX books:   <http://example.org/book/>
PREFIX dc:      <http://purl.org/dc/elements/1.1/>
select (count(?b) as ?bookCount) (min(?title) as ?firstBook)
where {
  ?b dc:title ?title
}

If you run it against the books database on sparql.org you get:
(?bookCount ?firstBook) {
  ("7"^^<http://www.w3.org/2001/XMLSchema#integer> "Harry Potter and
the Chamber of Secrets")
}

However, running it against an empty triple store (or
s/dc:title/dc:title2) brings back a resultset consisting of a single
row with both variables unbound.  Intuitively, I would expect that you
should instead get back a single binding like:
(?bookCount ?firstBook) {
  ("0"^^<http://www.w3.org/2001/XMLSchema#integer> UNDEF)
}


Does anyone know if this behavior expected?  I'm running against Fuseki 0.2.2.

-Stephen

Reply via email to