Querying WebDAV Hierarchical Properties -- The Proposal

BEGIN PROPOSAL: 
(1) Add an optional operator, "proppath":
<!ELEMENT proppath ( ANY ) >
This parallels the definition of "prop" by the WebDAV
draft, which, unfortunately, uses "ANY". So we have to
state that the "ANY" stands for one or more property
names, i.e., XML elements with empty content. You can think
of there being implicit dots between each of the properties.
(2) Add alternatives to the existing operators
(e.g., "gt", etc.) where "prop" is replaced
by "proppath". For example, "gt" becomes
<!ELEMENT gt ( prop, literal | proppath, literal ) >
END PROPOSAL -- That's it. Elegant and simple.

EXAMPLE:
The hierarchical "lockdiscovery" property is defined by 
WebDAV thusly:
<!ELEMENT lockdiscovery (activelock)*>
<!ELEMENT activelock (lockscope, locktype, depth,
                     owner?, timeout?, locktoken?>
<!ELEMENT lockscope (exclusive | shared)>
<!ELEMENT exclusive  EMPTY>
<!ELEMENT shared EMPTY>
<!locktype (write)>
<!write EMPTY>
<!ELEMENT depth (#PCDATA)>   -- 0, infinity --
<!ELEMENT owner ANY>
<!ELEMENT timeout (#PCDATA)>
<!ELEMENT locktoken (href+)>
<!ELEMENT href (#PCDATA)>

Consider a query for all the resources locked by "Alan".
Conceptually, ' activelock.owner = "Alan" '. In XML 
the DASL "where" clause would be
    <D:eq>
        <D:proppath><D:activelocks/><D:owner/></D:proppath>
        <D:literal>Alan</D:literal>
    </D:eq>

The query where we were looking only for collection 
resources that Alan has exclusively locked is conceptually 
    ' resourcetype.collection IS NOT NULL AND
      activelock.owner="Alan" AND 
      activelock.lockscope.exclusive IS NOT NULL '.
The XML for DASL would be
    <D:AND>
        <D:ne>
            <D:proppath>
                <D:resourcetype/><D:collection/>
            </D:proppath>
            <D:literal/>
        </D:ne>
        <D:eq>
            <D:proppath>
                <D:activelock/><D:owner/>
            </D:proppath>
            <D:literal>Alan</D:literal>
        </D:eq>
        <D:ne>
            <D:proppath>
                <D:activelock/><D:lockscope/><D:exclusive/>
            </D:proppath>
            <D:literal/>
        </D:ne>
    </D:AND>

Actually, I have slipped another proposal into 
this example that is a proposal Jim Davis made 
recently (thanks, Jim): The "isnull" operator in the 
draft was misnamed, so we recently renamed it to the 
"isdefined" operator and adjusted the sense of the 
explanatory text. That left us with no "isnull"
operator. Instead of adding an "isnull" operator 
to DASL: (1) use a DAV literal with no content; 
(2) treat "eq" and "ne" as "isnull" and "isnotnull"; 
and (3) for the other four relationals, treat a property 
with no value as if it had a value that collated before 
any actual value. Therefore "<D:gt><D:X><D:literal/></D:gt>" 
evaluates to TRUE if the property X has a value for the 
resource under scan, and FALSE if it does not; ge is 
always TRUE; "lt" is FALSE for all resources; and "le" is 
FALSE if the property has a value and TRUE if it does not.

To find all ordinary resources locked by Alan, conceptually:
    ' resourcetype IS NULL AND
      activelock.owner="Alan" '
The XML for DASL would be
    <D:AND>
        <D:eq>
            <D:proppath><D:resourcetype/></D:proppath>
            <D:literal/>
        </D:eq>
        <D:eq>
            <D:proppath><D:activelock/><D:owner/>
            </D:proppath>
            <D:literal>Alan</D:literal>
        </D:eq>
    </D:AND>

Alan Babich

Received on Monday, 28 September 1998 00:17:47 UTC