Wrong query evaluation with aggregation subquery

给你一囗甜甜゛ 提交于 2019-12-02 04:26:18
Damyan Ognyanov

It is the expected behaviour. According to https://www.w3.org/TR/sparql11-query/#aggregateAlgebra if there is a GROUP BY:

Group(exprlist, Ω) = { ... | μ in Ω }

and we have no matches, then Ω is empty, so:

Group(exprlist, {}) = {}

The effect is that the subquery returns a single solution where ?myVar is unbound and the join with the next statement pattern matches everything for ?myVar. At the end you are getting a lot of solutions for the whole query.

There is even a W3C SPARQL conformance testcase covering the exact scenario:

And also an old discussion at http://answers.semanticweb.com/questions/17410/semantics-of-sparql-aggregates.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!