<?xml-stylesheet type='text/xsl' href='rfc2629.xslt' ?>
<?rfc symrefs="yes"?>
<?rfc sortrefs="yes"?>
<?rfc toc="yes"?>
<?rfc editing="yes"?>
<?rfc-ext parse-xml-in-artwork="yes" ?>
<rfc xmlns:x='http://purl.org/net/xml2rfc/ext' xmlns:ed="http://greenbytes.de/2002/rfcedit" ipr="full2026" docName="draft-reschke-webdav-search-03" category="exp">
  <x:link rel="up" href="http://greenbytes.de/tech/webdav/#draft-reschke-webdav-search"/>
  <x:link rel="prev" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-02.html"/>
  <x:link rel="next" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-04.html"/>
  <x:link rel="Bookmark" title="IETF WEBDAV Working Group" href="http://ftp.ics.uci.edu/pub/ietf/webdav/"/>
  <x:link rel="Alternate" title="(latest)" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-latest.html"/>
  <x:link rel="Alternate" title="draft 18" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-18.html"/>
  <x:link rel="Alternate" title="draft 17" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-17.html"/>
  <x:link rel="Alternate" title="draft 16" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-16.html"/>
  <x:link rel="Alternate" title="draft 15" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-15.html"/>
  <x:link rel="Alternate" title="draft 14" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-14.html"/>
  <x:link rel="Alternate" title="draft 13" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-13.html"/>
  <x:link rel="Alternate" title="draft 12" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-12.html"/>
  <x:link rel="Alternate" title="draft 11" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-11.html"/>
  <x:link rel="Alternate" title="draft 10" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-10.html"/>
  <x:link rel="Alternate" title="draft 09" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-09.html"/>
  <x:link rel="Alternate" title="draft 08" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-08.html"/>
  <x:link rel="Alternate" title="draft 07" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-07.html"/>
  <x:link rel="Alternate" title="draft 06" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-06.html"/>
  <x:link rel="Alternate" title="draft 05" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-05.html"/>
  <x:link rel="Alternate" title="draft 04" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-04.html"/>
  <x:link rel="Alternate" title="draft 03" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-03.html"/>
  <x:link rel="Alternate" title="draft 02" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-02.html"/>
  <x:link rel="Alternate" title="draft 01" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-01.html"/>
  <x:link rel="Alternate" title="draft 00" href="http://greenbytes.de/tech/webdav/draft-reschke-webdav-search-00.html"/>

<front>
  <title>WebDAV SEARCH</title>
		
  <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
  	<organization abbrev="greenbytes">greenbytes GmbH</organization>
		<address>
      <postal>
        <street>Salzmannstrasse 152</street>
        <city>Muenster</city><region>NW</region><code>48159</code>
        <country>Germany</country>
      </postal>
		  <phone>+49 251 2807760</phone>	
			<facsimile>+49 251 2807761</facsimile>	
			<email>julian.reschke@greenbytes.de</email>	
			<uri>http://greenbytes.de/tech/webdav/</uri>	
		</address>
	</author>
    
	<author initials="S." surname="Reddy" fullname="Surendra Reddy">
		<organization abbrev="Oracle">Oracle Corporation</organization>
		<address>
	    <postal>
   	    <street>600 Oracle Parkway, M/S 6op3</street>
       	<city>Redwoodshores</city><region>CA</region><code>94065</code>
      </postal>
      <phone>+1 650 506 5441</phone>
      <email>Surendra.Reddy@oracle.com</email>
	  </address>
  </author>
    
  <author initials="J." surname="Davis" fullname="Jim Davis">
	  <organization abbrev="Intelligent Markets">Intelligent Markets</organization>
		<address>
      <postal>
        <street>410 Jessie Street 6th floor</street>
        <city>San Francisco</city><region>CA</region><code>94103</code>
      </postal>
      <email>jrd3@alum.mit.edu</email>
    </address>
  </author>

	<author initials="A." surname="Babich" fullname="Alan Babich">
		<organization abbrev="Filenet">FileNET Corp.</organization>
    <address>
			<postal>
        <street>3565 Harbor Blvd.</street>
        <city>Costa Mesa</city><region>CA</region><code>92626</code>
      </postal>
      <phone>+1 714 327 3403</phone>
      <email>ababich@filenet.com</email>
    </address>
  </author>    

  <date month="February" year="2003"/>
    
	<workgroup>WEBDAV DASL Working Group</workgroup>
<abstract>


<t>
This document specifies a set of methods, headers, properties and content-types
composing WebDAV SEARCH, an application of the HTTP/1.1 protocol to efficiently search for DAV 
resources based upon a set of client-supplied criteria.   
</t>


<t>
Distribution of this document is unlimited. Please send comments to the 
Distributed Authoring and Versioning (WebDAV) DASL mailing list at
<eref target="mailto:www-webdav-dasl@w3.org">www-webdav-dasl@w3.org</eref>,
which may be joined by sending a message with subject 
"subscribe" to <eref target="mailto:www-webdav-dasl-request@w3.org?subject=subscribe">www-webdav-dasl-request@w3.org</eref>.
Discussions of the WebDAV DASL mailing list are archived at URL: 
<eref target="http://www.w3.org/pub/WWW/Archives/Public/www-webdav-dasl/">http://www.w3.org/pub/WWW/Archives/Public/www-webdav-dasl/</eref>.               
</t> 


</abstract>
	</front><middle>

<section title="Introduction">

<section title="DASL">
<t>
This document defines WebDAV SEARCH, an application
of HTTP/1.1 forming a lightweight search protocol to transport queries
and result sets and allows clients to make use of server-side search facilities.
It is based on the expired draft for WebDAV DASL <xref target="DASL"/>.
<xref target="DASLREQ"/> describes the motivation for DASL.
</t>
<t>
DASL will minimize the complexity of clients so as to facilitate widespread
deployment of applications capable of utilizing the DASL search mechanisms.
</t>
<t>
DASL consists of:
	<list style="symbols">
		<t>the SEARCH method,</t>
    <t>the DASL response header,</t>
    <t>the DAV:searchrequest XML element,</t>
    <t>the DAV:queryschema property,</t>
    <t>the DAV:basicsearch XML element and query grammar, and</t>
    <t>the DAV:basicsearchschema XML element.</t>
	</list>
</t>
<t>
  
  For WebDAV-compliant servers, it also defines a new live property
  DAV:supported-query-grammar-set.
  
</t>
</section>

<section title="Relationship to DAV">
<t>
DASL relies on the resource and property model defined by <xref target="RFC2518"/>. DASL
does not alter this model. Instead, DASL allows clients to access DAV-modeled
resources through server-side search.
</t>
</section>

<section title="Terms">
<t>
This draft uses the terms defined in <xref target="RFC2616"/>, <xref target="RFC2518"/>, and <xref target="DASLREQ"/>.
</t>
</section>

<section title="Notational Conventions">
<t>
The augmented BNF used by this document to describe protocol elements is
exactly the same as the one described in Section 2.1 of <xref target="RFC2616"/>. Because
this augmented BNF uses the basic production rules provided in Section
2.2 of <xref target="RFC2616"/>, those rules apply to this document as well.
</t>
<t>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT"
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document
are to be interpreted as described in <xref target="RFC2119"/>.
</t>
<t>
  When an XML element type in the "DAV:" namespace is referenced in this document
  outside of the context of an XML fragment, the string "DAV:" will be prefixed to
  the element type.
</t>
<t>
  Note that this draft currently defines elements and properties in the WebDAV namespace "DAV:",
  which it shouldn't do as it isn't a work item of the WebDAV working group.
  The reason for this is the desire for some kind of backward compatibility
  to the expired DASL drafts and the
  assumption that the draft may become an official RFC submission of the WebDAV working group
  at a later point of time.
</t>
<t>
  Similarily, when an XML element type in the namespace "http://www.w3.org/2001/XMLSchema"
  is referenced in this document outside of the context of an XML fragment, the
  string "xs:" will be prefixed to the element type.
</t>
</section>

<section title="An Overview of DASL at Work">
<t>
One can express the basic usage of DASL in the following steps:
<list style="symbols">
  <t>The client constructs a query using the DAV:basicsearch grammar.</t>
  <t>The client invokes the SEARCH method on a resource that will perform the
search (the search arbiter) and includes a text/xml or application/xml request entity that
contains the query.</t>
  <t>The search arbiter performs the query.</t>
  <t>The search arbiter sends the results of the query back to the client in
the response. The server MUST send an entity
 that matches the <xref target="RFC2518"/>
PROPFIND response.</t>
</list>
</t>
</section>

</section>

<section title="The SEARCH Method">
<iref item="SEARCH method" primary="true"/>

<section title="Overview">
<t>
The client invokes the SEARCH method to initiate a server-side search.
The body of the request defines the query. The server MUST emit
an entity matching the <xref target="RFC2518"/> PROPFIND response.
</t>
<t>
The SEARCH method plays the role of transport mechanism for the query
and the result set. It does not define the semantics of the query. The
type of the query defines the semantics.
</t>
</section>

<section title="The Request">
<t>
The client invokes the SEARCH method on the resource named by the Request-URI.
</t>

<section title="The Request-URI">
<t>
The Request-URI identifies the search arbiter.
Any HTTP resource may function as search arbiter. It is not a new type of
resource (in the sense of DAV:resourcetype as defined in <xref target="RFC2518"/>),
nor does it have to be a WebDAV-compliant resource.
</t>
<t>
The SEARCH method defines no relationship between the arbiter and the
scope of the search, rather the particular query grammar used in the query
defines the relationship. For example, the FOO query grammar may force
the request-URI to correspond exactly to the search scope.
</t>

</section>

<section title="The Request Body">
<t>
The server MUST process a text/xml or application/xml request body, and
MAY process request bodies in other formats. See <xref target="RFC3023"/> for guidance
on packaging XML in requests.
</t>
<t>
If the client sends a text/xml or application/xml body, it MUST include
the DAV:searchrequest XML element. The DAV:searchrequest
XML element identifies the query grammar, defines the criteria, the result
record, and any other details needed to perform the search.
</t>
</section>
</section>

<section title="The DAV:searchrequest XML Element">
<iref item="DAV:searchrequest" subitem="XML element" primary="true"/>
<figure><artwork>
&lt;!ELEMENT searchrequest ANY &gt;
</artwork></figure>
<t>
The DAV:searchrequest XML element contains a single XML element
that defines the query. The name of the query element defines the type
of the query. The value of that element defines the query itself.
</t>
</section>

<section title="The Successful 207 (Multistatus) Response">
<t>
If the server returns 207 (Multistatus), then the search proceeded successfully
and the response MUST match that of a PROPFIND. The results of this method SHOULD NOT be cached. 
</t>
<t>
There MUST be one DAV:response for each resource that matched
the search criteria. For each such response, the DAV:href element
contains the URI of the resource, and the response MUST include a DAV:propstat
element.
</t>
<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2002-12-14" ed:resolves="results-vs-binds">
<ed:ins>
<t>
Note that for each matching resource found there may be multiple URIs
within the search scope mapped to it. In this case, a server SHOULD report
all of these URIs. Clients can use the live property DAV:resource-id defined
in <xref target="BIND"/> to identify possible duplicates. 
</t>
</ed:ins>
</ed:replace>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="results-vs-binds" status="closed" type="edit" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002AprJun/0047.html">
  <ed:item date="2002-06-26" entered-by="julian.reschke@greenbytes.de">
Given a URL space which supports the binding protocol, and which actually
contains multiple binds for a resource matching the search conditions. What
do we expect:
<br/>
1) only one of the URIs is reported,
<br/>
2) all of them are reported.
<br/>
Case 1) may be better for simple clients that aren't aware of the existence
of BIND. Case 2) may be required for more advanced clients (that actually
*want* to find all bindings, and can select DAV:resourceid to decide which
of the reported URIs map to the same resource).
  </ed:item>
</ed:issue>
<t>In addition, the server MAY include DAV:response items in the
reply where the DAV:href element contains a URI that is not a
matching resource, e.g. that of a scope or the query arbiter. Each such
response item MUST NOT contain a DAV:propstat element, and MUST
contain a DAV:status element (unless no property was selected).
</t>

<section title="Extending the PROPFIND Response">
<t>
A response MAY include more information than PROPFIND defines so long as
the extra information does not invalidate the PROPFIND response. Query
grammars SHOULD define how the response matches the PROPFIND response.
</t>
</section>

<section title="Example: A Simple Request and Response">
<t>
This example demonstrates the request and response framework. The following
XML document shows a simple (hypothetical) natural language query. 
The name of the query element is natural-language-query in the XML namespace
"http://example.com/foo". The actual query is "Find the
locations of good Thai restaurants in Los Angeles". For this hypothetical
query, the arbiter returns two properties for each selected resource.
</t>
<figure>

<preamble>
&gt;&gt; Request:</preamble>
<artwork>SEARCH / HTTP/1.1
Host: example.org
Content-Type: application/xml
Content-Length: xxx

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo"&gt;
  &lt;F:natural-language-query&gt;
    Find the locations of good Thai restaurants in Los Angeles
  &lt;/F:natural-language-query&gt;
&lt;/D:searchrequest&gt;
</artwork>
</figure>


<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;D:multistatus xmlns:D="DAV:"
   xmlns:R="http://example.org/propschema"&gt;
  &lt;D:response&gt;
    &lt;D:href&gt;http://siamiam.test/&lt;/D:href&gt;
    &lt;D:propstat&gt;
      &lt;D:prop&gt;
        &lt;R:location&gt;259 W. Hollywood&lt;/R:location&gt;
        &lt;R:rating&gt;&lt;R:stars&gt;4&lt;/R:stars&gt;&lt;/R:rating&gt;
      &lt;/D:prop&gt;
    &lt;/D:propstat&gt;
  &lt;/D:response&gt;
&lt;/D:multistatus&gt;
</artwork>
</figure>

</section>


<section title="Example: Result Set Truncation">
<iref item="Result Set Truncation" subitem="Example" primary="true"/>
<t>
A server MAY limit the number of resources in a reply, for example to limit
the amount of resources expended in processing a query. If it does so,
the reply MUST use status code 207, return a DAV:multistatus response
body and indicate a status of 507 (Insufficient Storage) for the search
arbiter URI. It SHOULD include the partial results.
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="result-truncation" type="change" status="open" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002JanMar/0163.html">
  <ed:item date="2002-03-29" entered-by="ldusseault@xythos.com">
I believe the same response body that
contains the first N &lt;DAV:response&gt; elements should also contain a
*different* element stating that the results were incomplete and the result
set was truncated by the server.
There may also be a need to report that the results were incomplete and the
result set was truncated at the choice of the client (isn't there a limit
set in the client request?)  That's important so the client knows the
difference between receiving 10 results because there were &gt;10 but only 10
were asked for, and receiving 10 results because there were only exactly 10
results and it just happens that 10 were asked for.
  </ed:item>
  <ed:item date="2002-05-28" entered-by="jrd3@alum.mit.edu">
I agree that this could be useful, but I think this issue should be 
consolidated with issue <a href="#rfc.issue.JW5">JW5</a> (see below), which proposes that DASL 
basicsearch ought to have a way for client to request additional result 
sets.  It should be moved because there is little or no value in allowing a 
client to distinguish between the case where "N results were requested, and 
there are exactly N available" and "N results were requested, and there are 
more than N available" if there is no way for client to get the next batch 
of results.
  </ed:item>
  <ed:item date="2003-01-28" entered-by="julian.reschke@greenbytes.de">
Feedback from interim WG meeting: agreement that marshalling should be
rewritten and backwards compatibility is not important. Proposal: extend
DAV:multistatus by a new child element that indicates (1) the range that was
returned, (2) the total number of results and (3) a URI identifying the
result (for resubmission when getting the "next" results). Such as
<br/>
<pre>
&lt;multistatus xmlns='DAV:'>
  &lt;search-result>
    &lt;href>...identifier for result set...&lt;/href>
    &lt;total>&lt;-- number of results -->&lt;/total>
    &lt;start>&lt;-- 1-based index of 1st result -->&lt;/start>
    &lt;length>&lt;-- size of result set returned -->&lt;/length>
    &lt;partial-result/>&lt;-- indicates that this is a partial result -->
  &lt;/search-result>
  ...response elements for search results...
