Re: another aggregates test case...

I would expect this query to be an error, yes.

I'd also be happy to define an aggregate query as any query in which:

1. A GROUP BY clause is present, OR
2. An aggregate is included in the query projection


On 6/8/2010 9:07 AM, Axel Polleres wrote:
> Student of mine pointed me to a somewhat corner test case:
> PREFIX rdf:<>
> PREFIX rdfs:<>
> PREFIX dcterms:<>
> PREFIX foaf:<>
> PREFIX mpp:<>
>   ?project rdf:type foaf:Project ;
>            rdfs:label ?title .
>   ?person rdf:type mpp:Person ;
>            rdfs:label ?personName ;
>            foaf:currentProject ?project .
> }
> GROUP BY ?project
> Actually, I *think* this should be syntactically invalid, as per:
> "In aggregate queries and sub-queries only expressions which have been used as GROUP BY expressions, or aggregated expressions (i.e. expressions where all variables appear inside an aggregate) can be projected."
> interestingly, the formulation - strictly speaking - doesn't say what an aggregate query is, but GROUP BY without aggregtate doesn't make a lot of sense anyways, except that it should have the same effect as DISTINCT, right(?), but we still don't want to allow in the presence of GROUP BY some non-grouped/aggregated things to be projected, I assume.
> Axel

Received on Tuesday, 8 June 2010 13:47:32 UTC