good evening,
> On 2017-11-04, at 17:34, Andy Seaborne <[email protected]> wrote:
>
>
>
> On 04/11/17 13:46, james anderson wrote:
>> good afternoon;
>>> On 2017-11-04, at 12:18, Andy Seaborne <[email protected]> wrote:
>>>
>>> Following on from the thread in October "Problem with MAX when no result
>>> expected" <https://s.apache.org/03Hz> here is an investigation into SPARQL
>>> Aggregation, both what the spec says and what ARQ does.
>>>
>>> It would be interesting to get reports about other implementations for
>>> these two queries:
>>>
>>> Q1: SELECT (COUNT(*) AS ?C1) { ?s ?p ?o FILTER(false) }
>>> Q2: SELECT (COUNT(*) AS ?C2) { ?s ?p ?o FILTER(false) } GROUP BY ?s
>
> For clarity:
>
>> http://dydra.com/jhacker/foaf/@query#q1 : 0
>
> Is that zero rows or one row with single columns with C1 being value 0?
>
>> http://dydra.com/jhacker/foaf/@query#q2 : no result
>
> Is that zero rows or execution error/illegal query?
the urls locate runnable queries.
if you hit the “run” button, the answers to those questions should appear.
>
>>> Throughout this, it does not matter if there is a GROUP BY clause or not
>>> because "Group" is the empty set ∅ in both cases.
>> there is a reading of the recommendation text according to which the two
>> sets which are empty are not of the same kind.
>> in one case, the set is that over which the aggregation operations run and
>> in that case, the result is 0.
>> in the other case it is the set of groups, in which case, there is no set of
>> solutions over which to run the aggregation and therefore there is no result.
>
> Maybe, maybe not. Please quote the text that gives the alternative reading.
> I don't see reading that mentions kinds.
>
> I missed the fact that when there is no GROUP BY the group key is some
> constant like 1.
>
> But that does not change anything because Group() is defined in a way that
> uses the rows matching WHERE{} in a foreach and foreach of Ω = empty set is
> the empty set.
>
> Group(exprlist, Ω) = { ListEval(exprlist, μ) -> ... | μ in Ω }
>
> so if there are no μ, ListEval is not evaluated and Group() is the empty set.
> There is only one empty set. It does not carry any indication of use of GROUP
> BY or not.
yes, but it is not a set of solutions, it is a set of keys which are to be used
to partition solutions.
>
> By the end of Group() the situation is the same
as what?
> so the result will be the same for what ever reading of the rest of the
> process (there are some parts I'm not completely confident with yet).
as is evident from my comment above, i do not read the document in a way which
agrees with this claim.
>
> Specifically, for no GROUP BY the result is not a map of the constant to the
> empty multiset {1 -> {}}
agreed, it is a set of solutions.
which may be empty, bit is not the same this as an empty set of mappings from
keys to sets of solutions.
>
>> is there some way to read the text such that the empty set of groups
>> transforms into an empty set of solutions?
>
> Not that I can see; it should be covered by {1 -> {}} vs {} butthat
> distinction is lost at Group().
i read the passage which describes aggregation under 18.5
Aggregation(exprlist, func, scalarvals, { key1→Ω1, ..., keym→Ωm } ) = {
(key, F(Ω)) | key → Ω in { key1→Ω1, ..., keym→Ωm } }
to reduce, in the case where no key is generated, to
Aggregation(exprlist, func, scalarvals, { } )
how else is that to be read?
best regards, from berlin,
---
james anderson | [email protected] | http://dydra.com