&lt;/multistatus>  
</pre>
The example below would then translate to:
<pre>
HTTP/1.1 207 Multistatus
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;D:multistatus xmlns:D="DAV:"&gt;
  &lt;D:search-result>
    &lt;D:partial-result/&gt;
  &lt;/D:search-result>
  &lt;D:response&gt;
    &lt;D:href&gt;http://www.example.net/sounds/unbrokenchain.au&lt;/D:href&gt;
    &lt;D:propstat&gt;
      &lt;D:prop/&gt;
      &lt;D:status&gt;HTTP/1.1 200 OK&lt;/D:status&gt;
    &lt;/D:propstat&gt;
  &lt;/D:response&gt;
  &lt;D:response&gt;
    &lt;D:href&gt;http://tech.mit.test/archive96/photos/Lesh1.jpg&lt;/D:href&gt;
    &lt;D:propstat&gt;
      &lt;D:prop/&gt;
      &lt;D:status&gt;HTTP/1.1 200 OK&lt;/D:status&gt;
    &lt;/D:propstat&gt;
  &lt;/D:response&gt;
&lt;/D:multistatus&gt;
</pre>
Q: do we need all elements, in particular start and length?
  </ed:item>
</ed:issue>
<t>When a result set is truncated, there may be many more resources that
satisfy the search criteria but that were not examined.
</t>
<t>If partial results are included and the client requested an ordered
result set in the original request, then any partial results that are returned
MUST be ordered as the client directed.
</t>
<t>Note that the partial results returned MAY be any subset of the result
set that would have satisfied the original query.
</t>
<figure><preamble>
&gt;&gt; Request:</preamble>
<artwork>SEARCH / HTTP/1.1
Host: example.net
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

 ... the query goes here ...
</artwork></figure>

<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>
HTTP/1.1 207 Multistatus
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;D:multistatus xmlns:D="DAV:"&gt;
  &lt;D:response&gt;
    &lt;D:href&gt;http://www.example.net/sounds/unbrokenchain.au&lt;/D:href&gt;
    &lt;D:propstat&gt;
      &lt;D:prop/&gt;
      &lt;D:status&gt;HTTP/1.1 200 OK&lt;/D:status&gt;
    &lt;/D:propstat&gt;
  &lt;/D:response&gt;
  &lt;D:response&gt;
    &lt;D:href&gt;http://tech.mit.test/archive96/photos/Lesh1.jpg&lt;/D:href&gt;
    &lt;D:propstat&gt;
      &lt;D:prop/&gt;
      &lt;D:status&gt;HTTP/1.1 200 OK&lt;/D:status&gt;
    &lt;/D:propstat&gt;
  &lt;/D:response&gt;
  &lt;D:response&gt;
    &lt;D:href&gt;http://example.net&lt;/D:href&gt;
    &lt;D:status&gt;HTTP/1.1 507 Insufficient Storage&lt;/D:status&gt;
    &lt;D:responsedescription xml:lang="en"&gt;
       Only first two matching records were returned
    &lt;/D:responsedescription&gt;
  &lt;/D:response&gt;
&lt;/D:multistatus&gt;
</artwork></figure>
</section>


</section>

<section title="Unsuccessful Responses">
<t>
If an error occurred that prevented execution of the query, the server
MUST indicate the failure with the appropriate status code and SHOULD include
a DAV:multistatus element to point out errors associated with
scopes.
</t>
<t>400 Bad Request. The query could not be executed. The request may be
malformed (not valid XML for example). Additionally, this can be used for
invalid scopes and search redirections.
</t>
<t>422 Unprocessable entity. The query could not be executed. If a application/xml or text/xml
request entity was provided, then it may have been well-formed
but may have contained an unsupported or unimplemented query operator.
</t>





</section>

<section title="Invalid Scopes">
<iref item="Scope" subitem="Invalid" primary="true"/>

<section title="Indicating an Invalid Scope">
<t>
A client may submit a scope that the arbiter may be unable to query. The
inability to query may be due to network failure, administrative policy,
security, etc. This raises the condition described as an "invalid scope".
</t>
<t>To indicate an invalid scope, the server MUST respond with a 400 (Bad
Request).
</t>
<t>The response includes a body with a DAV:multistatus
element. Each DAV:response in the DAV:multistatus identifies
a scope. To indicate that this scope is the source of the error, the server
MUST include the DAV:scopeerror element.
</t>
</section>

<section title="Example of an Invalid Scope">
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 400 Bad-Request
Content-Type: text/xml; charset="utf-8"   
Content-Length: xxx

&lt;?xml version="1.0" encoding="UTF-8"?&gt;

&lt;d:multistatus xmlns:d="DAV:"&gt;
  &lt;d:response&gt;
    &lt;d:href&gt;http://www.example.com/X&lt;/d:href&gt;
      &lt;d:status&gt;HTTP/1.1 404 Object Not Found&lt;/d:status&gt;
    &lt;d:scopeerror/&gt;
  &lt;/d:response&gt;
&lt;/d:multistatus&gt;
</artwork></figure>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="invalid-scope" type="change" status="open">
  <ed:item date="2003-01-09" entered-by="julian.reschke@greenbytes.de">
    Marshalling a BAD REQUEST with an (extended) multistatus body seems to
    be a weird approach. Should be resolved by finally adopting the RFC3253
    error marshalling.
  </ed:item>
  <ed:item date="2003-01-28" entered-by="julian.reschke@greenbytes.de">
    Funny enough, Roy Fielding's <a href="http://lists.w3.org/Archives/Public/w3c-dist-auth/2003JanMar/0074.html">feedback</a>
    on a related issue indicates that this may be the absolutely right thing
    to do. Needs coordination with RFC2518bis activity.
  </ed:item>
</ed:issue>

</section>
</section>
</section>
  
<section title="Discovery of Supported Query Grammars">
<iref item="Query Grammar Discovery" primary="true"/>
<t>
Servers MUST support discovery of the query grammars supported by a search
arbiter resource.
</t>
<t>Clients can determine which query grammars are supported by an arbiter
by invoking OPTIONS on the search arbiter. If the resource supports SEARCH,
then the DASL response header will appear in the response. The DASL response
header lists the supported grammars.
</t>
<t>

Servers supporting the WebDAV extensions <xref target="RFC3253"/> and/or 
<xref target="ACL"/> MUST also
<list style="symbols">
  <t>report SEARCH in the live property DAV:supported-method-set for all search arbiter resources and</t>
  <t>support the live property DAV:supported-query-grammar-set as defined in <xref target="ELEMENT_supported-query-grammar-set"/>.</t>
</list>

</t>

<section title="The OPTIONS Method">
<iref item="Query Grammar Discovery" subitem="using OPTIONS" primary="true"/>
<iref item="OPTIONS method" primary="true"/>
<t>
The OPTIONS method allows the client to discover if a resource supports
the SEARCH method and to determine the list of search grammars supported
for that resource.
</t>
<t>The client issues the OPTIONS method against a resource named by the
Request-URI. This is a normal invocation of OPTIONS defined in <xref target="RFC2616"/>.
</t>
<t>If a resource supports the SEARCH method, then the server MUST list
SEARCH in the OPTIONS response as defined by <xref target="RFC2616"/>.
</t>
<t>DASL servers MUST include the DASL header in the OPTIONS response. This
header identifies the search grammars supported by that resource.
</t>
</section>

