W3C home > Mailing lists > Public > www-webdav-dasl@w3.org > July to September 1998

How to support XML structure query

From: Jim Davis <jdavis@parc.xerox.com>
Date: Fri, 3 Jul 1998 15:54:51 PDT
Message-Id: <3.0.3.32.19980703155451.00800100@mailback.parc.xerox.com>
To: www-webdav-dasl@w3.org
At 12:42 PM 6/30/98 PDT, Saveen Reddy (Exchange) wrote:

Saveen wrote about the problem of forming a query that matched all and only
the  resources that are collections, and proposed four solutions.

Saveen described the source of the problem as

> the value of this property is not a simple string or boolean value,
>it is an arbitrarily complex chunk of XML. None of the operators currently
>defined can be used to evaluate such a value.

And I agree, except that it applies not only to the resourcetype property
(or lockdiscovery) but to many others as well.  My scenario is finding an
author name in a list-valued property such as:

<dc:Creator>
  <x:person>Goland, Y</x:person>
  <x:person>Harding, T</x:person>
  <x:person>Fischer, B</x:person>
</dc:Creator>

(I described this at greater length in other email.)

Saveen provided four possible solutions. 

>1 - create an operator that allows search criteria to deal with arbitrarily
>complex xml

>2 - create an operator that has *some* smarts about XML. Such an operator
>could be called "xmlcontains" and returns true if a property contains as an
>immediate child, some element name

>3 - create an operator whose *sole purpose* is to determine whether a
>resource is a collection or not. 

>4 - create a *dynamic* property whose purpose is to determine whether a
>resource is a collection or not.

Saveen thinks 1 is too hard, and I agree.  3 and 4 work fine for his
problem, but not for mine.  I think solution 2 is best.

Note that this also requires that we allow XML to appear as a literal in
such an operator.

Using the example of an author list, I could then write a query

<where>
 <xmlcontains>
  <prop><dc:creator/></prop>
  <literal><x:author>Harding, T</x:author></literal>
 </contains>
</where>

which finds any document what has "Harding, T" as an author.  

The downside is that it does not allow for pattern match operators WITHIN
the XML literal.  You can't say

<where>
 <xmlcontains>
  <prop><dc:creator/></prop>
  <literal><x:author>Harding, T*</x:author></literal>
 </contains>
</where>

We could also consider generalizing xmlcontains to apply to tags at any
level, not just depth one, but I don't know of any servers that currently
store compound XML as a structured object, so I think we can skip it.

While I was composing this, I thought of two other possible responses.  I
would not call them "solutions" exactly.  I don't like either of them, but
I want to list them anyway so we can say we considered all the options.
But I'll put them in a separate message.
Received on Saturday, 4 July 1998 00:07:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 22 March 2009 03:38:04 GMT