Aggregates question...

What happens when grouping for UNBOUND variables?

E.g. 

Graph:
:s1 :p :o1.
:s1 :p :o2.
:s1 :q :o3.
:s2 :p :o1.
:s2 :p :o2.

Query:

  SELECT ?Q (COUNT(?P) as ?CP)
  WHERE { ?S :p ?P  OPTIONAL {?S :q ?Q } }
  GROUP BY ?Q

My current understanding is:

  that this returns 

   ?Q | ?CP
  =========
  :o3 | 2

rather than

   ?Q | ?CP
  =========
  :o3 | 2
      | 2

yes?


In general, what is unclear to me is what ListEval returns when for ExprList = ?var and μ(?var) undefined?
It seems, strictly following the definition μ(?var) would then just amount to ?var , then again, I don't know what that 
should mean for the rest of the aggregation semantics? 

best, 
Axel

Received on Thursday, 7 October 2010 01:31:57 UTC