Re: Initial draft of Design:Aggregate

Thanks Andy.

I've extended the syntax to include a 'HAVING' expression.  I still need to
reconcile the functions in the draft formulization with the algebraic
operators in the previous section to determine the specific changes needed
to support the semantics of HAVING.

The intuition, however, is for the Aggregation operator to take an
additional argument that is the boolean expression to use as a selection
criteria while performing the aggregation.  The expression will include
references to aggregate functions that will be evaluated in the same way as
the function(s) given in FuncAndVars, except their values aren't returned as
bindings but rather are used to evaluate the expressions to determine which
solution mappings are discarded

One outstanding issue with the grammar changes is that the PrimaryExpression
used within HavingExpression would need to be different from the
PrimaryExpression used elsewhere insofar as references to aggregate
functions will need to be added to that part of the grammar.

-- Chimezie


On 8/21/09 5:11 AM, "Seaborne, Andy" <andy.seaborne@hp.com> wrote:

> I've added the definitions text to the wiki page.
> 
> Andy
> 
>> -----Original Message-----
>> From: Chimezie Ogbuji [mailto:ogbujic@ccf.org]
>> Sent: 11 August 2009 14:41
>> To: Seaborne, Andy; SPARQL Working Group
>> Subject: Re: Initial draft of Design:Aggregate
>> 
>> Hey Andy
>> 
>> 
>> On 8/10/09 9:10 AM, "Seaborne, Andy" <andy.seaborne@hp.com> wrote:
>>>> http://www.w3.org/2009/sparql/wiki/Design:Aggregate
>>> Hi Chime,
>>> Yes - including LaTeX is hard. I think you can cut-and-paste the symbols
>> into
>>> the wiki text because it's all UTF-8 HTML but that's a bit fragile and only
>>> marginally better.
>> 
>> Okay, thanks.  I'll give that a try
>> 
>>> I took tried to write out some formal definitions to check my
>> understanding:
>>> is this the sort of thing you had in mind?
>>> 
>>> 
>>> Single valued function: returns a solution projected down to named
>> variables
>>> only:
>>>   key(varlist, mu) = { (v,x) | (v,x) in mu, v in varlist }
>>> 
>>> and the set of all keys:
>>>   key(varlist, Omega) = { k | mu in Omeag, k=key(varlist,mu) }
>>> 
>>> The partition of the multiset Omega is:
>>>   Partition(varlist, Omega) = { (k,mu) | mu in Omega, k=key(varlist, mu) }
>> 
>> Yes, this needs to return a set from the multiset and varlist in order to
>> ensure uniqueness of the partitions.
>> 
>>> Let agg(VarList,SubOmega) be the aggregation function run on a multiset of
>>> solutions taking variables VarList
>>> 
>>> Aggregation(VarList, FuncAndVars, Omega, Mu) =
>>>    { merge(k, (Vout, agg(Vin,X)) | (k, X) in Partition(varlist, Omega),
>>> FuncAndVars=(f, Vin, Vout), agg in set f }
>> 
>> I believe we are on the same page.
>> 
>>> Aside: we may need to restrict variable Vout so it does not clash with the
>>> key.
>> 
>> Yes.
>> 
>>> One last point: do we want GROUP BY expressions, not just variables?  In
>> think
>>> we do; does create some issues about the projected down variables that are
>>> arguments to the partitioning expression.
>>> Some SQL systems put a random
>>> selection (AKAK first found?) but I prefer to not include the variables of
>> an
>>> expression at all so as to get ehy same results each time.
>>> 
>>> Andy
>> 
>> Good question, I don't know off head (will need to chew on that).
>> 
>> -- Chimezie
>> 
>> 
>> ===================================
>> 
>> P Please consider the environment before printing this e-mail
>> 
>> Cleveland Clinic is ranked one of the top hospitals
>> in America by U.S. News & World Report (2008).
>> Visit us online at http://www.clevelandclinic.org for
>> a complete listing of our services, staff and
>> locations.
>> 
>> 
>> Confidentiality Note:  This message is intended for use
>> only by the individual or entity to which it is addressed
>> and may contain information that is privileged,
>> confidential, and exempt from disclosure under applicable
>> law.  If the reader of this message is not the intended
>> recipient or the employee or agent responsible for
>> delivering the message to the intended recipient, you are
>> hereby notified that any dissemination, distribution or
>> copying of this communication is strictly prohibited.  If
>> you have received this communication in error,  please
>> contact the sender immediately and destroy the material in
>> its entirety, whether electronic or hard copy.  Thank you.
> 


===================================

P Please consider the environment before printing this e-mail

Cleveland Clinic is ranked one of the top hospitals
in America by U.S. News & World Report (2008).  
Visit us online at http://www.clevelandclinic.org for
a complete listing of our services, staff and
locations.


Confidentiality Note:  This message is intended for use
only by the individual or entity to which it is addressed
and may contain information that is privileged,
confidential, and exempt from disclosure under applicable
law.  If the reader of this message is not the intended
recipient or the employee or agent responsible for
delivering the message to the intended recipient, you are
hereby notified that any dissemination, distribution or
copying of this communication is strictly prohibited.  If
you have received this communication in error,  please
contact the sender immediately and destroy the material in
its entirety, whether electronic or hard copy.  Thank you.

Received on Monday, 24 August 2009 17:43:13 UTC