Subject: Re: 6.1.1 CAL-QUERY Value Type (Updated QUERY ABNF)

From: Doug Royer <[email-masked]>
Date: Sat, 02 Nov 2002 11:34:51 -0700

I believe this ABNF allows for VEVENT.prop-name as noted in the original
email...

     cal-query  = "SELECT"   SP   cap-val  SP
                  "FROM"     SP   comp-name SP
                  "WHERE"    SP   cap-expr

                / "SELECT" SP cap-cols SP
                  "FROM"   SP comp-name

      cap-val   = cap-cols / param
                / ( cap-val "," cap-val )

                ; NOTE: there is NO space around the "," on
                ; the next line
      cap-cols  = cap-col / ( cap-cols "," cap-col)
                / "*"

                ; A 'cap-col' is:
                ;
                ; Any property name ('cap-prop') found in the component
                ; named in the 'comp-name' used in the "FROM" clause.
                ;
                ;   SELECT ORGANIZER FROM VEVENT ...
                ;
                ; OR
                ;
                ; A component name ('comp-name') of an existing component
                   ; contained inside of the 'comp-name' used in the "FROM"
                   ; clause.
                ;
                ;   SELECT VALARM FROM VEVENT ...
                ;
                ; OR
                ;
                ; A component name ('comp-name') of an existing
                ; component contained inside of the 'comp-name' used
                ; in the "FROM" clause folowed by a property
                ; name ('cap-prop') to be selected from that component.
                ; (comp-name "." cap-prop)
                ;
                ;   SELECT VALARM.TRIGGER FROM VEVENT ...

      cap-col    = comp-name
                 / comp-name "." cap-prop

      comp-name  = "VEVENT"  / "VTODO"     / "VJOURNAL" / "VFREEBUSY"
                 / "VALARM"  / "DAYLIGHT"  / "STANDARD" / "VAGENDA"
                 / "VCAR"    / "VCALSTORE" / "VQUERY"   / "VTIMEZONE"
                 / x-comp    / iana-comp

      cap-prop   = ; A property that may be in the 'cap-comp' named
                   ; in the "SELECT" clause.

      cap-expr   = "(" cap-expr ")"
              / cap-term

      cap-term   = cap-expr SP cap-logical SP cap-expr
              / cap-factor

      cap-logical= "AND" / "OR"

      cap-factor = cap-colval SP cap-oper SP col-value
              / cap-colval SP "NOT LIKE" SP col-value
              / cap-colval SP "LIKE" SP col-value
              / cap-colval SP "IS NULL"
              / cap-colval SP "IS NOT NULL"
              / col-value SP "NOT IN" cap-colval"
              / col-value SP "IN" cap-colval"
              / "STATE()" "=" ( "BOOKED"
                               / "UNPROCESSED"
                               / "DELETED" )

      cap-colval = cap-col /  param

      param      = "PARAM(" cap-col "," cap-param ")"

      cap-param  = ; Any parameter that may be contained in the cap-col
                 ; in the supplied PARAM() function

      col-value  = col-literal
              / "SELF()"
              / "CAL-OWNERS()"
              / "CAL-OWNERS(" cal-address ")"
             / "CURRENT-TARGET()"

      cal-address = ; A CALID as define by CAP

      col-literal = "'" literal-data "'"

     literal-data = ; Any data that matches the value type of the
                 ; column that is being compared. That is you can
                 ; not compare PRIORITY to "some string" because
                 ; PRIORITY has a value type of integer. If it is
                 ; not preceded by the LIKE element, any '%' and '_'
                 ; characters in the literal data are not treated as
                 ; wildcard characters and do not have to be backslash
                 ; escaped.
                 ;
                 ; OR
                 ;
                 ; If the literal-data is preceded by the LIKE
                 ; element it may also contain the '%' and '_'
                 ; wildcard characters. And if the literal data
                 ; that is comparing contains any '%' or '_'
                 ; characters, they MUST BE backslash escaped as
                 ; described in the notes below in order for them not
                 ; to be treated as wildcard characters.

      cap-oper    = "="
               / "!="
               / "<"
               / ">"
               / "<="
               / ">="

      SP          = ; A single white space ascii character
                 ; (value in HEX %x20).

      x-comp      = ; As defined in RFC 2445 section 4.6

      iana-comp   = ; As defined in RFC 2445 section 4.6

--
-
Doug Royer                       Work: (208)612-INET
[email-masked]                   Fax:  (866)594-8574
http://INET-Consulting.com       Cell: (208)520-4044
http://Royer.com/People/Doug