<section title="The DASL Response Header">
<iref item="OPTIONS method" subitem="DASL response header" primary="true"/>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>DASLHeader = "DASL" ":" Coded-URL-List
Coded-URL-List : Coded-URL [ "," Coded-URL-List ]
Coded-URL ; defined in section 9.4 of [RFC2518]
</artwork></figure>
<t>
The DASL response header indicates server support for a query grammar in
the OPTIONS method. The value is a URI that indicates the type of grammar.
Note that although the URI can be used to identify each supported search
grammar, there is not necessarily a direct relationship between the URI and the
XML element name that can be used in XML based SEARCH requests (the element 
name itself is identified by it's namespace name (a URI reference) and 
the element's local name).
</t>
<t>
This header MAY be repeated.
</t>
<figure><preamble>
For example:</preamble>
<artwork>DASL: &lt;http://foobar.test/syntax1&gt; 
DASL: &lt;http://akuma.test/syntax2&gt;
DASL: &lt;DAV:basicsearch&gt;
DASL: &lt;http://example.com/foo/natural-language-query&gt;
</artwork></figure>
</section>




<section title="DAV:supported-query-grammar-set (protected)" anchor="ELEMENT_supported-query-grammar-set">
<iref item="DAV:supported-query-grammar-set" subitem="property" primary="true"/>
<iref item="Query Grammar Discovery" subitem="using live property" primary="true"/>

<t>This WebDAV property is required for any server supporting either
<xref target="RFC3253"/> and/or <xref target="ACL"/> and
identifies the XML based query grammars that are supported by the search arbiter resource.</t>
<figure>
<artwork>
&lt;!ELEMENT supported-query-grammar-set (supported-query-grammar*)&gt;

&lt;!ELEMENT supported-query-grammar grammar&gt;

&lt;!ELEMENT grammar ANY&gt;
</artwork></figure>
<t>
ANY value: a query grammar element type
</t>

</section>


<section title="Example: Grammar Discovery">
<t>
This example shows that the server supports search on the /somefolder
resource with the query grammars: DAV:basicsearch, http://foobar.test/syntax1
and http://akuma.test/syntax2. Note that every server MUST support
DAV:basicsearch.
</t>
<figure><preamble>
&gt;&gt; Request:</preamble>
<artwork>OPTIONS /somefolder HTTP/1.1
Host: example.org
</artwork></figure>
<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-28">
<ed:del>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 200 OK
Date: Tue, 20 Jan 1998 20:52:29 GMT
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE,
       MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
DASL: &lt;DAV:basicsearch&gt;
DASL: &lt;http://foobar.test/syntax1&gt; 
DASL: &lt;http://akuma.test/syntax2&gt;
</artwork></figure>
</ed:del>
<ed:ins>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 200 OK
Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
DASL: &lt;DAV:basicsearch&gt;
DASL: &lt;http://foobar.test/syntax1&gt; 
DASL: &lt;http://akuma.test/syntax2&gt;
</artwork></figure>
</ed:ins>
</ed:replace>

<t>
This example shows the equivalent taking advantage of a server's support for
DAV:supported-method-set and DAV:supported-query-grammar-set.
</t>
<figure><preamble>
&gt;&gt; Request:</preamble>
<artwork>PROPFIND /somefolder HTTP/1.1
Host: example.org
Depth: 0
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="UTF-8" ?&gt;
&lt;propfind xmlns="DAV:"&gt;
  &lt;prop&gt;
    &lt;supported-query-grammar-set/&gt;
    &lt;supported-method-set/&gt;
  &lt;/prop&gt;
&lt;/propfind&gt;
</artwork></figure>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 207 Multi-Status
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="utf-8" ?&gt;
&lt;multistatus xmlns="DAV:"&gt;
 &lt;response&gt;
  &lt;href&gt;http://example.org/somefolder&lt;/href&gt;
  &lt;propstat&gt;
   &lt;prop&gt;
    &lt;supported-query-grammar-set&gt;
     &lt;supported-query-grammar&gt;
      &lt;grammar&gt;&lt;basicsearch/&gt;&lt;/grammar&gt;
     &lt;/supported-query-grammar&gt;
     &lt;supported-query-grammar&gt;
      &lt;grammar&gt;&lt;syntax1 xmlns="http://foobar.test" /&gt;&lt;/grammar&gt;
     &lt;/supported-query-grammar&gt;
     &lt;supported-query-grammar&gt;
      &lt;grammar&gt;&lt;syntax2 xmlns="http://akuma.test/"/&gt;&lt;/grammar&gt;
     &lt;/supported-query-grammar&gt;
    &lt;/supported-query-grammar-set&gt;
    &lt;supported-method-set&gt;
     &lt;supported-method name="COPY" /&gt;
     &lt;supported-method name="DELETE" /&gt;
     &lt;supported-method name="GET" /&gt;
     &lt;supported-method name="HEAD" /&gt;
     &lt;supported-method name="LOCK" /&gt;
     &lt;supported-method name="MKCOL" /&gt;
     &lt;supported-method name="MOVE" /&gt;
     &lt;supported-method name="OPTIONS" /&gt;
     &lt;supported-method name="POST" /&gt;
     &lt;supported-method name="PROPFIND" /&gt;
     &lt;supported-method name="PROPPATCH" /&gt;
     &lt;supported-method name="PUT" /&gt;
     &lt;supported-method name="SEARCH" /&gt;
     &lt;supported-method name="TRACE" /&gt;
     &lt;supported-method name="UNLOCK" /&gt;
    &lt;/supported-method-set&gt;
   &lt;/prop&gt;
   &lt;status&gt;HTTP/1.1 200 OK&lt;/status&gt;
  &lt;/propstat&gt;
 &lt;/response&gt;
&lt;/multistatus&gt;
</artwork></figure>
<t>
Note that the query grammar element names marshalled as part of the 
DAV:supported-query-grammar-set can be directly used as element names in
an XML based query.
</t>


</section>
</section>
  
<section title="Query Schema Discovery: QSD">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="qsd-optional" type="change" status="open">
  <ed:item date="2003-01-28" entered-by="julian.reschke@greenbytes.de">
    WG January meeting feedback: QSD should be made required.
  </ed:item>
</ed:issue>
<t>
Servers MAY support the discovery of the schema for a query grammar.
</t>
<t>
The DASL response header and the DAV:supported-query-grammar-set property provide
means for clients to discover the
set of query grammars supported by a resource. This alone is not sufficient
information for a client to generate a query. For example, the DAV:basicsearch
grammar defines a set of queries consisting of a set of operators applied
to a set of properties and values, but the grammar itself does not specify
which properties may be used in the query. QSD for the DAV:basicsearch
grammar allows a client to discover the set of properties that are searchable,
selectable, and sortable. Moreover, although the DAV:basicsearch
grammar defines a minimal set of operators, it is possible that a resource
might support additional operators in a query. For example, a resource
might support a optional operator that can be used to express content-based
queries in a proprietary syntax. QSD allows a client to discover these
operators and their syntax. The set of discoverable quantities will differ
from grammar to grammar, but each grammar can define a means for a client
to discover what can be discovered.
</t>
<t>In general, the schema for a given query grammar depends on both the
resource (the arbiter) and the scope. A given resource might have access
to one set of properties for one potential scope, and another set for a
different scope. For example, consider a server able to search two distinct
collections, one holding cooking recipes, the other design documents for
nuclear weapons. While both collections might support properties such as
author, title, and date, the first might also define properties such as
calories and preparation time, while the second defined properties such
as yield and applicable patents. Two distinct arbiters indexing the same
collection might also have access to different properties. For example,
the recipe collection mentioned above might also indexed by a value-added
server that also stored the names of chefs who had tested the recipe. Note
also that the available query schema might also depend on other factors,
such as the identity of the principal conducting the search, but these
factors are not exposed in this protocol.
</t>





<section title="Additional SEARCH semantics">
<t>
Each query grammar supported by DASL defines its own syntax for expressing
the possible query schema. A client retrieves the schema for a given query
grammar on an arbiter resource with a given scope by invoking the SEARCH
method on that arbiter with that grammar and scope and with a root element
of DAV:query-schema-discovery rather than DAV:searchrequest.
</t>
<t>
Marshalling:
  <list style="empty"> 
    <t>
      The requst body MUST be DAV:query-schema-discovery element.
<figure><artwork>
&lt;!ELEMENT query-schema-discovery ANY&gt;
ANY value: XML element defining a valid query
</artwork></figure>
    </t>
    <t>
      The response body takes the form of a RFC2518 DAV:multistatus element,
      where DAV:response is extended to hold the returned query grammar
      inside a DAV:query-schema container element.
    </t>
<t><figure><artwork>
&lt;!ELEMENT response (href, ((href*, status)|(propstat+)),
  query-schema?, responsedescription?) &gt;
&lt;!ELEMENT query-schema ANY&gt;
</artwork></figure></t>
  </list>
</t>

<t>
The content of this container is an XML element whose name and syntax depend upon the grammar,
and whose value may (and likely will) vary depending upon the grammar,
arbiter, and scope.
</t>

<section title="Example of query schema discovery">
<t>
In this example, the arbiter is recipes.test, the grammar is DAV:basicsearch,
the scope is also recipes.test.
</t>


<figure><preamble>
&gt;&gt; Request:</preamble>
<artwork>SEARCH / HTTP/1.1
Host: recipes.test
Content-Type: application/xml
Content-Length: xxx

&lt;?xml version="1.0"?&gt;
&lt;query-schema-discovery xmlns="DAV:"&gt;
  &lt;basicsearch&gt;
    &lt;from&gt;
      &lt;scope&gt;
        &lt;href&gt;http://recipes.test&lt;/href&gt;
        &lt;depth&gt;infinity&lt;/depth&gt;
      &lt;/scope&gt;
    &lt;/from&gt;
  &lt;/basicsearch&gt;
&lt;/query-schema-discovery&gt;
</artwork></figure>
<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de">
<ed:del>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 207 Multistatus
Content-Type: application/xml
Content-Length: xxx

&lt;?xml version="1.0"?&gt;
&lt;multistatus xmlns="DAV:"&gt;
  &lt;response&gt;  
    &lt;href&gt;http://recipes.test&lt;/href&gt;
    &lt;status&gt;HTTP/1.1 200 OK&lt;/status&gt;
    &lt;query-schema&gt;
      &lt;basicsearchschema&gt;
        (See section "Query schema for DAV:basicsearch" for
        the actual contents) 
      &lt;/basicsearchschema&gt;
    &lt;/query-schema&gt;
  &lt;/response&gt;
&lt;/multistatus&gt;
</artwork></figure>
</ed:del>
<ed:ins>
<figure><preamble>
&gt;&gt; Response:</preamble>
<artwork>HTTP/1.1 207 Multistatus
Content-Type: application/xml
Content-Length: xxx

&lt;?xml version="1.0"?&gt;
&lt;multistatus xmlns="DAV:"&gt;
  &lt;response&gt;  
    &lt;href&gt;http://recipes.test&lt;/href&gt;
    &lt;status&gt;HTTP/1.1 200 OK&lt;/status&gt;
    &lt;query-schema&gt;
      &lt;basicsearchschema&gt;
        &lt;!-- (See section "Query schema for DAV:basicsearch" for
        the actual contents) -->
      &lt;/basicsearchschema&gt;
    &lt;/query-schema&gt;
  &lt;/response&gt;
&lt;/multistatus&gt;
</artwork></figure>
</ed:ins>
</ed:replace>
<t>The query schema for DAV:basicsearch is defined in <xref target="qs-basicsearch"/>.</t>

</section>
</section>



</section>

<section title="The DAV:basicsearch Grammar">

<section title="Introduction">
<t>
DAV:basicsearch uses an extensible XML syntax that allows clients
to express search requests that are generally useful for WebDAV scenarios.
DASL-extended servers MUST accept this grammar, and MAY accept other<ed:del timestamp="2003-01-14" title="2003-01-14, julian.reschke@greenbytes.de">s</ed:del> grammars.
</t><t>DAV:basicsearch has several components:</t>
<t><list style="symbols">
<t>DAV:select provides the result record definition.</t>
<t>DAV:from defines the scope.</t>
<t>DAV:where defines the criteria.</t>
<t>DAV:orderby defines the sort order of the result set.</t>
<t>DAV:limit provides constraints on the query as a whole.</t>
</list>
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW24d" type="edit" status="open" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">
  Where does xml:lang go in a query?
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-02-28">
  What would be the *purpose* of putting xml:lang into a query?
</ed:item>
<ed:item entered-by="jrd3@alum.mit.edu" date="2002-05-28">
  The purpose is to allow one to express queries more precisely, e.g. to distinguish between the English word "hoop" (a circular object) and Dutch "hoop" (hope).  Imagine a property that holds keywords for a resource.   See 4.4 in http://www.ietf.org/rfc/rfc2518.txt, and 2.12 in http://www.w3.org/TR/REC-xml
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-05-28">
I think this would be an interesting feature, but it seems to be extremely hard to implement.
<br/>
So assuming a query that
<br/> 
- the query specifies a language and
<br/>
- be the text content of the property matches
<br/> 
The result will be:
<br/> 
1) true (match), if the property was stored with a matching xml:lang property (where the language tag matching rules would have to apply)
<br/>
2) undefined if the property was stored without xml:lang
<br/>
3) false otherwise
<br/> 
On the other hand if
<br/> 
- the query doesn't specify a language
<br/> 
the result will be:
<br/> 
4) undefined (at least according to the current wording).
<br/> 
So,
<br/> 
1) requires that the query engine actually knows how to match language tags -- I'm not sure that everybody is willing to implement that.
<br/>
2) is this desirable?
<br/>
3) ok.
<br/>
4) that seems to be wrong. If the query doesn't care, it should match, right?
<br/> 
Other problems:
<br/> 
- what is the language of a date-typed property?
<br/>
- (sic!) where should xml:lang go into the query? There's no XML feature to undefine an xml:lang which is in scope, but there may be cases where this is needed.
<br/> 
On the other hand, if we drop this requirement, a client can still do a query and then process the result set -- the property elements in the response body will be reported with xml:lang (when persisted with language) anyway.
<br/> 
So I'd recommend to drop the feature. Defining string comparisons vs. collation sequences is hard enough.</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
  (Proposal to reject)
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-28">
  WG meeting feedback: should be moved into explicit operators (see
  <a href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2003JanMar/0040.html">proposal</a> on mailing list). Open: is this optional or required?
</ed:item>
</ed:issue>

</section>

<section title="The DAV:basicsearch DTD">

<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-02-07" ed:resolves="case-insensitivity-name">
<ed:del>
<figure><artwork>
&lt;!ELEMENT basicsearch   (select, from, where?, orderby?, limit?) &gt;

&lt;!ELEMENT select        (allprop | prop) &gt;

&lt;!ELEMENT from  (scope) &gt;
&lt;!ELEMENT scope (href, depth) &gt;

&lt;!ENTITY %comp_ops      "eq | lt | gt| lte | gte"&gt;
&lt;!ENTITY %log_ops       "and | or | not"&gt;
&lt;!ENTITY %special_ops   "is-collection | isdefined"&gt;
&lt;!ENTITY %string_ops    "like"&gt;
&lt;!ENTITY %content_ops   "contains"&gt;

&lt;!ENTITY %all_ops       "%comp_ops; | %log_ops; | %special_ops; |
                            %string_ops; | %content_ops;"&gt;

&lt;!ELEMENT where ( %all_ops; ) &gt;

&lt;!ELEMENT and   ( ( %all_ops; ) +) &gt;

&lt;!ELEMENT or    ( ( %all_ops; ) +) &gt;

&lt;!ELEMENT not   ( %all_ops; ) &gt;

&lt;!ELEMENT lt    ( prop , literal ) &gt;
&lt;!ATTLIST lt    casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT lte   ( prop , literal ) &gt;
&lt;!ATTLIST lte   casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT gt    ( prop , literal) &gt;
&lt;!ATTLIST gt    casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT gte   ( prop , literal ) &gt;
&lt;!ATTLIST gte   casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT eq    ( prop , literal ) &gt;
&lt;!ATTLIST eq    casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT literal       (#PCDATA)&gt;

&lt;!ELEMENT isdefined     (prop) &gt;
&lt;!ELEMENT like  (prop, literal) &gt;
&lt;!ATTLIST like   casesensitive   (1|0) "1" &gt;

&lt;!ELEMENT contains      (#PCDATA)&gt;

&lt;!ELEMENT orderby       (order+) &gt;
&lt;!ELEMENT order (prop, (ascending | descending)?)

&lt;!ATTLIST order casesensitive   (1|0) "1" &gt;
&lt;!ELEMENT ascending     EMPTY&gt;

&lt;!ELEMENT descending    EMPTY&gt;


&lt;!ELEMENT limit (nresults) &gt;
&lt;!ELEMENT nresults      (#PCDATA) &gt;
</artwork></figure>
</ed:del>
<ed:ins>
<figure><artwork>
&lt;!ELEMENT basicsearch   (select, from, where?, orderby?, limit?) &gt;

&lt;!ELEMENT select        (allprop | prop) &gt;

&lt;!ELEMENT from          (scope) &gt;
&lt;!ELEMENT scope         (href, depth) &gt;

&lt;!ENTITY %comp_ops      "eq | lt | gt| lte | gte"&gt;
&lt;!ENTITY %log_ops       "and | or | not"&gt;
&lt;!ENTITY %special_ops   "is-collection | is-defined"&gt;
&lt;!ENTITY %string_ops    "like"&gt;
&lt;!ENTITY %content_ops   "contains"&gt;

&lt;!ENTITY %all_ops       "%comp_ops; | %log_ops; | %special_ops; |
                         %string_ops; | %content_ops;"&gt;

&lt;!ELEMENT where         ( %all_ops; ) &gt;

&lt;!ELEMENT and           ( ( %all_ops; ) +) &gt;

&lt;!ELEMENT or            ( ( %all_ops; ) +) &gt;

&lt;!ELEMENT not           ( %all_ops; ) &gt;

&lt;!ELEMENT lt            (prop, literal) &gt;
&lt;!ATTLIST lt            caseless   (yes|no) &gt;

&lt;!ELEMENT lte           (prop, literal) &gt;
&lt;!ATTLIST lte           caseless   (yes|no) &gt;

&lt;!ELEMENT gt            (prop, literal) &gt;
&lt;!ATTLIST gt            caseless   (yes|no) &gt;

&lt;!ELEMENT gte           (prop, literal) &gt;
&lt;!ATTLIST gte           caseless   (yes|no) &gt;

&lt;!ELEMENT eq            (prop, literal) &gt;
&lt;!ATTLIST eq            caseless   (yes|no) &gt;

&lt;!ELEMENT literal       (#PCDATA)&gt;

&lt;!ELEMENT is-defined    (prop) &gt;

&lt;!ELEMENT like          (prop, literal) &gt;
&lt;!ATTLIST like          caseless   (yes|no) &gt;

&lt;!ELEMENT contains      (#PCDATA)&gt;

&lt;!ELEMENT orderby       (order+) &gt;
&lt;!ELEMENT order         ((prop | score), (ascending | descending)?)
&lt;!ATTLIST order         caseless   (yes|no) &gt;
&lt;!ELEMENT ascending     EMPTY&gt;
&lt;!ELEMENT descending    EMPTY&gt;

&lt;!ELEMENT limit         (nresults) &gt;
&lt;!ELEMENT nresults      (#PCDATA) &gt;
</artwork></figure>
</ed:ins>
</ed:replace>

<section title="Example Query">
<t>
This query retrieves the content length values for all resources located
under the server's "/container1/" URI namespace whose length exceeds 10000.
</t>
<figure><artwork>
&lt;d:searchrequest xmlns:d="DAV:"&gt;
  &lt;d:basicsearch&gt;
    &lt;d:select&gt;
      &lt;d:prop&gt;&lt;d:getcontentlength/&gt;&lt;/d:prop&gt;
    &lt;/d:select&gt;
    &lt;d:from&gt;
      &lt;d:scope&gt;
        &lt;d:href&gt;/container1/&lt;/d:href&gt;
        &lt;d:depth&gt;infinity&lt;/d:depth&gt;
      &lt;/d:scope&gt;
    &lt;/d:from&gt;
    &lt;d:where&gt;
      &lt;d:gt&gt; 
        &lt;d:prop&gt;&lt;d:getcontentlength/&gt;&lt;/d:prop&gt;
        &lt;d:literal&gt;10000&lt;/d:literal&gt;
      &lt;/d:gt&gt;
    &lt;/d:where&gt;
      &lt;d:orderby&gt;
        &lt;d:order&gt;
        &lt;d:prop&gt;&lt;d:getcontentlength/&gt;&lt;/d:prop&gt;
        &lt;d:ascending/&gt;
      &lt;/d:order&gt;
    &lt;/d:orderby&gt;
  &lt;/d:basicsearch&gt;
&lt;/d:searchrequest&gt;
</artwork></figure>

</section>
</section>

<section title="DAV:select">
<t>
DAV:select defines the result record, which is a set of properties
and values. This document defines two possible values: DAV:allprop
and DAV:prop, both defined in <xref target="RFC2518"/>
and revised in <xref target="RFC3253"/>
.
</t>


</section>

<section title="DAV:from">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="scope-vs-versions" status="open" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002AprJun/0047.html">
  <ed:item date="2003-02-05" entered-by="julian.reschke@greenbytes.de">
  A relatively frequent use case for servers that both support versioning and
  DASL seems to have searches that include all versions of the resources in
  scope. In general, the version URIs may not be in the scope of the query.
  Therefore, I'd like to extend the DAV:scope to specify inclusion of
  versions. This would be an optional extension -- however, a server that does
  not support his feature should reject the request (so that the client would
  know that the request could not be satisfied).
  <br/><br/>
  Example:
  <pre>
    &lt;d:from xmlns:d="DAV:">
      &lt;d:scope>
        &lt;d:href>/container1/&lt;/d:href>
        &lt;d:depth>infinity&lt;/d:depth>
        &lt;d:include-versions />
      &lt;/d:scope>
    &lt;/d:from>
  </pre>
  </ed:item>
  <ed:item date="2003-02-06" entered-by="Martin.Wallmer@softwareag.com">
  just to clarify:
  <br/>
  1. If a resource in scope has versions, the server SHOULD take care of
  versions as well.
  <br/>
  2. If the client specifies &lt;d:include-versions />, the server MUST take care
  of versions or MUST reject the request.
  <br/>
  3. If the user does not want to get versions, he must specify &lt;not
  xmlns="DAV:">&lt;is-defined>&lt;version-name />&lt;/is-defined>&lt;/not> ...
  <br/>
  Is my understanding correct?
  <br/>
  However, a defined "switch" (include - exclude) could be a good hint for the
  server in terms of performance, so I'd prefer a &lt;d:exclude-versions/> as
  well. 
  Alternatively the server should only include the versions, if
  &lt;d:include-versions /> is specified.
  <br/>
  Does this make sense?
  </ed:item>
  <ed:item date="2003-02-06" entered-by="julian.reschke@greenbytes.de">
  I don't like that, because I'd prefer to keep the definition of "scope"
  intact. If versions happen to be in the namespace scope, they should be in
  scope of the search as well. Thus the proposal to add a specific element
  that *extends* the scope of the query.
  </ed:item>
</ed:issue>
<t>
  DAV:from defines the query scope. This contains exactly one DAV:scope
  element. The scope element contains mandatory DAV:href and DAV:depth elements.
</t>
<t>
  DAV:href indicates the URI to use as a scope.
</t>
<t>
  When the scope is a collection, if DAV:depth is "0", the search
  includes only the collection. When it is "1", the search includes the (toplevel)
  members of the collection. When it is "infinity", the search includes all
  recursive members of the collection.
  <ed:ins datetime="2003-01-09" title="2003-01-09, julian.reschke@greenbytes.de">
  When the scope is not a collection, the depth is ignored and the search
  applies just to the resource itself.
  </ed:ins>
</t>

<section title="Relationship to the Request-URI">
<t>
If the DAV:scope element is an absolute URI, the scope is exactly
that URI.
</t>

<t>If the DAV:scope element is  is an absolute URI reference, the scope is taken
to be relative to the request-URI.
</t>
</section>

<section title="Scope">
<t>
A Scope can be an arbitrary URI.
</t>
<t>Servers, of course, may support only particular scopes. This may include
limitations for particular schemes such as "http:" or "ftp:" or certain
URI namespaces.
</t>
<ed:replace datetime="2003-01-09" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="duplicate-invalid-scope"><ed:del>
<t>If a scope is given that is not supported the server MUST respond with
a 400 status code that includes a Multistatus error. A scope in the query
appears as a resource in the response and must include an appropriate status
code indicating its validity with respect to the search arbiter.
</t><figure><preamble>Example:</preamble>
<artwork>HTTP/1.1 400 Bad Request
Content-Type: text/xml; charset="utf-8"
Content-Length: xxx

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;d:multistatus xmlns:d="DAV:"&gt;
  &lt;d:response&gt;
    &lt;d:href&gt;http://www.example.com/scope1&lt;/d:href&gt;
    &lt;d:status&gt;HTTP/1.1 502 Bad Gateway&lt;/d:status&gt;
  &lt;/d:response&gt;
&lt;/d:multistatus&gt;</artwork></figure>
<t>
This example shows the response if there is a scope error. The response
provides a Multistatus with a status for the scope. In this case, the scope
cannot be reached because the server cannot search another server (502).
</t>
</ed:del></ed:replace>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="duplicate-invalid-scope" type="change" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2003JanMar/0001.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
  This is in conflict with section 2.6. Proposal: remove this part.
</ed:item>
</ed:issue>
</section>
</section>


<section title="DAV:where">
<t>
<ed:ins datetime="2003-01-14" title="2003-01-14, julian.reschke@greenbyttes.de">The </ed:ins>DAV:where element defines the search condition for inclusion of
resources in the result set. The value of this element is an XML element
that defines a search operator that evaluates to one of the Boolean truth
values TRUE, FALSE, or UNKNOWN. The search operator contained by DAV:where
may itself contain and evaluate additional search operators as operands,
which in turn may contain and evaluate additional search operators as operands,
etc. recursively.
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="query-on-href" type="change" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002JanMar/0108.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-02-28">DAV:href isn't a property, so 
it can't be used in queries. Is this a problem? Examples where DAV:displayname
is queried instead seem to indicate that. A possible solution would be
to allow DAV:href whereever DAV:prop is allowed in the where clause.</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-11-27">Closed
(nobody seems to care).</ed:item>
</ed:issue>

<section title="Use of Three-Valued Logic in Queries">
<t>
Each operator defined for use in the where clause that returns a Boolean
value MUST evaluate to TRUE, FALSE, or UNKNOWN. The resource under scan
is included as a member of the result set if and only if the search condition
evaluates to TRUE.
</t><t>Consult <xref target="three-valued-logic"/> for details on the application of three-valued logic
in query expressions.
</t>
</section>

<section title="Handling Optional operators">
<t>
If a query contains an operator that is not supported by the server, then
the server MUST respond with a 422 (Unprocessable Entity) status code.
</t>
</section>

<section title="Treatment of NULL Values" anchor="null-values">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="undefined-properties" type="change" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002OctDec/0021.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-11-27">
Shouldn't this say:
<em>
"If a PROPFIND for a property value would yield any non-200 (OK) response
for that property, then that property is considered NULL."</em>?
</ed:item>
</ed:issue>
<t>
If a PROPFIND for a property value would yield a
<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-15" ed:resolves="undefined-properties">
<ed:del>
404 or 403
</ed:del>
<ed:ins>
non-2xx (see <xref target="RFC2616" />, section 10.2)
</ed:ins>
</ed:replace>
response for that property, then that property is considered NULL.
</t>
<t>NULL values are "less than" all other values in comparisons.
</t><t>Empty strings (zero length strings) are not NULL values. An empty string
is "less than" a string with length greater than zero.
</t><t>The DAV:isdefined operator is defined to test if the value
of a property is NULL.
</t>
</section>


<section title="Treatment of properties with mixed/element content" anchor="non-simple-types">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="mixed-content-properties" type="change" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002OctDec/0020.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-11-27">
Does this mean "undefined" as (1) "not defined by this specification" or
(2) as in SQL's three-valued logic?
For the sake of interoperability, I'd vote for (2). If an implementation
wants to support matching in mixed/element content, it will then have to
*explicitly* extend DAV:basicsearch.
</ed:item>
</ed:issue>
<t>
Comparisons of properties that do not have simple types (text-only content) is
out-of-scope
<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2002-12-14" ed:resolves="mixed-content-properties">
<ed:del> DAV:basicsearch.</ed:del>
<ed:ins>
for the standard operators defined for DAV:basicsearch and therefore is defined
to be UNKNOWN (as per <xref target="three-valued-logic"/>).
</ed:ins>
</ed:replace>
For querying the DAV:resourcetype property, see <xref target="OPERATOR_is-collection"/>.
</t>
</section>


<section title="Example: Testing for Equality">
<t>
The example shows a single operator (DAV:eq) applied in the criteria.
</t>


<figure><artwork>&lt;d:where&gt;
  &lt;d:eq&gt;
    &lt;d:prop&gt;
      &lt;d:getcontentlength/&gt;
    &lt;/d:prop&gt;
    &lt;d:literal&gt;100&lt;/d:literal&gt;
  &lt;/d:eq&gt;
&lt;/d:where&gt;</artwork></figure>

</section>

<section title="Example: Relative Comparisons">
<t>
The example shows a more complex operation involving several operators
(DAV:and, DAV:eq, DAV:gt) applied in the criteria.
This DAV:where expression matches those resources that are "image/gifs"
over 4K in size.
</t>
<figure><artwork>&lt;D:where&gt;
  &lt;D:and&gt;
    &lt;D:eq&gt;
      &lt;D:prop&gt;
        &lt;D:getcontenttype/&gt;
      &lt;/D:prop&gt;
      &lt;D:literal&gt;image/gif&lt;/D:literal&gt;
    &lt;/D:eq&gt;
    &lt;D:gt&gt;
      &lt;D:prop&gt;
        &lt;D:getcontentlength/&gt;
      &lt;/D:prop&gt;
      &lt;D:literal&gt;4096&lt;/D:literal&gt;
    &lt;/D:gt&gt;
  &lt;/D:and&gt;
&lt;/D:where&gt;</artwork></figure>



</section>
</section>

<section title="DAV:orderby">
<t>
  The DAV:orderby element specifies the ordering of the result set. It contains
  one or more DAV:order elements, each of which specifies a comparison between
  two items in the result set. Informally, a comparison specifies a test that
  determines whether one resource appears before another in the result set.
  Comparisons are applied in the order they occur in the DAV:orderby element,
  earlier comparisons being more significant.
</t>
<t>
  The comparisons defined here use only a single property from each resource,
  compared using the same ordering as the DAV:lt operator
  (ascending<iref item="DAV:ascending" subitem="XML element" primary="true"/>)
  or DAV:gt operator
  (descending<iref item="DAV:descending" subitem="XML element" primary="true"/>).
  If neither direction is specified, the default is DAV:ascending.
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="null-ordering" type="edit" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002JanMar/0101.html">
<ed:item entered-by="ameliac@us.ibm.com" date="2002-02-20">
  In the WebDAV SEARCH spec (5.6, DAV:orderby), it says that nulls sort low, to match SQL92.
  However, SQL92 and SQL99 both say "Whether a sort key value that is null is
  considered greater or less than a non-null value is implementation-defined,
  but all sort key values that are null shall either be considered greater than
  all non-null values or be considered less than all non-null values."
  (words taken from SQL99, 14.1 &lt;declare cursor&gt; General Rule 2)c), in
  reference to null handling for the &lt;order by clause&gt;. )
  I would note that in 5.5.3 WebDAV SEARCH says nulls are less than all
  other values in a comparison, so the DAV:orderby matches that statement,
  it just gives an inaccurate reason.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
  Seems to me that if SQL databases are free to decide where to sort
  NULL values (as long as they are consistent), we probably need to be just
  as flexible in DASL (otherwise we can't directly map to a SQL query).
</ed:item>
<ed:item entered-by="ABabich@filenet.com" date="2003-01-09">
(1) Amelia is completely correct.
<br/>(2) We MUST specify a definite ordering for nulls in the collation
sequence if we ever hope to extend DASL in the future to
cross-repository queries that do ordering. (Trust me, customers really
want that.) Despite the fact that the SQL spec. caved in to one or more
vendors who didn't want to change their implementation of where nulls
sort, there is only one logical choice as to where null values sort --
before all non-null values. That is because shorter strings always
collate before longer strings, and zero length strings are the shortest
strings of all. That is the way the DASL spec. is written.
<br/>(3) The only imperfection in the spec is that, as Amelia says, the
reason is inaccurate. So, to correct the imperfection, you might say
something like the following:
<br/>
"Nulls sort low, i.e., before all non null values. That is compatible
with the SQL92 and SQL99 specs., and it is essential for a future
extension for cross-repository searching."
<br/>
Or, you could just say "That is compatible with the SQL92 and SQL99
specs." for the reason.
</ed:item>
</ed:issue>
<t>In the context of the DAV:orderby element, null values are
considered to collate before any actual (i.e., non null) value, including
strings of zero length
<ed:replace ed:resolves="null-ordering" ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-09">
<ed:del>(as in <xref target="SQL99"/>).</ed:del>
<ed:ins>(this is compatible with <xref target="SQL99"/>).</ed:ins>
</ed:replace>

</t>

<section title="Comparing Natural Language Strings">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="language-comparison" status="open" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002JanMar/0122.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-03-03">
XPath/XQuery (see <a href="http://www.w3.org/TR/xquery-operators/#string-compare">draft</a>,
and <a href="http://www.w3.org/TR/xquery-operators/#operator-collation-relation-to-lang">open issue</a>)
specify string comparisons based on collations, not languages. I think we should
adopt this. This would mean that "xml:lang" would be removed, and an optional
attribute specifying the name of the collation is added.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
Proposal: adopt "lang" and "collation" attribute from XSLT 2.0's 
<a href="http://www.w3.org/TR/xslt20/#element-sort">xsl:sort</a>.
</ed:item>
</ed:issue>
<t>
Comparisons on strings take into account the language defined for that
property. Clients MAY specify the language using the xml:lang attribute.
If no language is specified either by the client or defined for that property
by the server or if a comparison is performed on strings of two different
languages, the results are undefined.
</t>
<t>
The <ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del>"casesensitive"</ed:del><ed:ins>"caseless"</ed:ins></ed:replace> attribute may be used to indicate case-sensitivity
for comparisons.<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del> Servers SHOULD do caseless matching as defined in <xref target="CaseMap"/>.</ed:del></ed:replace>
</t>
</section>

<section title="Example of Sorting">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="order-precedence" type="edit" status="closed" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2003JanMar/0020.html">
  <ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-14">
    This example seems to contradict section 5.6: "Comparisons are applied in
    the order they occur in the DAV:orderby element, earlier comparisons being
    more significant."
  </ed:item>
</ed:issue>
<t>
This sort orders first by last name of the author, and then by size, in
descending order, so that <ed:replace datetime="2003-01-28" ed:resolves="order-precedence" ed:entered-by="julian.reschke@greenbytes.de"><ed:ins>for each author, </ed:ins></ed:replace>the largest works appear first.
</t>
<figure><artwork>&lt;d:orderby&gt;
  &lt;d:order&gt;
    &lt;d:prop&gt;&lt;r:lastname/&gt;&lt;/d:prop&gt;
    &lt;d:ascending/&gt;
  &lt;/d:order&gt;
  &lt;d:order&gt;
    &lt;d:prop&gt;&lt;d:getcontentlength/&gt;&lt;/d:prop&gt;
    &lt;d:descending/&gt;
  &lt;/d:order&gt;
&lt;/d:orderby&gt;</artwork></figure>
</section>
</section>


<section title="Boolean Operators: DAV:and, DAV:or, and DAV:not">
<t>
The DAV:and operator performs a logical AND operation on the expressions
it contains.
</t><t>The DAV:or operator performs a logical OR operation on the
values it contains.
</t><t>The DAV:not operator performs a logical NOT operation on the
values it contains.
</t>
</section>

<section title="DAV:eq">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW24c" status="closed" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">
  How do string equality and language tag interact. Cross-language comparison
  should work at least when the two languages are dialects, e.g. en-us vs en-uk.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-01-28">
  Proposal: strings match if and only if they match character by character.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
  Note that XPath 2.0 currently defines no collation-aware equality
  operator, so I think we should just follow that example. Note that this
  basically is a duplicate of issue <a href="#rfc.issue.JW16b/JW24a">JW16b/JW24a</a>.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-28">
  They don't interact. See separate issue on putting conditions on the xml:lang attribute.
</ed:item>
</ed:issue>
<t>
The DAV:eq operator provides simple equality matching on property values.
</t>
<t>
The <ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del>"casesensitive"</ed:del><ed:ins>"caseless"</ed:ins></ed:replace> attribute may be used with this element.
</t>
</section>

<section title="DAV:lt, DAV:lte, DAV:gt, DAV:gte">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW16b/JW24a" status="open" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">
  Define how comparisons on strings work, esp for i18n.<br/>
  Need policy statement about sort order in various national languages. (JW said
  "non-Latin" but it's an issue even in languages that use the latin char set.)
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-28">
  This issue not only applies to the comparison operators, but also to ordering!
</ed:item>
</ed:issue>
<t>
The DAV:lt, DAV:lte, DAV:gt, and DAV:gte
operators provide comparisons on property values, using less-than, less-than
or equal, greater-than, and greater-than or equal respectively. The 
<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del>"casesensitive"</ed:del><ed:ins>"caseless"</ed:ins></ed:replace>
 attribute may be used with these elements.
</t>
</section>

<section title="DAV:literal">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="DB2/DB7" status="open" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999OctDec/0023.html">
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">Dates (HTTPDate in getlastmodified).</ed:item>
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">Agreement that it is OK to submit isodate to search HTTPDate (i.e., it's a marshalling issue only).</ed:item>
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">Booleans appear to be underspecified in the specification. How is a boolean tested, and what are the behavior of operators like less than, greater than, etc.</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-01-28">I think similar questions apply to booleans. Proposal: allow specification
of the literal's type using XML Schema simple types, and declare that "both" WebDAV date types are compatible.</ed:item>
<ed:item entered-by="ABabich@filenet.com" date="2002-01-29">
The current DASL draft doesn't really have Booleans or any other data type.
It's trying to skate on data types. Booleans could be tested using the "eq"
and the combination "not eq", if you had well defined literals for TRUE and
FALSE. With the current syntax, that is the way you would have to test a
Boolean. Generally, Boolean values are not considered to be ordered, so "gt"
etc. wouldn't apply. However, if the literal values of a Boolean were 1 and
0 for TRUE and FALSE (using the most commonly used convention of positive
logic), then you would have an obvious ordering. 1 and 0 have the advantage
of being language independent. You now see a lot of electronic and
electro-mechanical devices (air conditioners, computers, etc.) with a "1/0"
label on the power switch, "1" meaning "on", and "0" meaning "off".
<br/>
SQL databases don't have Booleans. SQL doesn't control DASL, of course, but
SQL databases are so widely used that they are important. The closest thing
in SQL is a bit field. Each bit in a bit field is zero or 1. 
<br/>
So, why not close the issue by saying: DASL doesn't have data types. You can
simulate Booleans by an integer data type, using 1 for "TRUE" and 0 for
"FALSE".
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-10-22">
let's consider a dead property "foo", and some resources a, b and c on which
this dead property is defined and has the values "1", "3" and "10".
<br/>
Consider a DAV:basicsearch with the where clause:
<br/>
<pre>
&lt;gte xmlns="DAV:"&gt;
  &lt;prop&gt;&lt;foo xmlns=""/&gt;&lt;/prop&gt;
  &lt;literal&gt;3&lt;/literal&gt;
&lt;/gte&gt;
</pre>
<br/>
Which resource will match?
<br/>
As DAV:basicsearch currently isn't type-aware, the server will have to do a
string comparison, and only the b (with value "3") will match.
<br/>
Is this really sufficient? It basically means that dead property comparisons
are restricted to strings.
<br/>
Proposals:
<br/>
a) If the server happens to have type information for a dead property, it
should try to do a comparison according to the known property type, if the
literal can be parsed into this type. This basically replicates the
behaviour that a client would expect when querying on live properties such
as DAV:getcontentlength, so it could be taken as a simple clarification.
<br/>
Extended proposal:
<br/>
b) A client can enforce comparison using a specific data type by specifying
the type in the query, for instance using:
<br/>
<pre>
&lt;gte xmlns="DAV:"&gt;
  &lt;prop&gt;&lt;foo xmlns=""/&gt;&lt;/prop&gt;
  &lt;literal xsi:type="xs:long"&gt;3&lt;/literal&gt;
&lt;/gte&gt;
</pre>
</ed:item>
<ed:item entered-by="Martin.Wallmer@softwareag.com" date="2002-11-25">
What about existing implementations? Currently a server might react with 
"xsi:type unknown entity" or just ignore it (which would mean: String
comparison)
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-11-25">
OK, how about *adding* an alternative to DAV:literal? Therefore:
<br/>
DAV:literal: untyped, server can compare according to it's internal
knowledge of types (with the clarification above)
<br/>
DAV:typed-literal: typed according to the xsi:type attribute -- "new"
servers can implement this without affecting any existing code.
<br/>
We'll need to think about discovery of this feature, though. It might be
possible to do this with QSD (in the meantime, are there any QSD
implementations except ours?)
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-28">
  WG meeting feedback: define DAV:typed-literal. Also allow DAV:literal
  to be evaluated by the server according "internal" type knowledge.
  Require timestamps to be ISO, even for DAV:getlastmodified.
</ed:item>
</ed:issue>
<t>
DAV:literal allows literal values to be placed in an expression.
</t>
<t>
White space in literal values is significant in comparisons. For consistency
with <xref target="RFC2518"/>, clients SHOULD NOT specify the attribute "xml:space"
(section 2.10 of <xref target="XML"/>) to override this behaviour.
</t>
<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-28" ed:resolves="DB2/DB7">
<ed:ins>
<t>
  In comparisons, the contents of DAV:literal SHOULD be treated as string, with
  the following exceptions:
  <list style="symbols">
    <t>when operand for a comparison with a DAV:getcontentlength property,
    it SHOULD be treated as an integer value (the behaviour for non-integer values
    is undefined),
    </t>
    <t>when operand for a comparison with a DAV:creationdate or DAV:getlastmodified property,
    it SHOULD be treated as a date value in the ISO-8601 subset defined for
    the DAV:creationdate property (<xref target="RFC2518"/>, section 13.1).
    </t>
    <t>when operand for a comparison with a property for which the type is known,
    it MAY be treated according to this type.
    </t>
  </list>
</t>
</ed:ins>
</ed:replace>
</section>

<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-15" ed:resolves="DB2/DB7">
<ed:ins>
<section title="DAV:typed-literal (optional)">
<t>
  There are situations in which a client may want to force a comparison not to
  be string-based (as defined for DAV:literal). In these cases, a typed
  comparison can be enforced by using DAV:typed-literal instead.
</t>
<figure><artwork>
&lt;!ELEMENT typed-literal (#PCDATA)&gt;
</artwork></figure>
<t>
  The data type is specified using the xsi:type attribute defined in
  <xref target="XS1"/>, section 2.6.1. If the type is not specified, it
  defaults to "xs:string".
</t>
<t>
  A server MUST reject a request with an unknown type.
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="typed-literal" type="change" status="open">
  <ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-15">
  1. (insert language defining the comparison following the rules defined in
  http://www.w3.org/TR/xpath20/#id-comparisons).
  <br/>
  2. Extend Basicsearch QSD grammar to support discovery of typed-literal
  <br/>
  3. Update DTD.
  <br/>
  4. Discuss behaviour of DAV:literal when the property's type is known
  for the complete search scope (is the server allowed to be "smart"?)
  </ed:item>
</ed:issue>

<section title="Example for typed numerical comparison">
<t>
  Consider a set of resources with the dead property "edits" in the namespace
  "http://ns.example.org":
</t>
<figure><artwork>
URI    property value

/a     "-1"
/b     "01"
/c     "3"
/d     "test"
/e     (undefined)</artwork></figure>
<t>
  The expression
</t>
<figure><artwork>
&lt;lt xmlns="DAV:"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:xs="http://www.w3.org/2001/XMLSchema">
  &lt;prop>&lt;edits xmlns="http://ns.example.org"/>&lt;/prop>
  &lt;typed-literal xsi:type="xs:integer">3&lt;/typed-literal>
&lt;/lt>
</artwork></figure>
<t>
  will evaluate to TRUE for the resources "/a" and "/b" (their property values
  can be parsed as type xs:number, and the numerical comparison evaluates to
  true), to FALSE for "/c" (property value is compatible, but numerical comparison
  evaluates to false) and UNKNOWN fot "/d" and "/e" (the property either is
  undefined, or its value can not be parsed as xs:number).
</t>
</section>
</section>
</ed:ins>
</ed:replace>


<section title="DAV:is-collection" anchor="OPERATOR_is-collection">

<t>
The DAV:is-collection operator allows clients to determine whether a resource is
a collection (that is, whether it's DAV:resourcetype element contains the
element DAV:collection). 
</t>
<t>Rationale: This operator is provided in lieu of defining generic
structure queries, which would suffice for this and for many more powerful
queries, but seems inappropriate to standardize at this time.

</t>

<section title="Example of DAV:is-collection">
<t>
This example shows a search criterion that picks out all and only the resources
in the scope that are collections.
</t>
<figure><artwork>&lt;where xmlns="DAV:"&gt;
  &lt;is-collection/&gt;
&lt;/where&gt;</artwork></figure>

</section>
</section>

<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-28">
<ed:del>
<section title="DAV:isdefined">
<t>
The DAV:isdefined operator allows clients to determine whether
a property is defined on a resource. The meaning of "defined on a resource"
is found in <xref target="null-values"/>.
</t><t>Example:</t>
<figure><artwork>&lt;d:isdefined&gt;
  &lt;d:prop&gt;&lt;x:someprop/&gt;&lt;/d:prop&gt;
&lt;/d:isdefined&gt;</artwork></figure>
</section>
</ed:del>
<ed:ins>
<section title="DAV:is-defined">
<t>
The DAV:is-defined operator allows clients to determine whether
a property is defined on a resource. The meaning of "defined on a resource"
is found in <xref target="null-values"/>.
</t><t>Example:</t>
<figure><artwork>&lt;d:is-defined&gt;
  &lt;d:prop&gt;&lt;x:someprop/&gt;&lt;/d:prop&gt;
&lt;/d:is-defined&gt;</artwork></figure>
</section>
</ed:ins>
</ed:replace>

<section title="DAV:like">
<t>
The DAV:like is an optional operator intended to give simple wildcard-based
pattern matching ability to clients.
</t><t>The operator takes two arguments.
</t><t>The first argument is a DAV:prop element identifying a single
property to evaluate.
</t>

<t>The second argument is a DAV:literal element that gives the
pattern matching string.
</t>

<section title="Syntax for the Literal Pattern">


<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2002-11-28" ed:resolves="like-exactlyone">
<ed:del>
<figure><artwork>Pattern := [wildcard] 0*( text [wildcard] )
wildcard := exactlyone | zeroormore 
text := 1*( &lt;character&gt; | escapesequence )
exactlyone : = "?"
zeroormore := "%"
escapechar := "\"
escapesequence := "\" ( exactlyone | zeroormore | escapechar )
character: see section 2.2 of [XML]
</artwork></figure>
</ed:del>
<ed:ins>
<figure><artwork>Pattern := [wildcard] 0*( text [wildcard] )
wildcard := exactlyone | zeroormore 
text := 1*( &lt;character&gt; | escapesequence )
exactlyone : = "_"
zeroormore := "%"
escapechar := "\"
escapesequence := "\" ( exactlyone | zeroormore | escapechar )
character: valid XML characters (see section 2.2 of [XML]),
           minus ( exactlyone | zeroormore | escapechar )
</artwork></figure>
</ed:ins>
</ed:replace>


<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="like-exactlyone" status="closed" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002OctDec/0012.html">
  <ed:item date="2002-11-27" entered-by="julian.reschke@greenbytes.de">
    SQL actually uses "_" for "exactlyone".
  </ed:item>
  <ed:item date="2002-11-28" entered-by="julian.reschke@greenbytes.de">
    Replaced the character, also fixed the "character" production ("( exactlyone | zeroormore | escapechar )" are not valid characters here,
    because they need to be escaped).
  </ed:item>  
</ed:issue>

<t>
The value for the literal is composed of wildcards separated by segments
of text. Wildcards may begin or end the literal.
<ed:replace datetime="2003-01-29" ed:resolves="like-wildcard-adjacent" ed:entered-by="julian.reschke@greenbytes.de"><ed:del> Wildcards may not be adjacent.</ed:del></ed:replace>
</t>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="like-wildcard-adjacent" status="closed" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002OctDec/0014.html">
  <ed:item date="2002-11-27" entered-by="julian.reschke@greenbytes.de">
This seems to imply that "__" (to match any
two-character sequence) is not allowed. Does anybody remember why one would
want that?
  </ed:item>
  <ed:item date="2002-12-14" entered-by="julian.reschke@greenbytes.de">
Another thing I'd like to see clarified:
Is it allowed to use "\" to escape characters other than "\", "%" and "_"? What does ANSI SQL say about this?
  </ed:item>
  <ed:item date="2003-01-29" entered-by="julian.reschke@greenbytes.de">
Feedback from Fred Zemke (Oracle):
<br/>
1) I just looked in the SQL standard and did not see anything prohibiting
two consecutive underscores as a pattern.  If anyone disagrees, please
tell me the basis for your disagreement.  My basis is SQL:1999 Foundation
8.5 &lt;like predicate> GR 3)b)i)2).
<br/>
2) The standard does not permit the escape character to be used in
a LIKE predicate patterm, except immediately before another
escape character, the underscore or the percent sign.  An implementation
is supposed to raise an exception otherwise. [SQL:1999 Foundation
8.5 &lt;like predicate> GR 3)b)i)2) ].  However, I believe it is a
common vendor practice to permit the escape character to precede
any character.  Such an implementation is, strictly speaking, nonconforming,
though users seldom complain if a vendor finds a way to process a
statement without raising an exception.
  </ed:item>
