Subject: CAP Query Language: Proposition to query properties with multiple occurrences

From: Patrice Lapierre <[email-masked]>
Date: 11 Jan 2002 10:03:36 -0500

A previous post by John Stracke raised the point that queries on
properties with multiple occurrences are ambiguous.

  I would like to propose an extension to the CAP query language, 
that is not part of SQL-92. It addresses some of the issues related to 
properties with multiple occurrences.

Here's an example to introduce the proposition:

The query: "All VEVENTs accepted by user1 and user2"

Could be written as follows:

  SELECT * FROM  VEVENT 
    USING ATTENDEE AS ATT1,
          ATTENDEE AS ATT2
    WHERE ATT1.PARTSTAT = 'ACCEPTED' AND ATT1 = [email-masked]' AND
          ATT2.PARTSTAT = 'ACCEPTED' AND ATT2 = [email-masked]'

The proposition adds two new keywords: "USING" and "AS".
   
The optional USING clause with elements has the form:
   
   PROPERTYNAME "AS" IDENT

The semantic could be described as follows:   

   For every element (PROPERTYNAME, IDENT) of the USING clause,
there exist at least one property PROPERTYNAME, say P, in all 
components of the FROM section that satisfies the expression
of the WHERE section after substituting all occurrences of
IDENT by the property P.

---

From: "John Stracke" <[email-masked]>
Date: Fri, 11 Jan 2002 10:54:59 -0500

>          ATT2.PARTSTAT = 'ACCEPTED' AND ATT2 = [email-masked]'

Possibly.  On a CS with a SQL backend, this would then translate into 
joining with the ATTENDEE table twice.  Might not be efficient, but it's 
straightforward.

Bruce, is this something that your engine could reasonably handle?

/===========================================================\
|John Stracke                   |Principal Engineer         |
[email-masked]  |Incentive Systems, Inc.    |
|http://www.incentivesystems.com|My opinions are my own.    |
|===========================================================|
|We must be devious, cunning, inventive... too bad we're us.|
\===========================================================/