</ed:issue>
<t>The "?" wildcard matches exactly one character.
</t><t>The "%" wildcard matches zero or more characters
</t><t>The "\" character is an escape sequence so that the literal can include
"?" and "%". To include the "\" character in the pattern, the escape sequence
"\\" is used.<ed:replace datetime="2003-01-29" ed:resolves="like-wildcard-adjacent" ed:entered-by="julian.reschke@greenbytes.de">
  <ed:del>.</ed:del>
</ed:replace>
</t>
</section>

<section title="Example of DAV:like">
<t>
This example shows how a client might use DAV:like to identify
those resources whose content type was a subtype of image.
</t>
<ed:replace datetime="2003-02-07" ed:entered-by="julian.reschke@greenbytes.de">
<ed:del>
<figure><artwork>&lt;D:where&gt;
  &lt;D:like&gt;
    &lt;D:prop&gt;&lt;D:getcontenttype/&gt;&lt;/D:prop&gt;
    &lt;D:literal&gt;image%&lt;/D:literal&gt;
  &lt;/D:like&gt;
&lt;/D:where&gt;</artwork></figure>
</ed:del>
<ed:ins>
<figure><artwork>&lt;D:where&gt;
  &lt;D:like caseless="yes"&gt;
    &lt;D:prop&gt;&lt;D:getcontenttype/&gt;&lt;/D:prop&gt;
    &lt;D:literal&gt;image/%&lt;/D:literal&gt;
  &lt;/D:like&gt;
&lt;/D:where&gt;</artwork></figure>
</ed:ins>
</ed:replace>

</section>
</section>



<section title="DAV:contains">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW17/JW24b" status="closed" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
  <ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">
    5.13 should discuss handling of queries when character set differs.
    <br/>Some text on handling character sets would be helpful.
  </ed:item>
  <ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-10">
    There's not a lot we can say -- the charset for the query is irrelevant
    due to XML, and charsets in the resources to be searched are treated
    seems to be very server-specific. As the semantics for DAV:contains
    are intentionally very flexible, I think we shouldn't say anything about
    this topic.
  </ed:item>
</ed:issue>
<t>
The DAV:contains operator is an optional operator that provides
content-based search capability. This operator implicitly searches against
the text content of a resource, not against content of properties. The
DAV:contains operator is intentionally not overly constrained, in order to allow the
server to do the best job it can in performing the search.
</t>
<t>
The DAV:contains operator evaluates to a Boolean value. It
evaluates to TRUE if the content of the resource satisfies the search.
Otherwise, It evaluates to FALSE.
</t
><t>
Within the DAV:contains XML element, the client provides a
phrase: a single word or whitespace delimited sequence of words. Servers
MAY ignore punctuation in a phrase. Case-sensitivity is left to the server.
</t>
<t>
The following things may or may not be done as part of the search: Phonetic
methods such as "soundex" may or may not be used. Word stemming may or
may not be performed. Thesaurus expansion of words may or may not be done.
Right or left truncation may or may not be performed. The search may be
case insensitive or case sensitive. The word or words may or may not be
interpreted as names. Multiple words may or may not be required to be adjacent
or "near" each other. Multiple words may or may not be required to occur
in the same order. Multiple words may or may not be treated as a phrase.
The search may or may not be interpreted as a request to find documents
"similar" to the string operand.
</t>
<ed:replace ed:resolves="score-pseudo-property" ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-09">
<ed:del>
<t>
The DAV:score property is intended to be useful to rank documents
satisfying the DAV:contains operator.
</t>
</ed:del>
<ed:ins>
<section title="Result scoring (DAV:score element)" anchor="score"><iref item="DAV:score" subitem="XML element" primary="true"/>
<t>
Servers SHOULD indicate scores for the DAV:contains condition by adding a
DAV:score XML element to the DAV:response element. It's value is defined only
in the context of a particular query result. The value is a string representing
the score, an integer from zero to 10000 inclusive, where a higher value
indicates a higher score (e.g. more relevant).
</t>
<figure>
<preamble>Modified DTD fragment for DAV:propstat:</preamble><artwork>
&lt;!ELEMENT response (href, ((href*, status)|(propstat+)),
                    responsedescription?, score?) >
&lt;!ELEMENT score    (#PCDATA) &gt;
</artwork></figure>
<t>
Clients should note that, in general, it is not meaningful to compare
the numeric values of scores from two different query results unless both were
executed by the same underlying search system on the same collection of
resources.
</t>
</section>
</ed:ins>
</ed:replace>

<ed:replace ed:resolves="score-pseudo-property" ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-02-07">
<ed:ins>
<section title="Ordering by score">
<t>
  To order search results by their score, the DAV:score element may be added
  as child to the DAV:orderby element (in place of a DAV:prop element).
</t>
</section>
</ed:ins>
</ed:replace>

<section title="Examples">
<t>
The example below shows a search for the phrase "Peter Forsberg".
</t><t>Depending on its support for content-based searching, a server MAY treat
this as a search for documents that contain the words "Peter" and "Forsberg".
</t>
<figure><artwork>&lt;D:where&gt;
  &lt;D:contains&gt;Peter Forsberg&lt;/D:contains&gt;
&lt;/D:where&gt;</artwork></figure>
<t>
The example below shows a search for resources that contain "Peter" and
"Forsberg".
</t>
<figure><artwork>&lt;D:where&gt;
  &lt;D:and&gt;
    &lt;D:contains&gt;Peter&lt;/D:contains&gt;
    &lt;D:contains&gt;Forsberg&lt;/D:contains&gt;
  &lt;/D:and&gt;
&lt;/D:where&gt;</artwork></figure>
</section>
</section>


<ed:replace ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-10" ed:resolves="limit-vs-ordering">
<ed:del>
<section title="The DAV:limit XML Element">
<figure><artwork>&lt;!ELEMENT limit (nresults) &gt;</artwork></figure>
<t>
The DAV:limit XML element contains requested limits from the client
to limit the size of the reply or amount of effort expended by the server.
</t>
</section>

<section title="The DAV:nresults XML Element">

<figure><artwork>&lt;!ELEMENT nresults (#PCDATA)&gt; ;only digits</artwork></figure>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW5" status="closed" type="change" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
<ed:item entered-by="ejw@ics.uci.edu" date="1999-04-26">On the topic of partial search results, DASL currently has no way
  for a client to request the next chunk of a set of search results.
  Since *every* search service I've interacted with on the Internet
  has a feature for returning the next set of search results, I really
  would expect this feature to be in DASL. An explanation for why this
  feature isn't present should be in the protocol specification if it
  is not going to be supported.
</ed:item>
<ed:item entered-by="Martin.Wallmer@softwareag.com" date="2002-03-08">
of course this issue is legitim. However, as basicsearch should be as simple
as possible, I tend to say out of scope as well. But perhaps this could be
an optional feature (is it that, what you mean by extension to
DAV:basicsearch)? 
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-03-08">
Moved into DAV:basicsearch section, because this is a request for a specific
query grammar feature.
</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">
Closed because of lacking feedback.
</ed:item>
</ed:issue>
<t>
The DAV:nresults XML element contains a requested maximum number
of records to be returned in a reply. The server MAY disregard this limit.
The value of this element is an integer.
</t>

<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="limit-vs-ordering" status="closed" type="edit" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/2002OctDec/0033.html">
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-02-07">
The spec as written does not define any interaction between DAV:nresults and DAV:score, so if you'd ask
for 10 results, sorted by score, you still couldn't rely on the 10 results
being reported actually *being*  the top 10 results. Of course that's what
people probably would expect, so it seems we need to fix this (the
interaction of limiting the result set and sorting the results) anyway.
</ed:item>
</ed:issue>
</section>
</ed:del>
<ed:ins>
<section title="Limiting the result set">
<iref item="DAV:limit" subitem="XML element" primary="true"/>
<iref item="DAV:nresults" subitem="XML element" primary="true"/>
<figure><artwork>&lt;!ELEMENT limit (nresults) &gt;
&lt;!ELEMENT nresults (#PCDATA)&gt; ;only digits</artwork></figure>
<t>
The DAV:limit XML element contains requested limits from the client
to limit the size of the reply or amount of effort expended by the server.
The DAV:nresults XML element contains a requested maximum number
of DAV:response elements to be returned in the response body.
The server MAY disregard this limit.
The value of this element is an integer.
</t>
<section title="Relationship to result ordering"><iref item="DAV:score" subitem="relationship to DAV:orderby" primary="true"/>
<t>
  If the result set is both limited by DAV:limit and ordered according to
  DAV:orderby, the results that are included in the response document must be
  those that order highest.
</t>
</section>
</section>
</ed:ins>
</ed:replace>

<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="case-insensitivity-name" status="closed" type="change">
  <ed:item date="2002-01-09" entered-by="julian.reschke@greenbytes.de">
    The attribute probably should be renamed to "caseless".
  </ed:item>
</ed:issue>
<ed:replace datetime="2003-02-07" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name">
<ed:del>
<section title="The &#34;casesensitive&#34; XML attribute">
<t>
The "casesensitive" attribute allows clients to specify case-sensitive
or case-insensitive behavior for DAV:basicsearch operators.
</t><t>The possible values for "casesensitive" are "1" or "0". The
"1" value indicates case-sensitivity. The "0" value indicates case-insensitivity.
The default value is server-specified.
Case-insensitivity SHOULD <ed:ins datetime="2003-01-09" title="2003-01-09, julian.reschke@greenbytes.de">be </ed:ins>implemented using caseless matching as defined in <xref target="CaseMap"/>.

</t><t>Support for the "casesensitive" attribute is optional. A server should
respond with a status of 422 if it is
used but cannot be supported.
</t>
</section>
</ed:del>
<ed:ins>
<section title="The &#34;caseless&#34; XML attribute">
<t>
  The "caseless" attribute allows clients to specify caseless matching behaviour
  instead of character-by-character matching for DAV:basicsearch operators.
</t>
<t>
  The possible values for "caseless" are "yes" or "no". The default value is
  server-specified. Caseless matching SHOULD be implemented as defined in
  <xref target="CaseMap"/>.
</t>
<t>
  Support for the "caseless" attribute is optional. A server should
  respond with a status of 422 if it is used but cannot be supported.
</t>
</section>
</ed:ins>
</ed:replace>

<ed:replace ed:resolves="score-pseudo-property" ed:entered-by="julian.reschke@greenbytes.de" datetime="2003-01-09">
<ed:del>
<section title="The DAV:score Property">

<figure><artwork>&lt;!ELEMENT score (#PCDATA)&gt;</artwork></figure>
<t>
The DAV:score XML element is a synthetic property whose value
is defined only in the context of a query result where the server computes
a score, e.g. based on relevance. It may be used in DAV:select
or DAV:orderby elements. Servers SHOULD support this property.
The value is a string representing the score, an integer from zero to 10000
inclusive, where a higher value indicates a higher score (e.g. more relevant).
</t>
<t>
Clients should note that, in general, it is not meaningful to compare
the numeric values of scores from two different query results unless both were
executed by the same underlying search system on the same collection of
resources.
</t>
</section>
</ed:del>
</ed:replace>
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="score-pseudo-property" status="closed" type="change">
  <ed:item date="2002-02-28" entered-by="julian.reschke@greenbytes.de">
    Shouldn't be done using a pseudo-property. Report
    it as child of DAV:propstat instead?
  </ed:item>
  <ed:item date="2002-11-27" entered-by="julian.reschke@greenbytes.de">
    Proposal:<br/>
    - remove language about it being a pseudo-property (no need to DAV:select 
    it, do not support ordering on it)<br/>
    - marshall it as child element of DAV:response within the search result (say
    that it SHOULD be added if the query involved DAV:contains)
  </ed:item>
</ed:issue>


<section title="Query schema for DAV:basicsearch" anchor="qs-basicsearch">
<t>
The DAV:basicsearch grammar defines a search criteria that is
a Boolean-valued expression, and allows for an arbitrary set of properties
to be included in the result record. The result set may be sorted on a
set of property values. Accordingly the DTD for schema discovery for this
grammar allows the server to express:
</t>
<t><list style="numbers"><t>the set of properties that may be either searched, returned, or used
to sort, and a hint about the data type of such properties</t>
<t>the set of optional operators defined by the resource.</t>
</list></t>

<section title="DTD for DAV:basicsearch QSD">

<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name">
<ed:del>
<figure><artwork>&lt;!ELEMENT basicsearchschema  (properties, operators)&gt;
&lt;!ELEMENT any-other-property EMPTY&gt;
&lt;!ELEMENT properties         (propdesc*)&gt;
&lt;!ELEMENT propdesc           (prop|any-other-property), datatype?,
                              searchable?, selectable?, sortable?,
                              casesensitive?)&gt;
&lt;!ELEMENT operators          (opdesc*)&gt;
&lt;!ELEMENT opdesc             ANY&gt;
&lt;!ELEMENT operand-literal    EMPTY&gt;
&lt;!ELEMENT operand-property   EMPTY&gt;
</artwork></figure>
</ed:del>
<ed:ins>
<figure><artwork>&lt;!ELEMENT basicsearchschema  (properties, operators)&gt;
&lt;!ELEMENT any-other-property EMPTY&gt;
&lt;!ELEMENT properties         (propdesc*)&gt;
&lt;!ELEMENT propdesc           (prop|any-other-property), datatype?,
                              searchable?, selectable?, sortable?,
                              caseless?)&gt;
&lt;!ELEMENT operators          (opdesc*)&gt;
&lt;!ELEMENT opdesc             ANY&gt;
&lt;!ELEMENT operand-literal    EMPTY&gt;
&lt;!ELEMENT operand-property   EMPTY&gt;
</artwork></figure>
</ed:ins>
</ed:replace>
<t>
The DAV:properties element holds a list of descriptions of properties.
</t>
<t>
The DAV:operators element describes the optional operators
that may be used in a DAV:where element.
</t>
</section>

<section title="DAV:propdesc Element">
<t>
Each instance of a DAV:propdesc element describes the property
or properties in the DAV:prop element it contains. All subsequent
elements are descriptions that apply to those properties. All descriptions
are optional and may appear in any order. Servers SHOULD support all the
descriptions defined here, and MAY define others.
</t>
<t>
DASL defines five descriptions. The first, DAV:datatype, provides
a hint about the type of the property value, and may be useful to a user
interface prompting for a value. The remaining four (DAV:searchable,
DAV:selectable, DAV:sortable, and <ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del>DAV:casesensitive</ed:del><ed:ins>DAV:caseless</ed:ins></ed:replace>)
identify portions of the query (DAV:where, DAV:select,
and DAV:orderby, respectively). If a property has a description
for a section, then the server MUST allow the property to be used in that
section. These descriptions are optional. If a property does not have such
a description, or is not described at all, then the server MAY still allow
the property to be used in the corresponding section.
</t>

<section title="DAV:any-other-property">
<t>
This element can be used in place of DAV:prop to describe properties of
WebDAV properties not mentioned in any other DAV:prop element. For instance,
this can be used to indicate that all other properties are searchable and selectable
without giving details about their types (a typical scenario for dead properties).</t>
</section>

</section>

<section title="The DAV:datatype Property Description">
<t>
The DAV:datatype element contains a single XML element that provides
a hint about the domain of the property, which may be useful to a user
interface prompting for a value to be used in a query.
Datatypes are identified by an element name. Where appropriate, a server SHOULD
use the simple datatypes defined in <xref target="XS2"/>.
</t>
<figure><artwork>&lt;!ELEMENT datatype ANY &gt;</artwork></figure>
<t>
Examples from <xref target="XS2"/>, <eref target="http://www.w3.org/TR/xmlschema-2/#built-in-datatypes">section 3</eref>:
</t>
<figure><artwork>
Qualified name      Example

xs:boolean          true, false, 1, 0
xs:string           Foobar
xs:dateTime         1994-11-05T08:15:5Z
xs:float            .314159265358979E+1
xs:integer          -259, 23
</artwork></figure>
<t>If the data type of a property is not given, then the data type defaults
to 
xs:string.
</t>
</section>

<section title="The DAV:searchable Property Description">
<figure><artwork>&lt;!ELEMENT searchable EMPTY&gt;</artwork></figure>
<t>
If this element is present, then the server MUST allow this property to
appear within a DAV:where element where an operator allows a property.
Allowing a search does not mean that the property is guaranteed to be defined
on every resource in the scope, it only indicates the server's willingness
to check.
</t>
</section>

<section title="The DAV:selectable Property Description">
<figure><artwork>&lt;!ELEMENT selectable EMPTY&gt;</artwork></figure>
<t>
This element indicates that the property may appear in the DAV:select
element.
</t>
</section>

<section title="The DAV:sortable Property Description">
<t>
This element indicates that the property may appear in the DAV:orderby
element.
</t>
<figure><artwork>&lt;!ELEMENT sortable EMPTY&gt;</artwork></figure>
</section>

<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name">
<ed:del>
<section title="The DAV:casesensitive Property Description">
<t>
This element only applies to properties whose data type is "xs:string" 
and derived data types
as
per the DAV:datatype property description. Its presence indicates
that compares performed for searches, and the comparisons for ordering
results on the string property will be case sensitive. (The default is
case insensitive.)
</t>
<figure><artwork>&lt;!ELEMENT casesensitive EMPTY&gt;</artwork></figure>
</section>
</ed:del>
<ed:ins>
<section title="The DAV:caseless Property Description">
<t>
This element only applies to properties whose data type is "xs:string" 
and derived data types as per the DAV:datatype property description. Its presence indicates
that compares performed for searches, and the comparisons for ordering
results on the string property will be caseless (the default is
character-by-character).
</t>
<figure><artwork>&lt;!ELEMENT caseless EMPTY&gt;</artwork></figure>
</section>
</ed:ins>
</ed:replace>

<section title="The DAV:operators XML Element">
<t>
The DAV:operators element describes every optional operator supported
in a query. (Mandatory operators are not listed since they are mandatory
and permit no variation in syntax.). All optional operators that are supported
MUST be listed in the DAV:operators element. The listing for an
operator consists of the operator (as an empty element), followed by one
element for each operand. The operand MUST be either

DAV:operand-property or DAV:operand-literal,
 which indicate that the operand in the
corresponding position is a property or a literal value, respectively.
If an operator is polymorphic (allows more than one operand syntax) then
each permitted syntax MUST be listed separately.
</t>


<figure><artwork>&lt;operators xmlns='DAV:'&gt;
  &lt;opdesc&gt;
    &lt;like/&gt;&lt;operand-property/&gt;&lt;operand-literal/&gt;
  &lt;/opdesc&gt;
&lt;/operators&gt;
</artwork></figure>

</section>

<section title="Example of Query Schema for DAV:basicsearch">





<figure><artwork>&lt;D:basicsearchschema xmlns:D="DAV:"
  xmlns:xs="http://www.w3.org/2001/XMLSchema""&gt;
  &lt;D:properties&gt;
    &lt;D:propdesc&gt;
      &lt;D:prop&gt;&lt;D:getcontentlength/&gt;&lt;/D:prop&gt;
      &lt;D:datatype&gt;&lt;xs:nonNegativeInteger/&gt;&lt;/D:datatype&gt;
      &lt;D:searchable/&gt;&lt;D:selectable/&gt;&lt;D:sortable/&gt;
    &lt;/D:propdesc&gt;
    &lt;D:propdesc&gt;
      &lt;D:prop&gt;&lt;D:getcontenttype/&gt;&lt;D:displayname/&gt;&lt;/D:prop&gt;
      &lt;D:searchable/&gt;&lt;D:selectable/&gt;&lt;D:sortable/&gt;
    &lt;/D:propdesc&gt;
    &lt;D:propdesc&gt;
      &lt;D:prop&gt;&lt;fstop xmlns="http://jennicam.org"/&gt;&lt;/D:prop&gt;
      &lt;D:selectable/&gt;
    &lt;/D:propdesc&gt;
    &lt;D:propdesc&gt;
      &lt;D:any-other-property/&gt;
      &lt;D:searchable/&gt;&lt;D:selectable/&gt;
    &lt;/D:propdesc&gt;
  &lt;/D:properties&gt;
  &lt;D:operators&gt;
    &lt;D:opdesc&gt;
      &lt;D:like/&gt;&lt;D:operand-property/&gt;&lt;D:operand-literal/&gt;
    &lt;/D:opdesc&gt;
  &lt;/D:operators&gt;
&lt;/D:basicsearchschema&gt;</artwork></figure>



<t>
This response lists four properties. The datatype of the last three properties
is not given, so it defaults to xs:string. All are selectable, and the first
three may be searched. All but the last may be used in a sort. Of the optional
DAV operators, DAV:isdefined and DAV:like are supported.
</t><t>Note: The schema discovery defined here does not provide for
discovery of supported values of the 
<ed:replace datetime="2003-01-28" ed:entered-by="julian.reschke@greenbytes.de" ed:resolves="case-insensitivity-name"><ed:del>"casesensitive"</ed:del><ed:ins>"caseless"</ed:ins></ed:replace>
 attribute.
This may require that the reply also list the mandatory operators.
</t>
</section>
</section>
</section>

<section title="Internationalization Considerations">
<t>
Clients have the opportunity to tag properties when they are stored in
a language. The server SHOULD read this language-tagging by examining the
xml:lang attribute on any properties stored on a resource.
</t><t>The xml:lang attribute specifies a nationalized collation sequence when
properties are compared.
</t><t>Comparisons when this attribute differs have undefined order.
</t>
</section>

<section title="Security Considerations">
<ed:issue xmlns='http://www.w3.org/1999/xhtml' name="JW25/JW26" status="closed" type="edit" href="http://lists.w3.org/Archives/Public/www-webdav-dasl/1999AprJun/0002.html">
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">In Security Considerations, copy XML considerations from webDAV spec.</ed:item>
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">Wouldn't it be better to just cite the XML document, so that if that document is updated, we won't have stale information?</ed:item>
<ed:item entered-by="ejw@ics.uci.edu" date="2000-04-20">In Security Considerations, mention privacy risks of queries.</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2002-01-28">Is this resolved?</ed:item>
<ed:item entered-by="julian.reschke@greenbytes.de" date="2003-01-09">Closed. Havn't heard of missing considerations.</ed:item>
</ed:issue>
<t>
This section is provided to detail issues concerning security implications
of which DASL applications need to be aware. All of the security considerations
of HTTP/1.1 also apply to DASL. In addition, this section will include
security risks inherent in searching and retrieval of resource properties
and content.
</t><t>A query must not allow one to retrieve information about values or existence
of properties that one could not obtain via PROPFIND. (e.g. by use in DAV:orderby,
or in expressions on properties.)
</t><t>A server should prepare for denial of service attacks. For example a
client may issue a query for which the result set is expensive to calculate
or transmit because many resources match or must be evaluated. 7.1 Implications
of XML External Entities
</t><t>XML supports a facility known as "external entities", defined in section
4.2.2 of <xref target="XML"/>, which instruct an XML processor to retrieve and perform
an inline include of XML located at a particular URI. An external XML entity
can be used to append or modify the document type declaration (DTD) associated
with an XML document. An external XML entity can also be used to include
XML within the content of an XML document. For non-validating XML, such
as the XML used in this specification, including an external XML entity
is not required by <xref target="XML"/>. However, <xref target="XML"/> does state that an XML
processor may, at its discretion, include the external XML entity.
</t><t>External XML entities have no inherent trustworthiness and are subject
to all the attacks that are endemic to any HTTP GET request. Furthermore,
it is possible for an external XML entity to modify the DTD, and hence
affect the final form of an XML document, in the worst case significantly
modifying its semantics, or exposing the XML processor to the security
risks discussed in <xref target="RFC3023"/>. Therefore, implementers must be aware that
external XML entities should be treated as untrustworthy.
</t><t>There is also the scalability risk that would accompany a widely deployed
application which made use of external XML entities. In this situation,
it is possible that there would be significant numbers of requests for
one external XML entity, potentially overloading any server which fields
requests for the resource containing the external XML entity.
</t>
</section>

<section title="Scalability">
<t>
Query grammars are identified by URIs. Applications SHOULD not attempt
to retrieve these URIs even if they appear to be retrievable (for example,
those that begin with "http://")
</t>
</section>

<section title="Authentication">
<t>
Authentication mechanisms defined in WebDAV will also apply to DASL.
</t>
</section>

<section title="IANA Considerations">
<t>
  This document uses the namespace defined by <xref target="RFC2518"/> for XML
  elements. All other IANA considerations mentioned in <xref target="RFC2518"/>
  are also applicable to DASL.
</t>
</section>

<section title="Copyright">
<t>
  To be supplied.
</t>
</section>

<section title="Intellectual Property">
<t>
  To be supplied.
</t>
</section>

<ed:ins datetime="2003-02-07" title="2003-02-07, julian.reschke@greenbytes.de">
<section title="Acknowledgements">
<t>
  This draft has benefited from thoughtful discussion by Lisa Dusseault,
  Sung Kim, Elias Sinderson, Martin Wallmer and Jim Whitehead.
</t>
</section>
</ed:ins>

  </middle><back>
<references title="Normative References">
    

<reference anchor="RFC2616">

<front>
<title abbrev="HTTP/1.1">Hypertext Transfer Protocol -- HTTP/1.1</title>
<author initials="R.T." surname="Fielding" fullname="Roy T. Fielding">
<organization>University of California, Irvine, Information and Computer Science</organization>
<address>
<postal>
<street/>
<city>Irvine</city>
<region>CA</region>
<code>92697-3425</code>
<country>US</country></postal>
<phone>+1 949 824 1715</phone>
<email>fielding@ics.uci.edu</email></address></author>
<author initials="J." surname="Gettys" fullname="James Gettys">
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<phone/>
<facsimile>+1 617 258 8682</facsimile>
<email>jg@w3.org</email></address></author>
<author initials="J.C." surname="Mogul" fullname="Jeffrey C. Mogul">
<organization>Compaq Computer Corporation, Western Research Laboratory</organization>
<address>
<postal>
<street>250 University Avenue</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94301</code>
<country>US</country></postal>
<phone/>
<email>mogul@wrl.dec.com</email></address></author>
<author initials="H.F." surname="Nielsen" fullname="Henrik Frystyk Nielsen">
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<phone/>
<facsimile>+1 617 258 8682</facsimile>
<email>frystyk@w3.org</email></address></author>
<author initials="L." surname="Masinter" fullname="Larry Masinter">
<organization>Xerox Corporation</organization>
<address>
<postal>
<street>3333 Coyote Hill Road</street>
<city>Palo Alto</city>
<region>CA</region>
<code>94034</code>
<country>US</country></postal>
<phone/>
<email>masinter@parc.xerox.com</email></address></author>
<author initials="P.J." surname="Leach" fullname="Paul J. Leach">
<organization>Microsoft Corporation</organization>
<address>
<postal>
<street>1 Microsoft Way</street>
<city>Redmond</city>
<region>WA</region>
<code>98052</code>
<country>US</country></postal>
<phone/>
<email>paulle@microsoft.com</email></address></author>
<author initials="T." surname="Berners-Lee" fullname="Tim Berners-Lee">
<organization>World Wide Web Consortium, MIT Laboratory for Computer Science</organization>
<address>
<postal>
<street>545 Technology Square</street>
<city>Cambridge</city>
<region>MA</region>
<code>02139</code>
<country>US</country></postal>
<phone>+1 617 258 8682</phone>
<facsimile/>
<email>timbl@w3.org</email></address></author>
<date month="June" year="1999"/>
</front>
<seriesInfo name="RFC" value="2616"/>
</reference>

<reference anchor="RFC2119">
<front>
<title abbrev="RFC Key Words">Key words for use in RFCs to Indicate Requirement Levels</title>
<author initials="S." surname="Bradner" fullname="Scott Bradner">
<organization>Harvard University</organization>
<address>
<postal>
<street>1350 Mass. Ave.</street>
<street>Cambridge</street>
<street>MA 02138</street></postal>
<phone>- +1 617 495 3864</phone>
<email>-</email></address></author>
<date month="March" year="1997"/>
<area>General</area>
<keyword>keyword</keyword>
</front>
<seriesInfo name="BCP" value="14"/>
<seriesInfo name="RFC" value="2119"/>
</reference>

<reference anchor="XML" target="http://www.w3.org/TR/2000/REC-xml-20001006">
  <front>
    <title>Extensible Markup Language (XML) 1.0 (2nd ed)</title>
    <author initials="T." surname="Bray" fullname="Tim Bray">
      <organization>Textuality and Netscape</organization>
      <address>
        <email>tbray@textuality.com</email>
      </address>
    </author>
    <author initials="J." surname="Paoli" fullname="Jean Paoli">
      <organization>Microsoft</organization>
      <address>
        <email>jeanpa@microsoft.com</email>
      </address>
    </author>
    <author initials="C.M." surname="Sperberg-McQueen" fullname="C. M. Sperberg-McQueen">
      <organization>University of Illinois at Chicago and Text Encoding Initiative</organization>
      <address>
        <email>cmsmcq@uic.edu</email>
      </address>
    </author>
    <author initials="E." surname="Maler" fullname="Eve Maler">
      <organization>Sun Microsystems</organization>
      <address>
        <email>eve.maler@east.sun.com</email>
      </address>
    </author>
    <date day="6" month="October" year="2000"/>
  </front>
  <seriesInfo name="W3C" value="REC-xml"/>
</reference>

<reference anchor="XMLNS" target="http://www.w3.org/TR/REC-xml-names">
  <front>
    <title>Namespaces in XML</title>
    <author initials="T." surname="Bray" fullname="Tim Bray">
      <organization>Textuality</organization>
      <address>
        <email>tbray@textuality.com</email>
      </address>
    </author>
    <author initials="D." surname="Hollander" fullname="Dave Hollander">
      <organization>Hewlett-Packard Company</organization>
      <address>
        <email>dmh@corp.hp.com</email>
      </address>
    </author>
    <author initials="A." surname="Layman" fullname="Andrew Layman">
      <organization>Microsoft</organization>
      <address>
        <email>andrewl@microsoft.com</email>
      </address>
    </author>
    <date day="14" month="January" year="1999"/>
  </front>
  <seriesInfo name="W3C" value="REC-xml-names"/>
</reference>

<reference anchor="XS1" target="http://www.w3.org/TR/xmlschema-1/">
<front>
<title>XML Schema Part 1: Structures</title>
<author initials='H. S.' surname='Thompson' fullname='Henry S. Thompson'>
<organization>University of Edinburgh</organization>
<address><email>ht@cogsci.ed.ac.uk</email></address></author>
<author initials='D.' surname='Beech' fullname='David Beech'>
<organization>Oracle</organization>
<address><email>David.Beech@oracle.com</email></address></author>
<author initials='M.' surname='Maloney' fullname='Murray Maloney'>
<organization>(for) Commerce One</organization>
<address><email>murray@muzmo.com</email></address></author>
<author initials='N.' surname='Mendelsohn' fullname='Noah Mendelsohn'>
<organization>Lotus Development Corporation</organization>
<address><email>Noah_Mendelsohn@lotus.com</email></address></author>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="May" year="2001" />
</front>
<seriesInfo name="W3C" value="XS1" />
</reference>

<reference anchor="XS2" target="http://www.w3.org/TR/xmlschema-2/">
<front>
<title>XML Schema Part 2: Datatypes</title>
<author initials="P. V." surname="Biron" fullname="Paul V. Biron">
<organization>Kaiser Permanente, for Health Level Seven</organization>
<address><email>Paul.V.Biron@kp.org</email></address></author>
<author initials="A." surname="Malhotra" fullname="Ashok Malhotra">
<organization>Microsoft, formerly of IBM</organization>
<address><email>ashokma@microsoft.com</email></address></author>
<author>
<organization abbrev="W3C">World Wide Web Consortium</organization>
<address>
<postal>
<street>MIT Laboratory for Computer Science</street>
<street>545 Technology Square</street>
<city>Cambridge</city> <region>MA</region> <code>02139</code>
<country>US</country>
</postal>
<phone>+ 1 617 253 2613</phone>
<facsimile>+ 1 617 258 5999</facsimile>
<email>timbl@w3.org</email>
<uri>http://www.w3c.org</uri>
</address>
</author>
<date month="May" year="2001"/>
</front>
<seriesInfo name="W3C" value="XS2"/>
</reference>

<reference anchor="RFC2518">
<front>
<title>HTTP Extensions for Distributed Authoring -- WEBDAV</title>
<author initials="Y." surname="Goland" fullname="Y. Goland">
  <organization>Microsoft Corporation</organization>
  <address><email>yarong@microsoft.com</email></address>
</author>
<author initials="E." surname="Whitehead" fullname="E. J. Whitehead, Jr.">
  <organization abbrev="UC Irvine">Dept. Of Information and Computer Science, University of California, Irvine</organization>
	<address><email>ejw@ics.uci.edu</email></address>
</author>
<author initials="A." surname="Faizi" fullname="A. Faizi">
  <organization abbrev="Netscape">Netscape</organization>
  <address><email>asad@netscape.com</email></address>
</author>
<author initials="S.R." surname="Carter" fullname="S. R. Carter">
  <organization abbrev="Novell">Novell</organization>
  <address><email>srcarter@novell.com</email></address>
</author>
<author initials="D." surname="Jensen" fullname="D. Jensen">
  <organization abbrev="Novell">Novell</organization>
  <address><email>dcjensen@novell.com</email></address>
</author>
<date month="February" year="1999"/></front>
<seriesInfo name="RFC" value="2518"/>
</reference>

<reference anchor="RFC3253">
<front>
<title>Versioning Extensions to WebDAV</title>
<author initials="G." surname="Clemm" fullname="G. Clemm">
  <organization>Rational Software</organization>
  <address><email>geoffrey.clemm@rational.com</email></address>
</author>
<author initials="J." surname="Amsden" fullname="J. Amsden">
  <organization>IBM</organization>
  <address><email>jamsden@us.ibm.com</email></address>
</author>
<author initials="T." surname="Ellison" fullname="T. Ellison">
  <organization>IBM</organization>
  <address><email>tim_ellison@uk.ibm.com</email></address>
</author>
<author initials="C." surname="Kaler" fullname="C. Kaler">
  <organization>Microsoft</organization>
  <address><email>ckaler@microsoft.com</email></address>
</author>
<author initials="J." surname="Whitehead" fullname="J. Whitehead">
  <organization>UC Santa Cruz, Dept. of Computer Science</organization>
  <address><email>ejw@cse.ucsc.edu</email></address>
</author>
<date month="March" year="2002"/></front>
<seriesInfo name="RFC" value="3253"/>
</reference>

<reference anchor="ACL" target="http://www.webdav.org/acl/protocol/draft-ietf-webdav-acl-09.htm">
<front>
<title>WebDAV Access Control Protocol</title>
<author initials="G." surname="Clemm" fullname="G. Clemm">
  <organization>Rational Software</organization>
  <address><email>geoffrey.clemm@rational.com</email></address>
</author>
<author initials="A." surname="Hopkins" fullname="A. Hopkins">
  <organization>Microsoft Corporation</organization>
  <address><email>annehop@microsoft.com</email></address>
</author>
<author initials="E." surname="Sedlar" fullname="E. Sedlar">
  <organization>Oracle Corporation</organization>
  <address><email>esedlar@us.oracle.com</email></address>
</author>
<author initials="J." surname="Whitehead" fullname="J. Whitehead">
  <organization>UC Santa Cruz, Dept. of Computer Science</organization>
  <address><email>ejw@cse.ucsc.edu</email></address>
</author>
<date month="July" year="2002"/></front>
<seriesInfo name="ID" value="draft-ietf-webdav-acl-09"/>
</reference>

<reference anchor="RFC3023">
<front>
<title>XML Media Types</title>
<author initials="M." surname="Makoto" fullname="Murata Makoto">
<organization>IBM Tokyo Research Laboratory</organization>
<address><email>mmurata@trl.ibm.co.jp</email></address>
</author>
<author initials="S." surname="St.Laurent" fullname="Simon St.Laurent">
<organization>simonstl.com</organization>
<address><email>simonstl@simonstl.com</email></address>
</author>
<author initials="D." surname="Kohn" fullname="Dan Kohn">
<organization>Skymoon Ventures</organization>
<address><email>dan@dankohn.com</email></address>
</author>
<date month="January" year="2001"/>
</front>
<seriesInfo name="RFC" value="3023"/>
</reference>

</references>

<references title="Informative References">

<reference anchor="SQL99">
<front>
<title>Database Language SQL Part 2: Foundation (SQL/Foundation)</title>
<author initials="J." surname="Milton" fullname="J. Milton">
<organization>International Organization for Standardization</organization>
</author>
<date month="July" year="1999"/>
</front>
<seriesInfo name="ISO" value="ISO/IEC 9075-2:1999 (E)"/>
</reference>

<reference anchor="CaseMap" target="http://www.unicode.org/unicode/reports/tr21">
<front>
<title>Case Mappings</title>
<author initials="M." surname="Davis" fullname="M. Davis">
<organization>IBM</organization>
<address><email>mark.davis@us.ibm.com</email></address></author>
<date month="February" year="2001"/>
</front>
<seriesInfo name="Unicode Techical Reports" value="21"/>
</reference>

<reference anchor="DASLREQ" target="http://www.webdav.org/dasl/requirements/draft-dasl-requirements-01.html">
  <front>
    <title>Requirements for DAV Searching and Locating</title>    
    <author initials="J." surname="Davis" fullname="J. Davis">
			<organization abbrev="CourseNet">CourseNet Systems</organization>
			<address>
        <postal>
          <street>170 Capp Street</street>
          <city>San Francisco</city><region>CA</region><code>94110</code>
        </postal>
        <email>jrd3@alum.mit.edu</email>
      </address>
		</author>

    <author initials="S." surname="Reddy" fullname="S. Reddy">
			<organization abbrev="Microsoft">Microsoft</organization>
			<address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city><region>WA</region><code>9085-6933</code>
          </postal>
				<email>saveenr@microsoft.com</email>	
			</address>
		</author>

    <author initials="J." surname="Slein" fullname="Judith Slein">
      <organization>Xerox Corporation</organization>
      <address>
        <postal>
          <street>800 Phillips Road 128-29E</street>
        </postal>
        <email>slein@wrc.xerox.com</email>
      </address>
    </author>

    <date month="February" year="1999"/>        
  </front>
  <seriesInfo name="ID" value="draft-dasl-requirements-01"/>
</reference>

<reference anchor="BIND" target="http://www.webdav.org/bind/draft-ietf-webdav-bind-00.htm">
  <front>
    <title>Binding Extensions to WebDAV</title>
    
    <author initials="G." surname="Clemm" fullname="Geoffrey Clemm">
      <organization>Rational Software</organization>
      <address>
        <postal>
          <street>20 Maguire Road</street>
          <city>Lexington</city>
          <region>MA</region>
          <code>02421</code>
          <country>US</country>
        </postal>
        <email>geoffrey.clemm@rational.com</email>
      </address>
    </author>

		<author initials="J." surname="Crawford" fullname="J. Crawford">
			<organization abbrev="IBM">IBM Research</organization>
      <address>
				<postal>
          <street>P.O. Box 704</street>
          <city>Yorktown Heights</city><region>NY</region><code>10598</code>
        </postal>
	      <email>ccjason@us.ibm.com</email>
      </address>
		</author>

    <author initials="J. F." surname="Reschke" fullname="Julian F. Reschke">
    	<organization abbrev="greenbytes">greenbytes GmbH</organization>
  		<address>
        <postal>
          <street>Salzmannstrasse 152</street>
          <city>Muenster</city><region>NW</region><code>48159</code>
          <country>Germany</country>
        </postal>
  		  <phone>+49 251 2807760</phone>	
  			<facsimile>+49 251 2807761</facsimile>	
  			<email>julian.reschke@greenbytes.de</email>	
  			<uri>http://greenbytes.de/tech/webdav/</uri>	
  		</address>
  	</author>

		<author initials="J." surname="Slein" fullname="Judith Slein">
			<organization abbrev="Xerox">Xerox Corporation</organization>
			<address>
        <postal>
          <street>800 Phillips Road, 105-50C</street>
          <city>Webster</city><region>NY</region><code>14580</code>
        </postal>
				<email>jslein@crt.xerox.com</email>	
			</address>
		</author>

    <author initials="J." surname="Whitehead" fullname="Jim Whitehead">
      <organization abbrev="U.C. Santa Cruz">UC Santa Cruz, Dept. of Computer Science</organization>
      <address>
        <postal>
          <street>1156 High Street</street>
          <city>Santa Cruz</city>
          <region>CA</region>
          <code>95064</code>
          <country>US</country>
        </postal>
        <email>ejw@cse.ucsc.edu</email>
      </address>
    </author>

    <date month="October" year="2002"/>        
  </front>
  <seriesInfo name="ID" value="draft-ietf-webdav-bind-00"/>
</reference>

<reference anchor="DASL" target="http://www.webdav.org/dasl/protocol/draft-dasl-protocol-00.html">
<front>
  <title>DAV Searching &amp; Locating</title>
    <author initials="S." surname="Reddy" fullname="S. Reddy">
			<organization abbrev="Microsoft">Microsoft</organization>
			<address>
        <postal>
          <street>One Microsoft Way</street>
          <city>Redmond</city><region>WA</region><code>9085-6933</code>
        </postal>
				<email>saveenr@microsoft.com</email>	
			</address>
		</author>
		<author initials="D." surname="Lowry" fullname="D. Lowry">
			<organization abbrev="Novell">Novell</organization>
			<address>
        <postal>
          <street>1555 N. Technology Way, M/S ORM-M-314</street>
          <city>Orem</city><region>UT</region><code>84097</code>
        </postal>
        <email>dlowry@novell.com</email>
      </address>
		</author>
		<author initials="S." surname="Reddy" fullname="S. Reddy">
			<organization abbrev="Oracle">Oracle Corporation</organization>
			<address>
	      <postal>
    	    <street>600 Oracle Parkway, M/S 6op3</street>
        	<city>Redwoodshores</city><region>CA</region><code>94065</code>
        </postal>
        <phone>+1 650 506 5441</phone>
        <email>skreddy@us.oracle.com</email>
			</address>
		</author>
		<author initials="R." surname="Henderson" fullname="R. Henderson">
			<organization abbrev="Netscape">Netscape</organization>
			<address>
        <email>rickh@netscape.com</email>
			</address>
    </author>
    <author initials="J." surname="Davis" fullname="J. Davis">
			<organization abbrev="Intelligent Markets">Intelligent Markets</organization>
			<address>
        <postal>
          <street>410 Jessie Street 6th floor</street>
          <city>San Francisco</city><region>CA</region><code>94103</code>
        </postal>
        <email>jrd3@alum.mit.edu</email>
      </address>
		</author>
		<author initials="A." surname="Babich" fullname="A. Babich">
			<organization abbrev="Filenet">Filenet</organization>
      <address>
				<postal>
          <street>3565 Harbor Blvd.</street>
          <city>Costa Mesa</city><region>CA</region><code>92626</code>
        </postal>
	      <phone>+1 714 966 3403</phone>
        <email>ababich@filenet.com</email>
      </address>
		</author>
<date month="July" year="1999"/></front>
<seriesInfo name="ID" value="draft-dasl-protocol-00"/>
</reference>

</references>

<section title="Three-Valued Logic in DAV:basicsearch" anchor="three-valued-logic">
<t>
ANSI standard three valued logic is used when evaluating the search condition
(as defined in the ANSI standard SQL specifications, for example in ANSI
X3.135-1992, section 8.12, pp. 188-189, section 8.2, p. 169, General Rule
1)a), etc.).
</t>
<t>
ANSI standard three valued logic is undoubtedly the most widely practiced
method of dealing with the issues of properties in the search condition
not having a value (e.g., being null or not defined) for the resource under
scan, and with undefined expressions in the search condition (e.g., division
by zero, etc.). Three valued logic works as follows.
</t>
<t>
Undefined expressions are expressions for which the value of the expression
is not defined. Undefined expressions are a completely separate concept
from the truth value UNKNOWN, which is, in fact, well defined. Property
names and literal constants are considered expressions for purposes of
this section. If a property in the current resource under scan has not
been set to a value, then
the value of that property is undefined for the resource under scan. DASL
1.0 has no arithmetic division operator, but if it did, division by zero
would be an undefined arithmetic expression.
</t>
<t>
If any subpart of an arithmetic, string, or datetime subexpression is
undefined, the whole arithmetic, string, or datetime subexpression is undefined.
</t>
<t>
There are no manifest constants to explicitly represent undefined number,
string, or datetime values.
</t>
<t>
Since a Boolean value is ultimately returned by the search condition,
arithmetic, string, and datetime expressions are always arguments to other
operators. Examples of operators that convert arithmetic, string, and datetime
expressions to Boolean values are the six relational operators ("greater
than", "less than", "equals", etc.). If either or both operands of a relational
operator have undefined values, then the relational operator evaluates
to UNKNOWN. Otherwise, the relational operator evaluates to TRUE or FALSE,
depending upon the outcome of the comparison.
</t><t>The Boolean operators DAV:and, DAV:or and DAV:not
are evaluated according to the following rules:
</t><t>UNKNOWN and UNKNOWN = UNKNOWN
</t><t>UNKNOWN or UN<ed:del datetime="2003-01-14" title="2003-01-14, julian.reschke@greenbytes.de">K</ed:del>KNOWN = UNKNOWN
</t><t>not UNKNOWN = UNKNOWN
</t><t>UNKNOWN and TRUE = UNKNOWN
</t><t>UNKNOWN and FALSE = FALSE
</t><t>UNKNOWN and UNKNOWN = UNKNOWN
</t><t>UNKNOWN or TRUE = TRUE
</t><t>UNKNOWN or FALSE = UNKNOWN
</t><t>UNKNOWN or UNKNOWN = UNKNOWN
</t>
</section>

<section title="Change Log">

<section title="From draft-davis-dasl-protocol-xxx">
<t>
<list style="hanging">
  <t hangText="Feb 14, 1998">Initial Draft</t>
  <t hangText="Feb 28, 1998">
    Referring to DASL as an extension to HTTP/1.1 rather than DAV.<vspace blankLines="0"/>
    Added new sections "Notational Conventions", "Protocol Model", "Security
    Considerations".<vspace blankLines="0"/>
    Changed section 3 to "Elements of Protocol".<vspace blankLines="0"/>
    Added some stuff to introduction.<vspace blankLines="0"/>
    Added "result set" terminology.<vspace blankLines="0"/>
    Added "IANA Considerations".
  </t>

  <t hangText="Mar 9, 1998">
    Moved sub-headings of "Elements of Protocol" to first level and removed
    "Elements of Protocol" Heading.<vspace blankLines="0"/>
    Added an sentence in introduction explaining that this is a "sketch"
    of a protocol.
  </t>

  <t hangText="Mar 11, 1998">
    Added orderby, data typing, three valued logic, query schema property,
    and element definitions for schema for basicsearch.</t>

  <t hangText="April 8, 1998">
    - made changes based on last week's DASL BOF.</t>
    
  <t hangText="May 8, 1998">
    Removed most of DAV:searcherror; converted to DAV:searchredirect<vspace blankLines="0"/>
    Altered DAV:basicsearch grammar to use avoid use of ANY in DTD</t>

  <t hangText="June 17, 1998">
    -Added details on Query Schema Discovery<vspace blankLines="0"/>
    -Shortened list of data types</t>

  <t hangText="June 23, 1998">
    moved data types before change history
    <vspace blankLines="0"/>rewrote the data types section
    <vspace blankLines="0"/>removed the casesensitive element and replace with the casesensitive
    attribute
    <vspace blankLines="0"/>added the casesensitive attribute to the DTD for all operations that
    might work on a string
  </t>
  
  <t hangText="Jul 20, 1998">
    A series of changes. See Author's meeting minutes for details.</t>

  <t hangText="July 28, 1998">
    Changes as per author's meeting. QSD uses SEARCH, not PROPFIND.
    <vspace blankLines="0"/>Moved text around to keep concepts nearby.
    <vspace blankLines="0"/>Boolean literals are 1 and 0, not T and F.
    <vspace blankLines="0"/>contains changed to contentspassthrough.
    <vspace blankLines="0"/>Renamed rank to score.</t>

  <t hangText="July 28, 1998">
    Added Dale Lowry as Author</t>

  <t hangText="September 4, 1998">
    Added 422 as response when query lists unimplemented operators.
    <vspace blankLines="0"/>DAV:literal declares a default value for xml:space, 'preserve'
    (see XML spec, section 2.10)
    <vspace blankLines="0"/>moved to new XML namespace syntax
  </t>
  
  <t hangText="September 22, 1998">
    Changed "simplesearch" to "basicsearch"
    <vspace blankLines="0"/>Changed isnull to isdefined
    <vspace blankLines="0"/>Defined NULLness as having a 404 or 403 response
    <vspace blankLines="0"/>used ENTITY syntax in DTD
    <vspace blankLines="0"/>Added redirect
  </t>
  
  <t hangText="October 9, 1998">
    Fixed a series of typographical and formatting errors.
    <vspace blankLines="0"/>Modified the section of three-valued logic to use a table rather than
    a text description of the role of UNKNOWN in expressions.
  </t>
  
  <t hangText="November 2, 1998">
    Added the DAV:contains operator.
    <vspace blankLines="0"/>Removed the DAV:contentpassthrough operator.
  </t>
  
  <t hangText="November 18, 1998">
    Various author comments for submission</t>

  <t hangText="June 3, 1999">
    Cosmetic and minor editorial changes only. Fix nits reported by Jim Whitehead
    in email of April 26, 1999. Converted to HTML from Word 97, manually.</t>

  <t hangText="April 20, 2000">
    Removed redirection feature, since 301/302 suffices. Removed Query Schema Discovery (former chapter 4). Everyone agrees this is a useful feature, but it is apparently too difficult to define at this time, and it is not essential for DASL. 
  </t>
</list>
</t>
</section>

<section title="since start of draft-reschke-webdav-search">
<t>
<list style="hanging">
  <t hangText="October 09, 2001">
    Added Julian Reschke as author.<vspace blankLines="0"/>
    Chapter about QSD re-added.<vspace blankLines="0"/>
    Formatted into RFC2629-compliant XML document.<vspace blankLines="0"/>
    Added first comments.<vspace blankLines="0"/>
    ID version number kicked up to draft-dasl-protocol-03.
  </t>

  <t hangText="October 17, 2001">
    Updated address information for Jim Davis.<vspace blankLines="0"/>
    Added issue of datatype vocabularies.<vspace blankLines="0"/>
    Updated issue descriptions for grammar discovery,
    added issues on query schema DTD.<vspace blankLines="0"/>
    Fixed typos in XML examples.
  </t>

  <t hangText="December 17, 2001">
    Re-introduced split between normative and non-normative references.
  </t>

  <t hangText="January 05, 2002">
    Version bumbed up to 04. Started work on resolving the issues identified
    in the previous version.
  </t>

  <t hangText="January 14, 2002">
    Fixed some XML typos.
  </t>
  
  <t hangText="January 22, 2002">
    Closed issues naming-of-elements. Fixed query search DTD and added option
    to discover properties of "other" (non-listed) properties.
  </t>

  <t hangText="January 25, 2002">
    Changed into private submission and added reference to historic DASL draft.
    Marked reference to DASL requirements non-normative.<vspace blankLines="0"/>
    Updated reference to latest deltav spec. 
  </t>

  <t hangText="January 29, 2002">
    Added feedback from and updated contact info for Alan Babich.<vspace/>
    Included open issues collected in <eref target="http://www.webdav.org/dasl/protocol/issues.html">http://www.webdav.org/dasl/protocol/issues.html</eref>.
  </t>

  <t hangText="February 8, 2002">
    Made sure that all artwork fits into 72 characters wide text.
  </t>

  <t hangText="February 18, 2002">
    Changed Insufficient storage handling (multistatus). Moved is-collection to
    operators and added to DTD. Made scope/depth mandatory.
  </t>

  <t hangText="February 20, 2002">
    Updated reference to SQL99.
  </t>

  <t hangText="February 28, 2002">
    "Non-normative References" -&gt; "Informative References". Abstract updated.
    Consistently specify a charset when using text/xml (no change bars). Do
    not attempt to define PROPFIND's entity encoding (take out specific references
    to text/xml). Remove irrelevant headers (Connection:) from examples (no
    change bars). Added issue on querying based on DAV:href. Updated introduction
    to indicate relationship to DASL draft. Updated HTTP reference from
    RFC2068 to RFC2616. Updated XML reference to XML 1.0 2nd edition.
  </t>

  <t hangText="March 1, 2002">
    Removed superfluous namespace decl in 2.4.2. Reopened JW14 and suggest
    to drop xml:space support.
  </t>

  <t hangText="March 3, 2002">
    Removed "xml:space" feature on DAV:literal. Added issue about string
    comparison vs. collations vs. xml:lang. Updated some of the open issues
    with details from JimW's original mail in April 1999. Resolved scope vs
    relative URI references. Resolved issues about DAV:ascending (added to
    index) and the BNF for DAV:like (changed "octets" to "characters").
  </t>

  <t hangText="March 8, 2002">
    Updated reference to DeltaV (now RFC3253). Added Martin Wallmer's comments,
    moved JW5 into DAV:basicsearch section.
  </t>

  <t hangText="March 11, 2002">
    Closed open issues regaring the type of search arbiters (JW3) and their
    discovery (JW9). Rephrased requirements on multistatus response bodies
    (propstat only if properties were selected, removed requirement for
    responsedescription).
  </t>

  <t hangText="March 23, 2002">
    RFC2376 -&gt; RFC3023. Added missing first names of authors. OPTIONS added
    to example for DAV:supported-method-set.
  </t>

</list></t>
</section>

<section title="since draft-reschke-webdav-search-00">
<t>
<list style="hanging">
  <t hangText="March 29, 2002">
    Abstract doesn't refer to DASL WG anymore.
  </t>

  <t hangText="April 7, 2002">
    Fixed section title (wrong property name supported-search-grammar-set.
    Changed DAV:casesensitve to "casesensitive" (it wasn't in the DAV:
    namespace after all).
  </t>

  <t hangText="May 28, 2002">
    Updated some issues with Jim Davis's comments.
  </t>

  <t hangText="June 10, 2002">
    Added proposal for different method for query schema discovery, not
    using pseudo-properties.
  </t>

  <t hangText="June 25, 2002">
    QSD marshalling rewritten. Added issue "isdefined-optional".
  </t>
</list>
</t>
</section>

<section title="since draft-reschke-webdav-search-01">
<t>
<list style="hanging">
  <t hangText="July 04, 2002">
    Added issue "scope-collection".
  </t>

  <t hangText="July 08, 2002">
    Closed issue "scope-collection".
  </t>

  <t hangText="August 12, 2002">
    Added issues "results-vs-binds" and "select-allprop".
  </t>

  <t hangText="October 22, 2002">
    Added issue "undefined-expressions".
  </t>

  <t hangText="November 18, 2002">
    Changed example host names (no change tracking).
  </t>

  <t hangText="November 25, 2002">
    Updated issue "DB2/DB7". Closed issues "undefined expressions",
    "isdefined-optional" and "select-allprop".
  </t>
</list>
</t>
</section>

<ed:ins>
<section title="since draft-reschke-webdav-search-02">
<t>
<list style="hanging">
  <t hangText="November 27, 2002">
    Added issues "undefined-properties", "like-exactlyone" and "like-wildcard-adjacent".
    Closed issue "query-on-href". Added acknowledgments section.
  </t>

  <t hangText="November 28, 2002">
    Closed issue "like-exactlyone". Added issue "mixed-content-properties".
  </t>

  <t hangText="December 14, 2002">
    Closed issues "undefined-properties", "results-vs-binds",
    "mixed-content-properties".
    Updated issue "like-wildcard-adjacent".
    Added informative reference to BIND draft. Updated reference to ACL
    draft.
  </t>

  <t hangText="January 9, 2003">
    Removed duplicate section on invalid scopes. Added comments to some 
    open issues. Closed issues JW25/26, score-pseudo-property and null-ordering. 
  </t>

  <t hangText="January 10, 2003">
    Issue limit-vs-ordering plus resolution. Closed issue JW17/JW24b.
  </t>

  <t hangText="January 14, 2003">
    New issue order-precedence. Started resolution of DB2/DB7.
  </t>

  <t hangText="January 15, 2003">
    Started spec of DAV:typed-literal.
  </t>

  <t hangText="January 17, 2003">
    Fix one DAV:like/DAV:getcontenttype example (add / to like expression,
    make case-insensitive).
  </t>

  <t hangText="January 28, 2003">
    Update issue(s) result-truncation, JW24d.
    Fixed response headers in OPTIONS example.
    Added issue qsd-optional.
    Closed issue(s) order-precedence, case-insensitivity-name.
  </t>

  <t hangText="February 07, 2003">
    Added issue scope-vs-versions. score-pseudo-property: allow DAV:orderby
    to explicitly specify DAV:score.
  </t>
</list>
</t>
</section>
</ed:ins>

</section>

  </back></rfc>