view Side-By-Side changes
Network Working Group J. Reschke, Ed.Internet-DraftRequest for Comments: 5323 greenbytesIntended status:Category: Standards Track S. ReddyExpires: March 3, 2009Mitrix J. Davis A. Babich IBMAugust 30,November 2008 Web Distributed Authoring and Versioning (WebDAV) SEARCHdraft-reschke-webdav-search-18Status ofthisThis MemoBy submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents ofThis document specifies an Internet standards track protocol for the InternetEngineering Task Force (IETF), its areas,community, andits working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents validrequests discussion and suggestions fora maximumimprovements. Please refer to the current edition ofsix monthsthe "Internet Official Protocol Standards" (STD 1) for the standardization state andmay be updated, replaced, or obsoleted by other documents at any time. Itstatus of this protocol. Distribution of this memo isinappropriate to use Internet-Draftsunlimited. Copyright Notice Copyright (c) 2008 IETF Trust and the persons identified asreference material orthe document authors. All rights reserved. This document is subject tocite them other than as "workBCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/ license-info) inprogress." The listeffect on the date ofcurrent Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The listpublication ofInternet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on March 3, 2009.this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Abstract This document specifies a set of methods,headersheaders, and properties composingWebDAVWeb Distributed Authoring and Versioning (WebDAV) SEARCH, an application of the HTTP/1.1 protocol to efficiently search for DAV resources based upon a set ofclient- suppliedclient-supplied criteria. Reschke, et al.Expires March 3, 2009Standards Track [Page 1]Internet-DraftRFC 5323 WebDAV SEARCHAugustNovember 2008Editorial Note (To be removed by RFC Editor before publication) Please send comments to the Distributed Authoring and Versioning (WebDAV) DASL mailing list at <mailto:www-webdav-dasl@w3.org>, which may be joined by sending a message with subject "subscribe" to <mailto:www-webdav-dasl-request@w3.org>. Discussions of the WebDAV DASL mailing list are archived at <http://lists.w3.org/Archives/Public/www-webdav-dasl/>. An issues list and XML and HTML versions of this draft are available from <http://greenbytes.de/tech/webdav/#draft-reschke-webdav-search>.Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . .64 1.1. DASL . . . . . . . . . . . . . . . . . . . . . . . . . . .64 1.2. Relationship to DAV . . . . . . . . . . . . . . . . . . .64 1.3. Terms . . . . . . . . . . . . . . . . . . . . . . . . . .65 1.4. Notational Conventions . . . . . . . . . . . . . . . . . .86 1.5. Note on Usage of 'DAV:' XML Namespace . . . . . . . . . .97 1.6. An Overview of DASL at Work . . . . . . . . . . . . . . .97 2. The SEARCH Method . . . . . . . . . . . . . . . . . . . . . .97 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . .97 2.2. The Request . . . . . . . . . . . . . . . . . . . . . . .98 2.2.1. The Request-URI . . . . . . . . . . . . . . . . . . .108 2.2.2. The Request Body . . . . . . . . . . . . . . . . . . .108 2.3. The Successful 207 (Multistatus) Response . . . . . . . .119 2.3.1. Result Set Truncation . . . . . . . . . . . . . . . .119 2.3.2. Extending the PROPFIND Response . . . . . . . . . . .1210 2.3.3. Example: A Simple Request and Response . . . . . . . .1210 2.3.4. Example: Result Set Truncation . . . . . . . . . . . .1311 2.4. Unsuccessful Responses . . . . . . . . . . . . . . . . . .1412 2.4.1. Example of an Invalid Scope . . . . . . . . . . . . .1412 3. Discovery of Supported Query Grammars . . . . . . . . . . . .1513 3.1. The OPTIONS Method . . . . . . . . . . . . . . . . . . . .1513 3.2. The DASL Response Header . . . . . . . . . . . . . . . . .1614 3.3. DAV:supported-query-grammar-set(protected)(Protected) . . . . . . .1614 3.4. Example: Grammar Discovery . . . . . . . . . . . . . . . .1615 4. Query Schema Discovery: QSD . . . . . . . . . . . . . . . . .1917 4.1. Additional SEARCH Semantics . . . . . . . . . . . . . . .1917 4.1.1. Example of Query Schema Discovery . . . . . . . . . .2018 5. The DAV:basicsearch Grammar . . . . . . . . . . . . . . . . .2119 5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . .2119 5.2. The DAV:basicsearch DTD . . . . . . . . . . . . . . . . .2220 5.2.1. Example Query . . . . . . . . . . . . . . . . . . . .2422 5.3. DAV:select . . . . . . . . . . . . . . . . . . . . . . . .2523 5.4. DAV:from . . . . . . . . . . . . . . . . . . . . . . . . .25 Reschke, et al. Expires March 3, 2009 [Page 2] Internet-Draft WebDAV SEARCH August 200823 5.4.1. Relationship to the Request-URI . . . . . . . . . . .2523 5.4.2. Scope . . . . . . . . . . . . . . . . . . . . . . . .2624 5.5. DAV:where . . . . . . . . . . . . . . . . . . . . . . . .2624 5.5.1. Use of Three-Valued Logic in Queries . . . . . . . . .2624 5.5.2. Handling Optional Operators . . . . . . . . . . . . .2624 5.5.3. Treatment of NULL Values . . . . . . . . . . . . . . .2624 5.5.4. Treatment of Properties withmixed/elementMixed/Element Content . .2725 5.5.5. Example: Testing for Equality . . . . . . . . . . . .2725 5.5.6. Example: Relative Comparisons . . . . . . . . . . . .2725 5.6. DAV:orderby . . . . . . . . . . . . . . . . . . . . . . .2826 5.6.1. Example of Sorting . . . . . . . . . . . . . . . . . .2826 5.7. Boolean Operators: DAV:and, DAV:or, and DAV:not . . . . .2826 5.8. DAV:eq . . . . . . . . . . . . . . . . . . . . . . . . . .2927 Reschke, et al. Standards Track [Page 2] RFC 5323 WebDAV SEARCH November 2008 5.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte . . . . . . . . . . . . .2927 5.10. DAV:literal . . . . . . . . . . . . . . . . . . . . . . .2927 5.11. DAV:typed-literal(optional)(Optional) . . . . . . . . . . . . . . .2928 5.11.1. Example for Typed Numerical Comparison . . . . . . . .3028 5.12. Support for Matching xml:lang Attributes on Properties . .3029 5.12.1. DAV:language-defined(optional)(Optional) . . . . . . . . . . .3129 5.12.2. DAV:language-matches(optional)(Optional) . . . . . . . . . . .3129 5.12.3. Example of Language-Aware Matching . . . . . . . . . .3129 5.13. DAV:is-collection . . . . . . . . . . . . . . . . . . . .3130 5.13.1. Example of DAV:is-collection . . . . . . . . . . . . .3230 5.14. DAV:is-defined . . . . . . . . . . . . . . . . . . . . . .3230 5.15. DAV:like . . . . . . . . . . . . . . . . . . . . . . . . .3230 5.15.1. Syntax for the Literal Pattern . . . . . . . . . . . .3331 5.15.2. Example of DAV:like . . . . . . . . . . . . . . . . .3331 5.16. DAV:contains . . . . . . . . . . . . . . . . . . . . . . .3331 5.16.1. Result Scoring (DAV:score Element) . . . . . . . . . .3432 5.16.2. Ordering by Score . . . . . . . . . . . . . . . . . .3533 5.16.3. Examples . . . . . . . . . . . . . . . . . . . . . . .3533 5.17. Limiting the Result Set . . . . . . . . . . . . . . . . .3533 5.17.1. Relationship to Result Ordering . . . . . . . . . . .3533 5.18. The 'caseless' XML Attribute . . . . . . . . . . . . . . .3634 5.19. Query Schema for DAV:basicsearch . . . . . . . . . . . . .3634 5.19.1. DTD for DAV:basicsearch QSD . . . . . . . . . . . . .3634 5.19.2. DAV:propdesc Element . . . . . . . . . . . . . . . . .3735 5.19.3. The DAV:datatype Property Description . . . . . . . .3735 5.19.4. The DAV:searchable Property Description . . . . . . .3836 5.19.5. The DAV:selectable Property Description . . . . . . .3836 5.19.6. The DAV:sortable Property Description . . . . . . . .3836 5.19.7. The DAV:caseless Property Description . . . . . . . .3836 5.19.8. The DAV:operators XML Element . . . . . . . . . . . .3837 5.19.9. Example of Query Schema for DAV:basicsearch . . . . .4038 6. Internationalization Considerations . . . . . . . . . . . . .4039 7. Security Considerations . . . . . . . . . . . . . . . . . . .4139 7.1. Implications of XML External Entities . . . . . . . . . .4139 8. Scalability . . . . . . . . . . . . . . . . . . . . . . . . .42 Reschke, et al. Expires March 3, 2009 [Page 3] Internet-Draft WebDAV SEARCH August 200840 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . .4240 9.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . .4240 9.1.1. DASL . . . . . . . . . . . . . . . . . . . . . . . . .4240 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . .4241 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . .4341 12. References . . . . . . . . . . . . . . . . . . . . . . . . . .4341 12.1. Normative References . . . . . . . . . . . . . . . . . . .4341 12.2. Informative References . . . . . . . . . . . . . . . . . .4442 Appendix A. Three-Valued Logic in DAV:basicsearch . . . . . . . .4544 Appendix B. Candidates for Future Protocol Extensions . . . . . .4645 B.1. Collation Support . . . . . . . . . . . . . . . . . . . .4645 B.2. Count . . . . . . . . . . . . . . . . . . . . . . . . . .4746 B.3. Diagnostics for Unsupported Queries . . . . . . . . . . .4746 Reschke, et al. Standards Track [Page 3] RFC 5323 WebDAV SEARCH November 2008 B.4. Language Matching . . . . . . . . . . . . . . . . . . . .4746 B.5. Matching Media Types . . . . . . . . . . . . . . . . . . .4746 B.6. Query by Name . . . . . . . . . . . . . . . . . . . . . .4846 B.7. Result Paging . . . . . . . . . . . . . . . . . . . . . .4846 B.8. Search Scope Discovery . . . . . . . . . . . . . . . . . .48 Appendix C. Change Log (to be removed by RFC Editor before publication) . .47 Index . . . . . . . . . . . . . . . . . .48 C.1. From draft-davis-dasl-protocol-xxx. . . . . . . . . . . .48 C.2. since start47 1. Introduction 1.1. DASL This document defines Web Distributed Authoring and Versioning (WebDAV) SEARCH, an application ofdraft-reschke-webdav-search . . . . . . . . 50 C.3. since draft-reschke-webdav-search-00 . . . . . . . . . . . 52 C.4. since draft-reschke-webdav-search-01 . . . . . . . . . . . 52 C.5. since draft-reschke-webdav-search-02 . . . . . . . . . . . 52 C.6. since draft-reschke-webdav-search-03 . . . . . . . . . . . 53 C.7. since draft-reschke-webdav-search-04 . . . . . . . . . . . 53 C.8. since draft-reschke-webdav-search-05 . . . . . . . . . . . 54 C.9. since draft-reschke-webdav-search-06 . . . . . . . . . . . 54 C.10. since draft-reschke-webdav-search-07 . . . . . . . . . . . 55 C.11. since draft-reschke-webdav-search-08 . . . . . . . . . . . 55 C.12. since draft-reschke-webdav-search-09 . . . . . . . . . . . 55 C.13. since draft-reschke-webdav-search-10 . . . . . . . . . . . 56 C.14. since draft-reschke-webdav-search-11 . . . . . . . . . . . 56 C.15. since draft-reschke-webdav-search-12 . . . . . . . . . . . 56 C.16. since draft-reschke-webdav-search-13 . . . . . . . . . . . 56 C.17. since draft-reschke-webdav-search-14 . . . . . . . . . . . 56 C.18. since draft-reschke-webdav-search-15 . . . . . . . . . . . 57 C.19. since draft-reschke-webdav-search-16 . . . . . . . . . . . 57 C.20. since draft-reschke-webdav-search-17 . . . . . . . . . . . 57 Appendix D. Resolved issues (to be removed by RFC Editor before publication) . . . . . . . . . . . . . . . . . 58 D.1. safeness . . . . . . . . . . . . . . . . . . . . . . . . . 58 D.2. ordering-vs-limiting . . . . . . . . . . . . . . . . . . . 58 Appendix E. Open issues (to be removed by RFC Editor prior to publication) . . . . . . . . . . . . . . . . . . . . 58 E.1. edit . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 Reschke, et al. Expires March 3, 2009 [Page 4] Internet-Draft WebDAV SEARCH August 2008 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 60 Intellectual Property and Copyright Statements . . . . . . . . . . 62 Reschke, et al. Expires March 3, 2009 [Page 5] Internet-Draft WebDAV SEARCH August 2008 1. Introduction 1.1. DASL This document defines Web Distributed Authoring and Versioning (WebDAV) SEARCH, an application of HTTP/1.1 forming a lightweight search protocol to transport queries and result sets that allows clients to make use of server-side search facilities. It is based on the expired internet draft for DAV Searching & Locating [DASL]. [DASLREQ] describes the motivation for DASL. In this specification, the terms "WebDAV SEARCH" and "DASL" are used interchangeably. DASL minimizes the complexity of clients so as to facilitate widespread deployment of applications capable of utilizing the DASL search mechanisms. DASL consists of: o the SEARCH method and the request/response formats defined for it (Section 2), o feature discovery through the "DASL" response header and the optional DAV:supported-grammar-set property (Section 3), o optional grammar schema discovery (Section 4) and o one mandatory grammar: DAV:basicsearch (Section 5). 1.2. Relationship to DAV DASL relies on the resource and property model defined by [RFC4918]. DASL does not alter this model. Instead, DASL allows clients to access DAV-modeled resources through server-side search. 1.3. Terms This document uses the terms defined in [RFC2616], in [RFC4918], in [RFC3253] and in this section. Criteria An expression against which each resource in the search scope is evaluated. Query A query is a combination of a search scope, search criteria, result record definition, sort specification, and a search Reschke, et al. Expires March 3, 2009 [Page 6] Internet-Draft WebDAV SEARCH August 2008 modifier. Query Grammar A set of definitions of XML elements, attributes, and constraints on their relations and values that defines a set of queries and the intended semantics. Query Schema A listing, for any given grammar and scope, of the properties and operators that may be used in a query with that grammar and scope. Result A result is a result set, optionally augmented with other information describing the search as a whole. Result Record A description of a resource. A result record is a set of properties, and possibly other descriptive information. Result Record Definition A specification of the set of properties to be returned in the result record. Result Set A set of records, one for each resource for which the search criteria evaluated to True. Scope A set of resources to be searched. Search Arbiter A resource that supports the SEARCH method. Search Modifier An instruction that governs the execution of the query but is not part of the search scope, result record definition, the search criteria, or the sort specification. An example of a search modifier is one that controls how much time the server can spend on the query before giving a response. Reschke, et al. Expires March 3, 2009 [Page 7] Internet-Draft WebDAV SEARCH August 2008 Sort Specification A specification of an ordering on the result records in the result set. 1.4. Notational Conventions This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234], unless explicitly stated otherwise. 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 [RFC2119]. This document uses XML DTD fragments ([XML], Section 3.2) as a purely notational convention. WebDAV request and response bodies can not be validated by a DTD due to the specific extensibility rules defined in Section 17 of [RFC4918] and due to the fact that all XML elements defined by this specification use the XML namespace name "DAV:". In particular: 1. element names use the "DAV:" namespace, 2. element ordering is irrelevant unless explicitly stated, 3. extension elements (elements not already defined as valid child elements) may be added anywhere, except when explicitly stated otherwise, 4. extension attributes (attributes not already defined as valid for this element) may be added anywhere, except when explicitly stated otherwise. 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. Similarly, 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. This document inherits, and sometimes extends, DTD productions from Section 14 of [RFC4918]. Reschke, et al. Expires March 3, 2009 [Page 8] Internet-Draft WebDAV SEARCH August 2008 1.5. Note on Usage of 'DAV:' XML Namespace This specification defines elements, properties and condition names in the XML namespace "DAV:". In general, only specifications authored by IETF working groups are supposed to do this. In this case an exception was made, because WebDAV SEARCH started its life in the IETF DASL working group (<http://www.webdav.org/dasl/>, and at the time the working group closed down there was already significant deployment of this specification. 1.6. An Overview of DASL at Work One can express the basic usage of DASL in the following steps: o The client constructs a query using the DAV:basicsearch grammar. o 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. o The search arbiter performs the query. o 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 WebDAV multistatus format ([RFC4918], Section 13). 2. The SEARCH Method 2.1. Overview 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 WebDAV multistatus format ([RFC4918], Section 13). 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. SEARCH is a safe method; it does not have any significance other than executing a query and returning a query result (see [RFC2616], Section 9.1.1). 2.2. The Request The client invokes the SEARCH method on the resource named by the Request-URI. Reschke, et al. Expires March 3, 2009 [Page 9] Internet-Draft WebDAV SEARCH August 2008 2.2.1. The Request-URI 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 [RFC4918], Section 15.9), nor does it have to be a WebDAV-compliant resource. 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, a query grammar may force the Request-URI to correspond exactly to the search scope. 2.2.2. The Request Body The server MUST process a text/xml or application/xml request body, and MAY process request bodies in other formats. See [RFC3023] for guidance on packaging XML in requests. Marshalling: If a request body with content type text/xml or application/xml is included, it MUST be either a DAV:searchrequest or a DAV:query- schema-discovery XML element. Its single child element identifies the query grammar. For DAV:searchrequest, the definition of search criteria, the result record, and any other details needed to perform the search depend on the individual search grammar. For DAV:query-schema-discovery, the semantics is defined in Section 4. Preconditions: (DAV:search-grammar-discovery-supported): when an XML request body is present and has a DAV:query-schema-discovery document element, the server MUST support the query schema discovery mechanism described in Section 4. (DAV:search-grammar-supported): when an XML request body is present, the search grammar identified by the document element's child element must be a supported search grammar. (DAV:search-multiple-scope-supported): if the SEARCH request specified multiple scopes, the server MUST support this optional feature. Reschke, et al. Expires March 3, 2009 [Page 10] Internet-Draft WebDAV SEARCH August 2008 (DAV:search-scope-valid): the supplied search scope must be valid. There can be various reasons for a search scope to be invalid, including unsupported URI schemes and communication problems. Servers MAY add [RFC4918] compliant DAV:response elements as content to the condition element indicating the precise reason for the failure. 2.3. The Successful 207 (Multistatus) Response If the server returns 207 (Multistatus), then the search proceeded successfully and the response MUST use the WebDAV multistatus format ([RFC4918], Section 13). The results of this method SHOULD NOT be cached. 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. Note: the WebDAV multistatus format requires at least one DAV: response child element. This specification relaxes that restriction so that empty results can be represented. 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 only one of these URIs. Clients can use the live property DAV:resource-id defined in Section 3.1 of [draft-ietf-webdav-bind] to identify possible duplicates. 2.3.1. Result Set Truncation 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. When a result set is truncated, there may be many more resources that satisfy the search criteria but that were not examined. 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. Note that the partial results returned MAY be any subset of the result set that would have satisfied the original query. Reschke, et al. Expires March 3, 2009 [Page 11] Internet-Draft WebDAV SEARCH August 2008 2.3.2. Extending the PROPFIND Response 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. 2.3.3. Example: A Simple Request and Response 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. >> Request: SEARCH / HTTP/1.1 Host: example.org Content-Type: application/xml; charset="utf-8" Content-Length: 252 <?xml version="1.0" encoding="UTF-8"?> <D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo"> <F:natural-language-query> Find the locations of good Thai restaurants in Los Angeles </F:natural-language-query> </D:searchrequest> Reschke, et al. Expires March 3, 2009 [Page 12] Internet-Draft WebDAV SEARCH August 2008 >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: 429 <?xml version="1.0" encoding="UTF-8"?> <D:multistatus xmlns:D="DAV:" xmlns:R="http://example.org/propschema"> <D:response> <D:href>http://siamiam.example/</D:href> <D:propstat> <D:prop> <R:location>259 W. Hollywood</R:location> <R:rating><R:stars>4</R:stars></R:rating> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> 2.3.4. Example: Result Set Truncation In the example below, the server returns just two results, and then indicates that the result is truncated by adding a DAV:response element for the search arbiter resource with 507 (Insufficient Storage) status. >> Request: SEARCH / HTTP/1.1 Host: example.net Content-Type: text/xml; charset="utf-8" Content-Length: xxx ... the query goes here ... Reschke, et al. Expires March 3, 2009 [Page 13] Internet-Draft WebDAV SEARCH August 2008 >> Response:HTTP/1.1207 Multistatus Content-Type: text/xml; charset="utf-8" Content-Length: 640 <?xml version="1.0" encoding="utf-8"?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://www.example.net/sounds/unbrokenchain.au</D:href> <D:status>HTTP/1.1 200 OK</D:status> </D:response> <D:response> <D:href>http://tech.mit.example/arch96/photos/Lesh1.jpg</D:href> <D:status>HTTP/1.1 200 OK</D:status> </D:response> <D:response> <D:href>http://example.net</D:href> <D:status>HTTP/1.1 507 Insufficient Storage</D:status> <D:responsedescription xml:lang="en"> Only first two matching records were returned </D:responsedescription> </D:response> </D:multistatus> 2.4. Unsuccessful Responses Ifforming aSEARCH request could not be executed or the attemptlightweight search protocol toexecute it resulted in an error, the server MUST indicate the failure with an appropriate status codetransport queries andSHOULD add a response body as defined in [RFC3253], Section 1.6. Unless otherwise stated, condition elements are empty, however specific condition elements MAY include additional child elements that describe the error condition in more detail. 2.4.1. Example of an Invalid Scope In the example below, a request failed because the scope identifies a HTTP resourceresult sets thatwas not found. Reschke, et al. Expires March 3, 2009 [Page 14] Internet-Draft WebDAV SEARCH August 2008 >> Response: HTTP/1.1 409 Conflict Content-Type: text/xml; charset="utf-8" Content-Length: 275 <?xml version="1.0" encoding="UTF-8"?> <d:error xmlns:d="DAV:"> <d:search-scope-valid> <d:response> <d:href>http://www.example.com/X</d:href> <d:status>HTTP/1.1 404 Object Not Found</d:status> </d:response> </d:search-scope-valid> </d:error> 3. Discovery of Supported Query Grammars Servers MUST support discoveryallows clients to make use ofthe query grammars supported by aserver-side searcharbiter resource. Clients can determine which query grammars are supported by an arbiter by invoking OPTIONSfacilities. It is based onthe search arbiter. If the resource supports SEARCH, then the DASL response header will appearearlier work done in theresponse. TheIETF DASLresponse header lists the supported grammars. Servers supporting the WebDAV extensions [RFC3253] and/or [RFC3744] MUST also o report SEARCH in the live property DAV:supported-method-set for all search arbiter resources and o support the live property DAV:supported-query-grammar-set as defined inWorking Group (see Section3.3. 3.1. The OPTIONS Method The OPTIONS method allows10). In this specification, theclient to discover if a resource supportsterms "WebDAV SEARCH" and "DASL" are used interchangeably. DASL minimizes theSEARCH method andcomplexity of clients so as todetermine the listfacilitate widespread deployment of applications capable of utilizing the DASL searchgrammars supported for that resource. The client issuesmechanisms. DASL consists of: o theOPTIONSSEARCH methodagainst a resource named byand theRequest-URI. This is a normal invocation of OPTIONS asrequest/response formats definedin Section 9.2 of [RFC2616]. If a resource supportsfor it (Section 2), o feature discovery through theSEARCH method, then"DASL" response header and theserver MUST list SEARCH inoptional DAV:supported-grammar-set property (Section 3), o optional grammar schema discovery (Section 4), and o one mandatory grammar: DAV:basicsearch (Section 5). 1.2. Relationship to DAV DASL relies on theAllow headerresource and property model definedin Section 14.7 of [RFC2616].by [RFC4918]. DASL does not alter this model. Instead, DASL allows clients to access DAV-modeled resources through server-side search. Reschke, et al.Expires March 3, 2009Standards Track [Page15] Internet-Draft4] RFC 5323 WebDAV SEARCHAugustNovember 2008DASL servers MUST include the DASL header in the OPTIONS response.1.3. Terms Thisheader identifies the search grammars supported by that resource. 3.2. The DASL Response Header DASLHeader = "DASL" ":" 1#Coded-URL Coded-URL = <defined in Section 10.1 of [RFC4918]> (This grammardocument uses theaugmented BNF formatterms defined inSection 2.1 of [RFC2616]) The DASL response header indicates server support for query grammars[RFC2616], [RFC4918], [RFC3253], and in this section. Criteria An expression against which each resource in theOPTIONS method. The valuesearch scope is evaluated. Query A query is alistcombination ofURIs that indicate the typesa search scope, search criteria, result record definition, sort specification, and a search modifier. Query Grammar A set ofsupported grammars. Notedefinitions of XML elements, attributes, and constraints on their relations and values thatalthough the URIs can be used to identify each supported search grammar, there is not necessarilydefines adirect relationship betweenset of queries and theURIintended semantics. Query Schema A listing, for any given grammar and scope, of theXML element nameproperties and operators thatcanmay be used inXML based SEARCH requests (the element name itself is identified by its namespace name (a URI reference) and the element's local name). Note: this header field value is defined asacomma-separated list ([RFC2616], Section 4.2), thus grammar URIs can appear in multiple header instances, separated by commas, or both. For example: DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2>, <DAV:basicsearch> DASL: <http://example.com/foo/natural-language-query> 3.3. DAV:supported-query-grammar-set (protected) This WebDAV property is required for any server supporting either [RFC3253] and/or [RFC3744] and identifies the XML basedquerygrammarswith thatare supported by the search arbiter resource. <!ELEMENT supported-query-grammar-set (supported-query-grammar*)> <!ELEMENT supported-query-grammar (grammar)> <!ELEMENTgrammarANY> <!-- ANY value:and scope. Result A result is aquery grammar element type --> 3.4. Example: Grammar Discovery This example shows that the server supports search on the /somefolder resourceresult set, optionally augmented with other information describing thequery grammars: DAV:basicsearch, http://foobar.example/syntax1 and http://akuma.example/syntax2. Note that servers supporting WebDAV SEARCH MUST support DAV:basicsearch. Reschke, et al. Expires March 3, 2009 [Page 16] Internet-Draft WebDAV SEARCH August 2008 >> Request: OPTIONS /somefolder HTTP/1.1 Host: example.org >> Response: HTTP/1.1 200 OK Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH DASL: <DAV:basicsearch> DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2> This example shows the equivalent taking advantagesearch as a whole. Result Record A description of aserver's support for DAV:supported-method-setresource. A result record is a set of properties, andDAV:supported-query-grammar- set. >> Request: PROPFIND /somefolder HTTP/1.1 Host: example.org Depth: 0 Content-Type: text/xml; charset="utf-8" Content-Length: 165 <?xml version="1.0" encoding="UTF-8" ?> <propfind xmlns="DAV:"> <prop> <supported-query-grammar-set/> <supported-method-set/> </prop> </propfind>possibly other descriptive information. Result Record Definition A specification of the set of properties to be returned in the result record. Result Set A set of records, one for each resource for which the search criteria evaluated to True. Reschke, et al.Expires March 3, 2009Standards Track [Page17] Internet-Draft5] RFC 5323 WebDAV SEARCHAugustNovember 2008>> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: 1349 <?xml version="1.0" encoding="utf-8" ?> <multistatus xmlns="DAV:"> <response> <href>http://example.org/somefolder</href> <propstat> <prop> <supported-query-grammar-set> <supported-query-grammar> <grammar><basicsearch/></grammar> </supported-query-grammar> <supported-query-grammar> <grammar><syntax1 xmlns="http://foobar.example/"/></grammar> </supported-query-grammar> <supported-query-grammar> <grammar><syntax2 xmlns="http://akuma.example/"/></grammar> </supported-query-grammar> </supported-query-grammar-set> <supported-method-set> <supported-method name="COPY" /> <supported-method name="DELETE" /> <supported-method name="GET" /> <supported-method name="HEAD" /> <supported-method name="LOCK" /> <supported-method name="MKCOL" /> <supported-method name="MOVE" /> <supported-method name="OPTIONS" /> <supported-method name="POST" /> <supported-method name="PROPFIND" /> <supported-method name="PROPPATCH" /> <supported-method name="PUT" /> <supported-method name="SEARCH" /> <supported-method name="TRACE" /> <supported-method name="UNLOCK" /> </supported-method-set> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> </multistatus> NoteScope A set of resources to be searched. Search Arbiter A resource that supports the SEARCH method. Search Modifier An instruction that governs the execution of the querygrammar element names marshalled asbut is not part of theDAV:supported-query-grammar-set cansearch scope, result record definition, the search criteria, or the sort specification. An example of a search modifier is one that controls how much time the server can spend on the query before giving a response. Sort Specification A specification of an ordering on the result records in the result set. 1.4. Notational Conventions This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234], unless explicitly stated otherwise. The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to bedirectly usedinterpreted aselement names Reschke, et al. Expires March 3, 2009 [Page 18] Internet-Draft WebDAV SEARCH August 2008described inan[RFC2119]. This document uses XMLbased query. 4. Query Schema Discovery: QSD Servers MAY support the discovery of the schema forDTD fragments ([XML], Section 3.2) as aquery grammar. The DASL response headerpurely notational convention. WebDAV request andthe DAV:supported-query-grammar-set property provide means for clientsresponse bodies cannot be validated by a DTD due todiscoverthesetspecific extensibility rules defined in Section 17 ofquery grammars supported[RFC4918] and due to the fact that all XML elements defined bya resource. This alonethis specification use the XML namespace name "DAV:". In particular: 1. element names use the "DAV:" namespace, 2. element ordering is irrelevant unless explicitly stated, 3. extension elements (elements notsufficient informationalready defined as valid child elements) may be added anywhere, except when explicitly stated otherwise, 4. extension attributes (attributes not already defined as valid fora 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, butthis element) may be added anywhere, except when explicitly stated otherwise. Reschke, et al. Standards Track [Page 6] RFC 5323 WebDAV SEARCH November 2008 When an XML element type in thegrammar itself does not specify which properties may be used"DAV:" namespace is referenced in this document outside of thequery. QSD forcontext of an XML fragment, theDAV:basicsearch grammar allows a clientstring "DAV:" will be prefixed todiscovertheset of properties that are searchable, selectable, and sortable. Moreover, althoughelement type. Similarly, when an XML element type in theDAV:basicsearch grammar defines a minimal set of operators, itnamespace "http://www.w3.org/2001/XMLSchema" ispossible that a resource might support additional operatorsreferenced ina query. For example, a resource might supportthis document outside of the context of anoptional operator that canXML fragment, the string "xs:" will beusedprefixed toexpress content-based queriesthe element type. This document inherits, and sometimes extends, DTD productions from Section 14 of [RFC4918]. 1.5. Note on Usage of 'DAV:' XML Namespace This specification defines elements, properties, and condition names ina proprietary syntax. QSD allows a clientthe XML namespace "DAV:". In general, only specifications authored by IETF working groups are supposed todiscover these operatorsdo this. In this case an exception was made, because WebDAV SEARCH started its life in the IETF DASL working group (<http://www.webdav.org/dasl/>, andtheir syntax. The setat the time the working group closed down there was already significant deployment ofdiscoverable quantities will differ from grammar to grammar, but each grammar can define a means for a client to discover whatthis specification. 1.6. An Overview of DASL at Work One canbe discovered. In general,express the basic usage of DASL in theschema forfollowing steps: o The client constructs agivenquerygrammar depends on bothusing theresource (the arbiter) andDAV:basicsearch grammar. o The client invokes thescope. A given resource might have access to one set of properties for one potential scope, and another set for a different scope. For example, considerSEARCH method on aserver 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, whileresource that will perform thesecond defined properties such as yieldsearch (the search arbiter) andapplicable patents. Two distinct arbiters indexing the same collection might also have access to different properties. For example, the recipe collection mentioned above might also be indexed byincludes avalue-added servertext/xml or application/xml request entity thatalso stored the names of chefs who had testedcontains therecipe. Note also thatquery. o The search arbiter performs theavailable query schema might also depend on other factors, such asquery. o The search arbiter sends theidentityresults of theprincipal conducting the search, but these factors are not exposed in this protocol. 4.1. Additional SEARCH Semantics Eachquerygrammar supported by DASL defines its own syntax for expressingback to thepossible query schema. Aclientretrievesin theschema for a given query grammar onresponse. The server MUST send anarbiter resource with a given scope by invokingentity that matches the WebDAV multistatus format ([RFC4918], Section 13). 2. The SEARCH Method 2.1. Overview The client invokes the SEARCH methodon that arbiter with that grammar andto initiate a server-side search. The body of the request defines the query. The server MUST emit an entity matching the WebDAV multistatus format ([RFC4918], Section 13). Reschke, et al.Expires March 3, 2009Standards Track [Page19] Internet-Draft7] RFC 5323 WebDAV SEARCHAugustNovember 2008scope and with a root element of DAV:query-schema-discovery rather than DAV:searchrequest. Marshalling: The request body MUST be a DAV:query-schema-discovery element. <!ELEMENT query-schema-discovery ANY> <!-- ANY value: XML element specifying the query grammar and the scope -->Theresponse body takesSEARCH method plays theformrole ofa DAV:multistatus element ([RFC4918], Section 13), where DAV:response is extended to holdtransport mechanism for thereturnedquerygrammar inside a DAV:query-schema container element. <!ELEMENT response (href, status, query-schema?, responsedescription?) > <!ELEMENT query-schema ANY> The content of this container is an XML element whose nameandsyntax depend uponthegrammar, and whose value may (and likely will) vary depending uponresult set. It does not define thegrammar, arbiter, and scope. 4.1.1. Examplesemantics ofQuery Schema Discovery In this example,thearbiter is recipes.example,query. The type of thegrammar is DAV: basicsearch,query defines thescope is also recipes.example. >> Request: SEARCH / HTTP/1.1 Host: recipes.example Content-Type: application/xml; charset="utf-8" Content-Length: 258 <?xml version="1.0"?> <query-schema-discovery xmlns="DAV:"> <basicsearch> <from> <scope> <href>http://recipes.example</href> <depth>infinity</depth> </scope> </from> </basicsearch> </query-schema-discovery> Reschke, et al. Expires March 3, 2009 [Page 20] Internet-Draft WebDAVsemantics. SEARCHAugust 2008 >> Response: HTTP/1.1 207 Multistatus Content-Type: application/xml; charset="utf-8" Content-Length: xxx <?xml version="1.0"?> <multistatus xmlns="DAV:"> <response> <href>http://recipes.example</href> <status>HTTP/1.1 200 OK</status> <query-schema> <basicsearchschema> <!-- (Seeis a safe method; it does not have any significance other than executing a query and returning a query result (see [RFC2616], Section5.19 for9.1.1). 2.2. The Request The client invokes theactual contents) --> </basicsearchschema> </query-schema> </response> </multistatus>SEARCH method on the resource named by the Request-URI. 2.2.1. Thequery schema for DAV:basicsearchRequest-URI 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 [RFC4918], Section5.19. 5. The DAV:basicsearch Grammar 5.1. Introduction DAV:basicsearch uses an extensible XML syntax that allows clients15.9), nor does it have toexpress search requests that are generally useful for WebDAV scenarios. DASL-extended servers MUST accept this grammar, and MAY accept other grammars. DAV:basicsearch has several components: o DAV:select provides the result record definition. o DAV:from defines the scope. o DAV:wherebe a WebDAV-compliant resource. The SEARCH method defines no relationship between thecriteria. o DAV:orderby definesarbiter and thesort orderscope of theresult set. o DAV:limit provides constraints onsearch; rather, the particular queryasgrammar used in the query defines the relationship. For example, awhole. Reschke, et al. Expires March 3, 2009 [Page 21] Internet-Draft WebDAV SEARCH August 2008 5.2. The DAV:basicsearch DTD <!-- "basicsearch" element --> <!ELEMENT basicsearch (select, from, where?, orderby?, limit?) > <!-- "select" element --> <!ELEMENT select (allprop | prop) > <!-- "from" element --> <!ELEMENT from (scope+) > <!ELEMENT scope (href, depth, include-versions?) > <!ELEMENT include-versions EMPTY > <!-- "where" element --> Reschke, et al. Expires March 3, 2009 [Page 22] Internet-Draft WebDAV SEARCH August 2008 <!ENTITY % comp_ops "eq | lt | gt| lte | gte"> <!ENTITY % log_ops "and |query grammar may force the Request-URI to correspond exactly to the search scope. 2.2.2. The Request Body The server MUST process a text/xml or| not"> <!ENTITY % special_ops "is-collection | is-defined | language-defined | language-matches"> <!ENTITY % string_ops "like"> <!ENTITY % content_ops "contains"> <!ENTITY % all_ops "%comp_ops; | %log_ops; | %special_ops; | %string_ops; | %content_ops;"> <!ELEMENT where ( %all_ops; ) > <!ELEMENTapplication/xml request body, and( %all_ops; )+ > <!ELEMENTMAY process request bodies in other formats. See [RFC3023] for guidance on packaging XML in requests. Marshalling: If a request body with content type text/xml or( %all_ops; )+ > <!ELEMENT not ( %all_ops; ) > <!ELEMENT lt (prop, (literal|typed-literal)) > <!ATTLIST lt caseless (yes|no) #IMPLIED> <!ELEMENT lte (prop, (literal|typed-literal)) > <!ATTLIST lte caseless (yes|no) #IMPLIED> <!ELEMENT gt (prop, (literal|typed-literal)) > <!ATTLIST gt caseless (yes|no) #IMPLIED> <!ELEMENT gte (prop, (literal|typed-literal)) > <!ATTLIST gte caseless (yes|no) #IMPLIED> <!ELEMENT eq (prop, (literal|typed-literal)) > <!ATTLIST eq caseless (yes|no) #IMPLIED> <!ELEMENT literal (#PCDATA)> <!ELEMENT typed-literal (#PCDATA)> <!ATTLIST typed-literal xsi:type CDATA #IMPLIED> <!ELEMENT is-collection EMPTY > <!ELEMENT is-defined (prop) > <!ELEMENT language-defined (prop) > <!ELEMENT language-matches (prop, literal) > <!ELEMENT like (prop, literal) > <!ATTLIST like caseless (yes|no) #IMPLIED> <!ELEMENT contains (#PCDATA)> Reschke, et al. Expires March 3, 2009 [Page 23] Internet-Draft WebDAV SEARCH August 2008 <!-- "orderby" element --> <!ELEMENT orderby (order+) > <!ELEMENT order ((prop | score), (ascending | descending)?)> <!ATTLIST order caseless (yes|no) #IMPLIED> <!ELEMENT ascending EMPTY> <!ELEMENT descending EMPTY> <!-- "limit" element --> <!ELEMENT limit (nresults) > <!ELEMENT nresults (#PCDATA) > 5.2.1. Example Query Thisapplication/xml is included, it MUST be either a DAV:searchrequest or a DAV:query- schema-discovery XML element. Its single child element identifies the queryretrievesgrammar. For DAV:searchrequest, thecontent length values for all resources located underdefinition of search criteria, theserver's "/container1/" URI namespace whose length exceeds 10000 sorted ascending by size. <d:searchrequest xmlns:d="DAV:"> <d:basicsearch> <d:select> <d:prop><d:getcontentlength/></d:prop> </d:select> <d:from> <d:scope> <d:href>/container1/</d:href> <d:depth>infinity</d:depth> </d:scope> </d:from> <d:where> <d:gt> <d:prop><d:getcontentlength/></d:prop> <d:literal>10000</d:literal> </d:gt> </d:where> <d:orderby> <d:order> <d:prop><d:getcontentlength/></d:prop> <d:ascending/> </d:order> </d:orderby> </d:basicsearch> </d:searchrequest>result record, and any other details needed to perform the search depend on the individual search grammar. For DAV:query-schema-discovery, the semantics is defined in Section 4. Reschke, et al.Expires March 3, 2009Standards Track [Page24] Internet-Draft8] RFC 5323 WebDAV SEARCHAugustNovember 20085.3. DAV:select DAV:select defines the result record, whichPreconditions: (DAV:search-grammar-discovery-supported): when an XML request body isa set of propertiespresent andvalues. Thishas a DAV:query-schema-discovery documentdefines two possible values: DAV:allprop and DAV:prop, both defined in Section 14 of [RFC4918]. 5.4. DAV:from <!ELEMENT scope (href, depth, include-versions?) > <!ELEMENT include-versions EMPTY > DAV:from defineselement, the server MUST support the queryscope. This contains one or more DAV: scope elements. Support for multiple scope elementsschema discovery mechanism described in Section 4. (DAV:search-grammar-supported): when an XML request body isoptional, however servers MUST failpresent, the search grammar identified by the document element's child element must be a supported search grammar. (DAV:search-multiple-scope-supported): if the SEARCH requestspecifyingspecified multipleDAV:scope elements if they can'tscopes, the server MUST supportit (see Section 2.2.2, precondition DAV:search-multiple-scope-supported). The scope element contains mandatory DAV:href and DAV:depth elements. DAV:href indicatesthis optional feature. (DAV:search-scope-valid): theURI reference ([RFC3986], Section 4.1)supplied search scope must be valid. There can be various reasons for a search scope tousebe invalid, including unsupported URI schemes and communication problems. Servers MAY add [RFC4918] compliant DAV:response elements asa scope. Whencontent to thescope is a collection, if DAV:depth is "0",condition element indicating the precise reason for the failure. 2.3. The Successful 207 (Multistatus) Response If the server returns 207 (Multistatus), then the searchincludes onlyproceeded successfully, and thecollection. When it is "1",response MUST use the WebDAV multistatus format ([RFC4918], Section 13). The results of this method SHOULD NOT be cached. There MUST be one DAV:response for each resource that matched the searchincludescriteria. For each such response, thecollection and its immediate children. When it is "infinity", it includesDAV:href element contains thecollectionURI of the resource, andall its progeny. Whenthescope is notresponse MUST include acollection,DAV:propstat element. Note: thedepth is ignored andWebDAV multistatus format requires at least one DAV: response child element. This specification relaxes that restriction so that empty results can be represented. Note that for each matching resource found, there may be multiple URIs within the searchapplies justscope mapped to it. In this case, a server SHOULD report only one of these URIs. Clients can use theresource itself. If thelive property DAV:resource-id, defined in Section 3.1 of [WEBDAV-BIND] to identify possible duplicates. 2.3.1. Result Set Truncation A serversupports WebDAV Redirect Reference Resources ([RFC4437]) andMAY limit thesearch scope containsnumber of resources in aredirect reference resource, thenreply, for example, to limit the amount of resources expended in processing a query. If Reschke, et al. Standards Track [Page 9] RFC 5323 WebDAV SEARCH November 2008 itapplies only to that resource, not to its target. Whendoes so, thechild element DAV:include-versions is present,reply MUST use status code 207, return a DAV: multistatus response body, and indicate a status of 507 (Insufficient Storage) for the searchscope willarbiter URI. It SHOULD includeall versions (see [RFC3253], Section 2.2.1) of all version-controlledthe partial results. When a result set is truncated, there may be many more resourcesin scope. Serversthatdo support versioningsatisfy the search criteria butdothat were notsupport the DAV:include-versions feature MUST signal an error if it is used in a query (see Section 2.2.2, precondition DAV:search-scope-valid). 5.4.1. Relationship to the Request-URIexamined. If partial results are included and theDAV:scope element isclient requested anURI ([RFC3986], Section 3),ordered result set in thescope is exactlyoriginal request, then any partial results thatURI. Ifare returned MUST be ordered as theDAV:scope element is a relative reference ([RFC3986], Section 4.2),client directed. Note that thescope is taken topartial results returned MAY berelative toany subset of theRequest-URI. Reschke, et al. Expires March 3, 2009 [Page 25] Internet-Draft WebDAV SEARCH August 2008 5.4.2. Scoperesult set that would have satisfied the original query. 2.3.2. Extending the PROPFIND Response AScope can be an arbitrary URI reference. Servers, of course, may support only particular scopes. This mayresponse MAY includelimitations for particular schemes suchmore information than PROPFIND defines, so long as"http:" or "ftp:" or certain URI namespaces. However, WebDAV compliant search arbiters minimally SHOULD support scopes that match their own URI. 5.5. DAV:where The DAV:where element definesthesearch condition for inclusion of resources inextra information does not invalidate the PROPFIND response. Query grammars SHOULD define how theresult set.response matches the PROPFIND response. 2.3.3. Example: A Simple Request and Response This example demonstrates the request and response framework. Thevalue of this element is anfollowing XMLelement that definesdocument shows asearch operator that evaluates to onesimple (hypothetical) natural language query. The name of theBoolean truth values TRUE, FALSE, or UNKNOWN. The search operator contained by DAV:where may itself contain and evaluate additional search operators as operands, whichquery element is natural-language-query inturn may contain and evaluate additional search operators as operands, etc. recursively. 5.5.1. Usethe XML namespace "http://example.com/foo". The actual query is "Find the locations ofThree-Valued Logic in Queries Each operator defined for usegood Thai restaurants in Los Angeles". For this hypothetical query, thewhere clause thatarbiter returnsa Boolean value MUST evaluate to TRUE, FALSE, or UNKNOWN. The resource under scan is included as a membertwo properties for each selected resource. >> Request: SEARCH / HTTP/1.1 Host: example.org Content-Type: application/xml; charset="utf-8" Content-Length: 252 <?xml version="1.0" encoding="UTF-8"?> <D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo"> <F:natural-language-query> Find the locations of good Thai restaurants in Los Angeles </F:natural-language-query> </D:searchrequest> Reschke, et al. Standards Track [Page 10] RFC 5323 WebDAV SEARCH November 2008 >> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: 429 <?xml version="1.0" encoding="UTF-8"?> <D:multistatus xmlns:D="DAV:" xmlns:R="http://example.org/propschema"> <D:response> <D:href>http://siamiam.example/</D:href> <D:propstat> <D:prop> <R:location>259 W. Hollywood</R:location> <R:rating><R:stars>4</R:stars></R:rating> </D:prop> <D:status>HTTP/1.1 200 OK</D:status> </D:propstat> </D:response> </D:multistatus> 2.3.4. Example: Result Set Truncation In theresult set ifexample below, the server returns just two results, andonly ifthen indicates that thesearch condition evaluates to TRUE. Consult Appendix Aresult is truncated by adding a DAV:response element fordetails ontheapplication of three-valued logic insearch arbiter resource with 507 (Insufficient Storage) status. >> Request: SEARCH / HTTP/1.1 Host: example.net Content-Type: text/xml; charset="utf-8" Content-Length: xxx ... the queryexpressions. 5.5.2. Handling Optional Operatorsgoes here ... Reschke, et al. Standards Track [Page 11] RFC 5323 WebDAV SEARCH November 2008 >> Response: HTTP/1.1 207 Multistatus Content-Type: text/xml; charset="utf-8" Content-Length: 640 <?xml version="1.0" encoding="utf-8"?> <D:multistatus xmlns:D="DAV:"> <D:response> <D:href>http://www.example.net/sounds/unbrokenchain.au</D:href> <D:status>HTTP/1.1 200 OK</D:status> </D:response> <D:response> <D:href>http://tech.mit.example/arch96/photos/Lesh1.jpg</D:href> <D:status>HTTP/1.1 200 OK</D:status> </D:response> <D:response> <D:href>http://example.net</D:href> <D:status>HTTP/1.1 507 Insufficient Storage</D:status> <D:responsedescription xml:lang="en"> Only first two matching records were returned </D:responsedescription> </D:response> </D:multistatus> 2.4. Unsuccessful Responses If aquery contains an operator that isSEARCH request could notsupported bybe executed or theserver, thenattempt to execute it resulted in an error, the server MUSTrespondindicate the failure witha 422 (Unprocessable Entity)an appropriate statuscode. 5.5.3. Treatment of NULL Values If a PROPFIND for a property value would yieldcode and SHOULD add anon-2xx (see [RFC2616], Section 10.2)responsefor that property, then that property is considered NULL. NULL values are "less than" all other valuesbody as defined incomparisons. Empty strings (zero length strings)Section 1.6 of [RFC3253]. Unless otherwise stated, condition elements arenot NULL values. An empty string is "less than"empty; however, specific condition elements MAY include additional child elements that describe the error condition in more detail. 2.4.1. Example of an Invalid Scope In the example below, astring with length greater than zero. The DAV:is-defined operator is defined to test ifrequest failed because thevalue ofscope identifies aproperty isHTTP resource that was notNULL.found. Reschke, et al.Expires March 3, 2009Standards Track [Page26] Internet-Draft12] RFC 5323 WebDAV SEARCHAugustNovember 20085.5.4. Treatment>> Response: HTTP/1.1 409 Conflict Content-Type: text/xml; charset="utf-8" Content-Length: 275 <?xml version="1.0" encoding="UTF-8"?> <d:error xmlns:d="DAV:"> <d:search-scope-valid> <d:response> <d:href>http://www.example.com/X</d:href> <d:status>HTTP/1.1 404 Object Not Found</d:status> </d:response> </d:search-scope-valid> </d:error> 3. Discovery ofProperties with mixed/element Content ComparisonsSupported Query Grammars Servers MUST support discovery ofproperties that do not have simple types (text-only content) is out-of-scope forthestandard operators definedquery grammars supported by a search arbiter resource. 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. Servers supporting the WebDAV extensions [RFC3253] and/or [RFC3744] MUST also: o report SEARCH in the live property DAV:supported-method-set forDAV: basicsearchall search arbiter resources, andtherefore is defined to be UNKNOWN (as per Appendix A). For queryingo support theDAV:resourcetype property, seelive property DAV:supported-query-grammar-set as defined in Section5.13. 5.5.5. Example: Testing for Equality3.3. 3.1. Theexample showsOPTIONS Method The OPTIONS method allows the client to discover if asingle operator (DAV:eq) applied inresource supports thecriteria. <d:where xmlns:d='DAV:'> <d:eq> <d:prop> <d:getcontentlength/> </d:prop> <d:literal>100</d:literal> </d:eq> </d:where> 5.5.6. Example: Relative ComparisonsSEARCH method and to determine the list of search grammars supported for that resource. Theexample showsclient issues the OPTIONS method against amore complex operation involving several operators (DAV:and, DAV:eq, DAV:gt) applied inresource named by thecriteria.Request-URI. ThisDAV:where expression matches those resourcesis a normal invocation oftype "image/gif" over 4KOPTIONS as defined insize. <D:where xmlns:D='DAV:'> <D:and> <D:eq> <D:prop> <D:getcontenttype/> </D:prop> <D:literal>image/gif</D:literal> </D:eq> <D:gt> <D:prop> <D:getcontentlength/> </D:prop> <D:literal>4096</D:literal> </D:gt> </D:and> </D:where>Section 9.2 of [RFC2616]. Reschke, et al.Expires March 3, 2009Standards Track [Page27] Internet-Draft13] RFC 5323 WebDAV SEARCHAugustNovember 20085.6. DAV:orderby The DAV:orderby element specifiesIf a resource supports theordering ofSEARCH method, then theresult set. It contains one or more DAV:order elements, each of which specifies a comparison between two itemsserver MUST list SEARCH in theresult set. Informally, a comparison specifies a test that determines whether one resource appears before anotherAllow header defined in Section 14.7 of [RFC2616]. DASL servers MUST include theresult set. Comparisons are appliedDASL header in theorder they occur inOPTIONS response. This header identifies theDAV:orderby element, earlier comparisons being more significant.search grammars supported by that resource. 3.2. Thecomparisons defined here use only a single property from each resource, compared using the same ordering asDASL Response Header DASLHeader = "DASL" ":" 1#Coded-URL Coded-URL = <defined in Section 10.1 of [RFC4918]> (This grammar uses theDAV:lt operator (ascending) or DAV:gt operator (descending). If neither direction is specified,augmented BNF format defined in Section 2.1 of [RFC2616].) The DASL response header indicates server support for query grammars in thedefaultOPTIONS method. The value isDAV:ascending. Ina list of URIs that indicate thecontexttypes of supported grammars. Note that although theDAV:orderby element, null values are consideredURIs can be used tocollate before any actual (i.e., non null) value, including strings of zero length (this is compatible with [SQL99]). The "caseless" attribute mayidentify each supported search grammar, there is not necessarily a direct relationship between the URI and the XML element name that can be usedto indicate case-sensitivity for comparisons (Section 5.18). 5.6.1. Example of Sorting This sort orders firstin XML based SEARCH requests (the element name itself is identified bylastits namespace nameof the author,(a URI reference) andthen by size, in descending order, so that for each author,thelargest workselement's local name). Note: this header field value is defined as a comma-separated list ([RFC2616], Section 4.2); thus, grammar URIs can appearfirst. <d:orderby xmlns:d='DAV:' xmlns:r='http://example.com/ns'> <d:order> <d:prop><r:lastname/></d:prop> <d:ascending/> </d:order> <d:order> <d:prop><d:getcontentlength/></d:prop> <d:descending/> </d:order> </d:orderby> 5.7. Boolean Operators: DAV:and, DAV:or,in multiple header instances, separated by commas, or both. For example: DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2>, <DAV:basicsearch> DASL: <http://example.com/foo/natural-language-query> 3.3. DAV:supported-query-grammar-set (Protected) This WebDAV property is required for any server supporting either [RFC3253] and/or [RFC3744] andDAV:not The DAV:and operator performs a logical AND operation onidentifies theexpressions it contains. The DAV:or operator performsXML-based query grammars that are supported by the search arbiter resource. <!ELEMENT supported-query-grammar-set (supported-query-grammar*)> <!ELEMENT supported-query-grammar (grammar)> <!ELEMENT grammar ANY> <!-- ANY value: alogical OR operationquery grammar element type --> Reschke, et al. Standards Track [Page 14] RFC 5323 WebDAV SEARCH November 2008 3.4. Example: Grammar Discovery This example shows that the server supports search on thevalues it contains. The DAV:not operator performs/somefolder resource with the query grammars: DAV:basicsearch, http://foobar.example/syntax1 and http://akuma.example/syntax2. Note that servers supporting WebDAV SEARCH MUST support DAV:basicsearch. >> Request: OPTIONS /somefolder HTTP/1.1 Host: example.org >> Response: HTTP/1.1 200 OK Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH DASL: <DAV:basicsearch> DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2> This example shows the equivalent taking advantage of alogical NOT operation on the valuesserver's support for DAV:supported-method-set and DAV:supported-query-grammar- set. >> Request: PROPFIND /somefolder HTTP/1.1 Host: example.org Depth: 0 Content-Type: text/xml; charset="utf-8" Content-Length: 165 <?xml version="1.0" encoding="UTF-8" ?> <propfind xmlns="DAV:"> <prop> <supported-query-grammar-set/> <supported-method-set/> </prop> </propfind> Reschke, et al.Expires March 3, 2009Standards Track [Page28] Internet-Draft15] RFC 5323 WebDAV SEARCHAugustNovember 2008it contains. 5.8. DAV:eq The DAV:eq operator provides simple equality matching on property values. The "caseless" attribute may be used with this element (Section 5.18). 5.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte 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 "caseless" attribute may be used with these elements (Section 5.18). 5.10. DAV:literal DAV:literal allows literal values to be placed in an expression. White space in literal values is significant in comparisons. For consistency with [RFC4918], clients SHOULD NOT specify the attribute "xml:space" (Section 2.10 of [XML]) to override this behavior. In comparisons,>> Response: HTTP/1.1 207 Multi-Status Content-Type: text/xml; charset="utf-8" Content-Length: 1349 <?xml version="1.0" encoding="utf-8" ?> <multistatus xmlns="DAV:"> <response> <href>http://example.org/somefolder</href> <propstat> <prop> <supported-query-grammar-set> <supported-query-grammar> <grammar><basicsearch/></grammar> </supported-query-grammar> <supported-query-grammar> <grammar><syntax1 xmlns="http://foobar.example/"/></grammar> </supported-query-grammar> <supported-query-grammar> <grammar><syntax2 xmlns="http://akuma.example/"/></grammar> </supported-query-grammar> </supported-query-grammar-set> <supported-method-set> <supported-method name="COPY" /> <supported-method name="DELETE" /> <supported-method name="GET" /> <supported-method name="HEAD" /> <supported-method name="LOCK" /> <supported-method name="MKCOL" /> <supported-method name="MOVE" /> <supported-method name="OPTIONS" /> <supported-method name="POST" /> <supported-method name="PROPFIND" /> <supported-method name="PROPPATCH" /> <supported-method name="PUT" /> <supported-method name="SEARCH" /> <supported-method name="TRACE" /> <supported-method name="UNLOCK" /> </supported-method-set> </prop> <status>HTTP/1.1 200 OK</status> </propstat> </response> </multistatus> Reschke, et al. Standards Track [Page 16] RFC 5323 WebDAV SEARCH November 2008 Note that thecontents of DAV:literal SHOULD be treatedquery grammar element names marshalled asstring, withpart of thefollowing exceptions: o when operand for a comparison with a DAV:getcontentlength property, it SHOULD be treated as an unsigned integer value (the behavior for values not in this format is undefined), o when operand for a comparison with a DAV:creationdate or DAV: getlastmodified property, it SHOULDDAV:supported-query-grammar-set can betreateddirectly used asa date valueelement names in an XML-based query. 4. Query Schema Discovery: QSD Servers MAY support theISO-8601 subset defined for the DAV:creationdate property (see [RFC4918], Section 15.1; the behaviordiscovery ofvalues not in this format is undefined), o when operandthe schema for acomparison with aquery grammar. The DASL response header and the DAV:supported-query-grammar-set property provide means forwhichclients to discover thetypeset of query grammars supported by a resource. This alone isknown and when compatible with that type, it MAY be treated according to this type. 5.11. DAV:typed-literal (optional) There are situations in whichnot sufficient information for a clientmay want to force a comparison nottobe string-based (as defined for DAV:literal). In these cases,generate atyped comparison can be enforced by using DAV:typed-literal instead. Reschke, et al. Expires March 3, 2009 [Page 29] Internet-Draft WebDAV SEARCH August 2008 <!ELEMENT typed-literal (#PCDATA)> The data type is specified using the xsi:type attribute defined in [XS1], Section 2.6.1. Ifquery. For example, thetype is not specified, it defaults to "xs:string". A server MUST rejectDAV: basicsearch grammar defines arequest with an unknown type withset of queries consisting of astatusset of422 (Unprocessable Entity). It SHOULD rejectoperators applied to arequest ifset of properties and values, but thevalue provided in DAV:typed-literal cangrammar itself does not specify which properties may becast toused in thespecified type. The comparison evaluates to UNKNOWN ifquery. QSD for theproperty value can not be castDAV:basicsearch grammar allows a client to discover thespecified datatype (see [XPATHFUNC], Section 17). 5.11.1. Example for Typed Numerical Comparison Consider aset ofresources with the dead property "edits" in the namespace "http://ns.example.org": +-----+----------------+ | URI | property value | +-----+----------------+ | /a | "-1" | | /b | "01" | | /c | "3" | | /d | "test" | | /e | (undefined) | +-----+----------------+ The expression <lt xmlns="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <prop><edits xmlns="http://ns.example.org"/></prop> <typed-literal xsi:type="xs:integer">3</typed-literal> </lt> will evaluate to TRUE for the resources "/a" and "/b" (their property values can be parsed as type xs:integer,properties that are searchable, selectable, and sortable. Moreover, although thenumerical comparison evaluates to true), to FALSE for "/c" (property value is compatible, but numerical comparison evaluates to false) and UNKNOWN for "/d" and "/e" (the property eitherDAV:basicsearch grammar defines a minimal set of operators, it isundefined, or its value can not be parsed as xs:integer). 5.12. Support for Matching xml:lang Attributes on Properties The following two optionalpossible that a resource might support additional operators in a query. For example, a resource might support an optional operator that can be used to expressconditions on the languagecontent-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 aproperty value (as expressed using Reschke, et al. Expires March 3, 2009 [Page 30] Internet-Draft WebDAV SEARCH August 2008 the xml:lang attribute). 5.12.1. DAV:language-defined (optional) <!ELEMENT language-defined (prop)> This operator evaluatesmeans for a client toTRUE ifdiscover what can be discovered. In general, thelanguageschema for a given query grammar depends on both thevalue ofresource (the arbiter) and the scope. A givenproperty is known, FALSE if it isn'tresource might have access to one set of properties for one potential scope, andUNKNOWN if the property itself is not defined. 5.12.2. DAV:language-matches (optional) <!ELEMENT language-matches (prop, literal)> This operator evaluatesanother set for a different scope. For example, consider a server able toTRUE ifsearch two distinct collections: one holding cooking recipes, thelanguageother design documents forthe value of the given property is knownnuclear weapons. While both collections might support properties such as author, title, andmatchesdate, thelanguage name given infirst might also define properties such as calories and preparation time, while the<literal> element, FALSE if it doesn't matchsecond defined properties such as yield andUNKNOWN ifapplicable patents. Two distinct arbiters indexing theproperty itself is not defined. Languages are consideredsame collection might also have access tomatch if they aredifferent properties. For example, thesame, or ifrecipe collection mentioned above might also be indexed by a value-added server that also stored thelanguagenames of chefs who had tested theproperty value is a sublanguagerecipe. Note also that the available query schema might also depend on other factors, such as the identity of thelanguage specifiedprincipal conducting the search, but these factors are not exposed in this protocol. 4.1. Additional SEARCH Semantics Each query grammar supported by DASL defines its own syntax for expressing the<literal> element (see [XPATH], Section 4.3, "lang function"). 5.12.3. Example of Language-Aware Matching The expression below will evaluate to TRUE ifpossible query schema. A client retrieves theproperty "foobar" exists and its language is either unknown, English or a sublanguage of English. <or xmlns="DAV:"> <not> <language-defined> <prop><foobar/></prop> </language-defined> </not> <language-matches> <prop><foobar/></prop> <literal>en</literal> </language-matches> </or> 5.13. DAV:is-collection The DAV:is-collection operator allows clients to determine whetherschema for a given query grammar on an arbiter resourceiswith acollection (that is, whether its DAV:resourcetype element contains the element DAV:collection).given scope Reschke, et al.Expires March 3, 2009Standards Track [Page31] Internet-Draft17] RFC 5323 WebDAV SEARCHAugustNovember 2008Rationale: 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. 5.13.1. Example of DAV:is-collection This example shows a search criterionby invoking the SEARCH method on thatpicks out allarbiter with that grammar andonly the resources in thescopethat are collections. <where xmlns="DAV:"> <is-collection/> </where> 5.14. DAV:is-defined The DAV:is-defined operator allows clients to determine whether a property is defined onand with aresource. The meaningroot element of"defined on a resource" is found in Section 5.5.3. Example: <d:is-defined xmlns:d='DAV:' xmlns:x='http://example.com/ns'> <d:prop><x:someprop/></d:prop> </d:is-defined> 5.15. DAV:like The DAV:like is an optional operator intended to give simple wildcard-based pattern matching ability to clients. The operator takes two arguments.DAV:query-schema-discovery rather than DAV:searchrequest. Marshalling: Thefirst argument isrequest body MUST be aDAV:propDAV:query-schema-discovery element. <!ELEMENT query-schema-discovery ANY> <!-- ANY value: XML elementidentifyingspecifying the query grammar and the scope --> The response body takes the form of asingle propertyDAV:multistatus element ([RFC4918], Section 13), where DAV:response is extended toevaluate.hold the returned query grammar inside a DAV:query-schema container element. <!ELEMENT response (href, status, query-schema?, responsedescription?) > <!ELEMENT query-schema ANY> Thesecond argumentcontent of this container isa DAV:literalan XML elementthat giveswhose name and syntax depend upon thepattern matching string.grammar, and whose value may (and likely will) vary depending upon the grammar, arbiter, and scope. 4.1.1. Example of Query Schema Discovery In this example, the arbiter is recipes.example, the grammar is DAV: basicsearch, the scope is also recipes.example. >> Request: SEARCH / HTTP/1.1 Host: recipes.example Content-Type: application/xml; charset="utf-8" Content-Length: 258 <?xml version="1.0"?> <query-schema-discovery xmlns="DAV:"> <basicsearch> <from> <scope> <href>http://recipes.example</href> <depth>infinity</depth> </scope> </from> </basicsearch> </query-schema-discovery> Reschke, et al.Expires March 3, 2009Standards Track [Page32] Internet-Draft18] RFC 5323 WebDAV SEARCHAugustNovember 20085.15.1. Syntax for the Literal Pattern pattern = [wildcard] 0*( text [wildcard] ) wildcard = exactlyone / zeroormore text = 1*( character / escapeseq ) exactlyone = "_" zeroormore = "%" escapechar = "\" escapeseq = escapechar ( exactlyone / zeroormore / escapechar ) ; character: see [XML], Section 2.2, minus wildcard / escapechar character = HTAB / LF / CR ; whitespace character =/ %x20-24 / %x26-5B / %x5D-5E / %x60-D7FF character =/ %xE000-FFFD / %x10000-10FFFF (Note that>> Response: HTTP/1.1 207 Multistatus Content-Type: application/xml; charset="utf-8" Content-Length: xxx <?xml version="1.0"?> <multistatus xmlns="DAV:"> <response> <href>http://recipes.example</href> <status>HTTP/1.1 200 OK</status> <query-schema> <basicsearchschema> <!-- (See Section 5.19 for theABNF aboveactual contents) --> </basicsearchschema> </query-schema> </response> </multistatus> The query schema for DAV:basicsearch is defined interms of Unicode code points ([UNICODE5]); whenSection 5.19. 5. The DAV:basicsearch Grammar 5.1. Introduction DAV:basicsearch uses anquery is transmitted asextensible XMLdocument WebDAV, these characterssyntax that allows clients to express search requests that aretypically encoded in UTF-8 or UTF-16.) The valuegenerally useful for WebDAV scenarios. DASL-extended servers MUST accept this grammar, and MAY accept other grammars. DAV:basicsearch has several components: o DAV:select provides theliteral is composed of wildcards separated by segmentsresult record definition. o DAV:from defines the scope. o DAV:where defines the criteria. o DAV:orderby defines the sort order oftext. Wildcards may begin or endtheliteral. The "_" wildcard matches exactly one character.result set. o DAV:limit provides constraints on the query as a whole. Reschke, et al. Standards Track [Page 19] RFC 5323 WebDAV SEARCH November 2008 5.2. The"%" wildcard matches zeroDAV:basicsearch DTD <!-- "basicsearch" element --> <!ELEMENT basicsearch (select, from, where?, orderby?, limit?) > <!-- "select" element --> <!ELEMENT select (allprop | prop) > <!-- "from" element --> <!ELEMENT from (scope+) > <!ELEMENT scope (href, depth, include-versions?) > <!ELEMENT include-versions EMPTY > <!-- "where" element --> Reschke, et al. Standards Track [Page 20] RFC 5323 WebDAV SEARCH November 2008 <!ENTITY % comp_ops "eq | lt | gt| lte | gte"> <!ENTITY % log_ops "and | or | not"> <!ENTITY % special_ops "is-collection | is-defined | language-defined | language-matches"> <!ENTITY % string_ops "like"> <!ENTITY % content_ops "contains"> <!ENTITY % all_ops "%comp_ops; | %log_ops; | %special_ops; | %string_ops; | %content_ops;"> <!ELEMENT where ( %all_ops; ) > <!ELEMENT and ( %all_ops; )+ > <!ELEMENT ormore characters The "\" character is an escape sequence so that the( %all_ops; )+ > <!ELEMENT not ( %all_ops; ) > <!ELEMENT lt (prop, (literal|typed-literal)) > <!ATTLIST lt caseless (yes|no) #IMPLIED> <!ELEMENT lte (prop, (literal|typed-literal)) > <!ATTLIST lte caseless (yes|no) #IMPLIED> <!ELEMENT gt (prop, (literal|typed-literal)) > <!ATTLIST gt caseless (yes|no) #IMPLIED> <!ELEMENT gte (prop, (literal|typed-literal)) > <!ATTLIST gte caseless (yes|no) #IMPLIED> <!ELEMENT eq (prop, (literal|typed-literal)) > <!ATTLIST eq caseless (yes|no) #IMPLIED> <!ELEMENT literalcan include "_" and "%". To include the "\" character in the pattern, the escape sequence "\\" is used. 5.15.2.(#PCDATA)> <!ELEMENT typed-literal (#PCDATA)> <!ATTLIST typed-literal xsi:type CDATA #IMPLIED> <!ELEMENT is-collection EMPTY > <!ELEMENT is-defined (prop) > <!ELEMENT language-defined (prop) > <!ELEMENT language-matches (prop, literal) > <!ELEMENT like (prop, literal) > <!ATTLIST like caseless (yes|no) #IMPLIED> <!ELEMENT contains (#PCDATA)> Reschke, et al. Standards Track [Page 21] RFC 5323 WebDAV SEARCH November 2008 <!-- "orderby" element --> <!ELEMENT orderby (order+) > <!ELEMENT order ((prop | score), (ascending | descending)?)> <!ATTLIST order caseless (yes|no) #IMPLIED> <!ELEMENT ascending EMPTY> <!ELEMENT descending EMPTY> <!-- "limit" element --> <!ELEMENT limit (nresults) > <!ELEMENT nresults (#PCDATA) > 5.2.1. Exampleof DAV:likeQuery Thisexample shows how a client might use DAV:like to identify those resources whosequery retrieves the contenttype was a subtype of image. <D:where xmlns:D='DAV:'> <D:like caseless="yes"> <D:prop><D:getcontenttype/></D:prop> <D:literal>image/%</D:literal> </D:like> </D:where> 5.16. DAV:contains The DAV:contains operator is an optional operator that provides content-based search capability. This operator implicitly searcheslength values for all resources located under the server's "/container1/" URI namespace whose length exceeds 10000 sorted ascending by size. <d:searchrequest xmlns:d="DAV:"> <d:basicsearch> <d:select> <d:prop><d:getcontentlength/></d:prop> </d:select> <d:from> <d:scope> <d:href>/container1/</d:href> <d:depth>infinity</d:depth> </d:scope> </d:from> <d:where> <d:gt> <d:prop><d:getcontentlength/></d:prop> <d:literal>10000</d:literal> </d:gt> </d:where> <d:orderby> <d:order> <d:prop><d:getcontentlength/></d:prop> <d:ascending/> </d:order> </d:orderby> </d:basicsearch> </d:searchrequest> Reschke, et al.Expires March 3, 2009Standards Track [Page33] Internet-Draft22] RFC 5323 WebDAV SEARCHAugustNovember 2008against5.3. DAV:select DAV:select defines thetext content ofresult record, which is aresource, not against contentset ofproperties. The DAV:contains operator is intentionally not overly constrained,properties and values. This document defines two possible values: DAV:allprop and DAV:prop, both defined inorder to allow the server to doSection 14 of [RFC4918]. 5.4. DAV:from <!ELEMENT scope (href, depth, include-versions?) > <!ELEMENT include-versions EMPTY > DAV:from defines thebest jobquery scope. This contains one or more DAV: scope elements. Support for multiple scope elements is optional, however servers MUST fail a request specifying multiple DAV:scope elements if they can't support itcan in performing the search.(see Section 2.2.2, precondition DAV:search-multiple-scope-supported). TheDAV:contains operator evaluatesscope element contains mandatory DAV:href and DAV:depth elements. DAV:href indicates the URI reference ([RFC3986], Section 4.1) to use as aBoolean value. It evaluates to TRUE ifscope. When thecontent ofscope is a collection, if DAV:depth is "0", theresource satisfiessearch includes only thesearch. Otherwise,collection. When itevaluates to FALSE. Withinis "1", theDAV:contains XML element,search includes theclient provides a phrase: a single word or whitespace delimited sequence of words. Servers MAY ignore punctuation incollection and its immediate children. When it is "infinity", it includes the collection and all its progeny. When the scope is not aphrase. Case-sensitivitycollection, the depth isatignored and thediscretion ofsearch applies just to the resource itself. If the serverimplementation. The following non-exhaustive list enumerate things that may or may not be done as part ofsupports WebDAV Redirect Reference Resources ([RFC4437]) and thesearch: 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. Thesearchmay 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 requiredscope contains a redirect reference resource, then it applies only tobe adjacent or "near" each other. Multiple words may or maythat resource, notbe requiredtooccur inits target. When thesame 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" tochild element DAV:include-versions is present, thestring operand. Character canonicalization such assearch scope will include all versions (see [RFC3253], Section 2.2.1) of all version-controlled resources in scope. Servers thatdone by the Unicode collation algorithm may or maydo support versioning but do notbe applied. 5.16.1. Result Scoring (DAV:score Element) Servers SHOULD indicate scores forsupport theDAV:contains condition by addingDAV:include-versions feature MUST signal an error if it is used in aDAV:score XMLquery (see Section 2.2.2, precondition DAV:search-scope-valid). 5.4.1. Relationship to the Request-URI If the DAV:scope elementtois a URI ([RFC3986], Section 3), theDAV:response element. Its valuescope isdefined only inexactly that URI. If thecontext of a particular query result. The valueDAV:scope element is astring representingrelative reference ([RFC3986], Section 4.2), thescore, an integer from zero to 10000 inclusive, where a higher value indicates a higher score (e.g. more relevant). Modified DTD fragment for DAV:propstat: <!ELEMENT response (href, ((href*, status)|(propstat+)), responsedescription?, score?) > <!ELEMENT score (#PCDATA) > Clients should note that, in general, itscope isnot meaningfultaken to be relative tocompare the numeric values of scores from two different query results unless both were executed by the same underlying search system onthesame collection of resources.Request-URI. Reschke, et al.Expires March 3, 2009Standards Track [Page34] Internet-Draft23] RFC 5323 WebDAV SEARCHAugustNovember 20085.16.2. Ordering by Score To order search results by their score, the DAV:score element may5.4.2. Scope A Scope can beadded as child to the DAV:orderby element (in placean arbitrary URI reference. Servers, ofa DAV:prop element). 5.16.3. Examples The example below shows a search for the phrase "Peter Forsberg". Depending on itscourse, may supportfor content-based searching, a server MAY treat this as a search for documents that contain the words "Peter" and "Forsberg". <D:where xmlns:D='DAV:'> <D:contains>Peter Forsberg</D:contains> </D:where> The example below shows a search for resources that contain "Peter" and "Forsberg". <D:where xmlns:D='DAV:'> <D:and> <D:contains>Peter</D:contains> <D:contains>Forsberg</D:contains> </D:and> </D:where> 5.17. Limiting the Result Set <!ELEMENT limit (nresults) > <!ELEMENT nresults (#PCDATA)> <!--onlydigits --> The DAV:limit XML element contains requested limits from the client to limit the size of the replyparticular scopes. This may include limitations for particular schemes such as "http:" oramount of effort expended by the server."ftp:" or certain URI namespaces. However, WebDAV-compliant search arbiters minimally SHOULD support scopes that match their own URI. 5.5. DAV:where TheDAV:nresults XMLDAV:where elementcontains a requested maximum numberdefines the search condition for inclusion ofDAV:response elements to be returnedresources in theresponse body. The server MAY disregard this limit.result set. The value of this element is anunsigned integer. 5.17.1. RelationshipXML element that defines a search operator that evaluates toResult Ordering Ifone of theresult set is both limitedBoolean truth values TRUE, FALSE, or UNKNOWN. The search operator contained byDAV:limitDAV:where may itself contain andordered according to DAV:orderby, the results that are includedevaluate additional search operators as operands, which in turn may contain and evaluate additional search operators as operands, etc., recursively. 5.5.1. Use of Three-Valued Logic in Queries Each operator defined for use in theresponse document SHOULD be thosewhere clause thatorder highest. Reschke, et al. Expires March 3, 2009 [Page 35] Internet-Draft WebDAV SEARCH August 2008 5.18. The 'caseless' XML Attribute The "caseless" attribute allows clientsreturns a Boolean value MUST evaluate tospecify caseless matching behavior instead of character-by-character matching for DAV: basicsearch operators. The possible values for "caseless" are "yes"TRUE, FALSE, or"no".UNKNOWN. Thedefault valueresource under scan isserver-specified. Caseless matching SHOULD be implementedincluded asdefined in Section 5.18a member of the result set if and only if the search condition evaluates to TRUE. Consult Appendix A for details on the application of three-valued logic in query expressions. 5.5.2. Handling Optional Operators If a query contains an operator that is not supported by theUnicode Standard ([UNICODE5]). Support forserver, then the"caseless" attribute is optional. AservershouldMUST respond with a 422 (Unprocessable Entity) status code. 5.5.3. Treatment of422 if it is used but cannot be supported. 5.19. Query Schema for DAV:basicsearch The DAV:basicsearch grammar defines a search criteria that isNULL Values If aBoolean-valued expression, and allowsPROPFIND foran arbitrary set of properties to be included in the result record. The result set may be sorted onasetproperty value would yield a non-2xx (see Section 10.2 of [RFC2616]) response for that property, then that property is considered NULL. NULL values are "less than" all other values in comparisons. Empty strings (zero length strings) are not NULL values.Accordingly the DTD for schema discovery for this grammar allows the serverAn empty string is "less than" a string with length greater than zero. The DAV:is-defined operator is defined toexpress: 1.test if thesetvalue ofproperties that may be either searched, returned, or used to sort, andahint about the data typeproperty is not NULL. Reschke, et al. Standards Track [Page 24] RFC 5323 WebDAV SEARCH November 2008 5.5.4. Treatment ofsuch properties 2. the setProperties with Mixed/Element Content Comparisons ofoptional operators defined by the resource. 5.19.1. DTD for DAV:basicsearch QSD <!ELEMENT basicsearchschema (properties, operators)> <!ELEMENT any-other-property EMPTY> <!ELEMENTproperties(propdesc*)> <!ELEMENT propdesc ((prop|any-other-property), datatype?, searchable?, selectable?, sortable?, caseless?)> <!ELEMENT operators (opdesc*)> <!ELEMENT opdesc ANY> <!ATTLIST opdesc allow-pcdata (yes|no) #IMPLIED> <!ELEMENT operand-literal EMPTY> <!ELEMENT operand-typed-literal EMPTY> <!ELEMENT operand-property EMPTY> The DAV:properties element holds a list of descriptionsthat do not have simple types (text-only content) is out ofproperties. The DAV:operators element describesscope for theoptionalstandard operatorsthat maydefined for DAV: basicsearch and therefore is defined to beusedUNKNOWN (as per Appendix A). For querying the DAV:resourcetype property, see Section 5.13. 5.5.5. Example: Testing for Equality The example shows a single operator (DAV:eq) applied in the criteria. <d:where xmlns:d='DAV:'> <d:eq> <d:prop> <d:getcontentlength/> </d:prop> <d:literal>100</d:literal> </d:eq> </d:where> 5.5.6. Example: Relative Comparisons The example shows a more complex operation involving several operators (DAV:and, DAV:eq, DAV:gt) applied in the criteria. This DAV:whereelement.expression matches those resources of type "image/gif" over 4K in size. <D:where xmlns:D='DAV:'> <D:and> <D:eq> <D:prop> <D:getcontenttype/> </D:prop> <D:literal>image/gif</D:literal> </D:eq> <D:gt> <D:prop> <D:getcontentlength/> </D:prop> <D:literal>4096</D:literal> </D:gt> </D:and> </D:where> Reschke, et al.Expires March 3, 2009Standards Track [Page36] Internet-Draft25] RFC 5323 WebDAV SEARCHAugustNovember 20085.19.2. DAV:propdesc Element 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. DASL defines five descriptions.5.6. DAV:orderby Thefirst, DAV:datatype, provides a hint aboutDAV:orderby element specifies thetypeordering of theproperty value, and may be useful to a user interface prompting for a value. The remaining four (DAV: searchable, DAV:selectable, DAV:sortable, and DAV:caseless) identify portionsresult set. It contains one or more DAV:order elements, each ofthe query (DAV:where, DAV:select, and DAV:orderby, respectively). If a property has a description forwhich specifies asection, then the server MUST allow the property to be usedcomparison between two items in the result set. Informally, a comparison specifies a test thatsection. These descriptionsdetermines whether one resource appears before another in the result set. Comparisons areoptional. Ifapplied in the order they occur in the DAV:orderby element, earlier comparisons being more significant. The comparisons defined here use only a single propertydoes not have such a description,from each resource, compared using the same ordering as the DAV:lt operator (ascending) or DAV:gt operator (descending). If neither direction isnot described at all, then the server MAY still allowspecified, theproperty to be used indefault is DAV:ascending. In thecorresponding section. 5.19.2.1. DAV:any-other-property This element can be used in placecontext ofDAV:propthe DAV:orderby element, null values are considered todescribe properties of WebDAV properties not mentioned incollate before anyother DAV:prop element. For instance, this canactual (i.e., non-null) value, including strings of zero length (this is compatible with [SQL99]). The "caseless" attribute may be used to indicatethat all other properties are searchable and selectable without giving details about their types (a typical scenariocase-sensitivity fordead properties). 5.19.3. The DAV:datatype Property Description The DAV:datatype element contains a single XML element that provides a hint about the domaincomparisons (Section 5.18). 5.6.1. Example of Sorting This sort orders first by last name of theproperty, which may be useful to a user interface prompting for a value to be usedauthor and then by size, in descending order, so that for each author, the largest works appear first. <d:orderby xmlns:d='DAV:' xmlns:r='http://example.com/ns'> <d:order> <d:prop><r:lastname/></d:prop> <d:ascending/> </d:order> <d:order> <d:prop><d:getcontentlength/></d:prop> <d:descending/> </d:order> </d:orderby> 5.7. Boolean Operators: DAV:and, DAV:or, and DAV:not The DAV:and operator performs aquery. Data types are identified by an element name. Where appropriate,logical AND operation on the expressions it contains. The DAV:or operator performs aserver SHOULD uselogical OR operation on thesimple data types defined in [XS2]. <!ELEMENT datatype ANY > Examples from [XS2], Section 3: +----------------+---------------------+ | Qualified name | Example | +----------------+---------------------+ | xs:boolean | true, false, 1, 0 | | xs:string | Foobar | | xs:dateTime | 1994-11-05T08:15:5Z | | xs:float | .314159265358979E+1 |values it contains. Reschke, et al.Expires March 3, 2009Standards Track [Page37] Internet-Draft26] RFC 5323 WebDAV SEARCHAugustNovember 2008| xs:integer | -259, 23 | +----------------+---------------------+ If the data type ofThe DAV:not operator performs aproperty is not given, thenlogical NOT operation on thedata type defaults to xs:string. 5.19.4.values it contains. 5.8. DAV:eq TheDAV:searchable Property Description <!ELEMENT searchable EMPTY> IfDAV:eq operator provides simple equality matching on property values. The "caseless" attribute may be used with this elementis present, then the server MUST allow this(Section 5.18). 5.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte 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 "caseless" attribute may be used with these elements (Section 5.18). 5.10. DAV:literal DAV:literal allows literal values toappear within a DAV:where element wherebe placed in anoperator allowsexpression. White space in literal values is significant in comparisons. For consistency with [RFC4918], clients SHOULD NOT specify the attribute "xml:space" (Section 2.10 of [XML]) to override this behavior. In comparisons, the contents of DAV:literal SHOULD be treated as string, with the following exceptions: o when operand for aproperty. Allowingcomparison with asearch doesDAV:getcontentlength property, it SHOULD be treated as an unsigned integer value (the behavior for values notmean that the propertyin this format isguaranteed toundefined), o when operand for a comparison with a DAV:creationdate or DAV: getlastmodified property, it SHOULD bedefined on every resourcetreated as a date value in thescope, it only indicates the server's willingness to check. 5.19.5. The DAV:selectable Property Description <!ELEMENT selectable EMPTY> This element indicates thatISO-8601 subset defined for the DAV:creationdate propertymay appear in the DAV:select element. 5.19.6. The DAV:sortable Property Description This element indicates that(see Section 15.1 of [RFC4918]; theproperty may appearbehavior of values not inthe DAV: orderby element. <!ELEMENT sortable EMPTY> 5.19.7. The DAV:caseless Property Description This element only applies to properties whose data typethis format is"xs: string" and derived data types as per the DAV:datatype property description. Its presence indicates that compares performedundefined), o when operand forsearches, and the comparisonsa comparison with a property forordering results onwhich thestring property will be caseless (the defaulttype ischaracter-by-character). <!ELEMENT caseless EMPTY> 5.19.8. The DAV:operators XML Element The DAV:operators element describes every optional operator supported in a query. (Mandatory operators are not listed since they are mandatoryknown andpermit no variation in syntax.). All optional operatorswhen compatible with thatare supported MUSTtype, it MAY belisted in the DAV:operators element.treated according to this type. Reschke, et al.Expires March 3, 2009Standards Track [Page38] Internet-Draft27] RFC 5323 WebDAV SEARCHAugustNovember 2008The listing for an operator, contained5.11. DAV:typed-literal (Optional) There are situations inan DAV:opdesc element, consists of the operatorwhich a client may want to force a comparison not to be string-based (asan empty element), followed by one elementdefined foreach operand. The operand MUSTDAV:literal). In these cases, a typed comparison can beeither DAV:operand- property, DAV:operand-literal or DAV:operand-typed-literal, which indicate thatenforced by using DAV:typed-literal instead. <!ELEMENT typed-literal (#PCDATA)> The data type is specified using theoperandxsi:type attribute defined in Section 2.6.1 of [XS1]. If thecorresponding positiontype is not specified, it defaults to "xs:string". A server MUST reject aproperty,request using an unknown type with aliteral value orstatus of 422 (Unprocessable Entity). It SHOULD reject atyped literal value, respectively. If an operator is polymorphic (allows more than one operand syntax) then each permitted syntax MUSTrequest if the value provided in DAV:typed-literal cannot belisted separately.cast to the specified type. TheDAV:opdesc element MAY have a "allow-pcdata" attribute (defaultingcomparison evaluates to"no"). A value of "yes" indicates thatUNKNOWN if theoperator can contain character data, as it isproperty value cannot be cast to thecase with DAV:containsspecified datatype (see [XPATHFUNC], Section5.16). Definition17). 5.11.1. Example for Typed Numerical Comparison Consider a set ofadditional operators using this formatresources with the dead property "edits" in the namespace "http://ns.example.org": +-----+----------------+ | URI | property value | +-----+----------------+ | /a | "-1" | | /b | "01" | | /c | "3" | | /d | "test" | | /e | (undefined) | +-----+----------------+ The expression <lt xmlns="DAV:" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <prop><edits xmlns="http://ns.example.org"/></prop> <typed-literal xsi:type="xs:integer">3</typed-literal> </lt> will evaluate to TRUE for the resources "/a" and "/b" (their property values can be parsed as type xs:integer, and the numerical comparison evaluates to true), to FALSE for "/c" (property value isNOT RECOMMENDED. <operators xmlns='DAV:'> <opdesc> <like/><operand-property/><operand-literal/> </opdesc> </operators>compatible, but numerical comparison evaluates to false), and UNKNOWN for "/d" Reschke, et al.Expires March 3, 2009Standards Track [Page39] Internet-Draft28] RFC 5323 WebDAV SEARCHAugustNovember 20085.19.9. Example of Query Schemaand "/e" (the property either is undefined, or its value cannot be parsed as xs:integer). 5.12. Support forDAV:basicsearch <D:basicsearchschema xmlns:D="DAV:" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <D:properties> <D:propdesc> <D:prop><D:getcontentlength/></D:prop> <D:datatype><xs:nonNegativeInteger/></D:datatype> <D:searchable/><D:selectable/><D:sortable/> </D:propdesc> <D:propdesc> <D:prop><D:getcontenttype/><D:displayname/></D:prop> <D:searchable/><D:selectable/><D:sortable/> </D:propdesc> <D:propdesc> <D:prop><fstop xmlns="http://ns.example.org"/></D:prop> <D:selectable/> </D:propdesc> <D:propdesc> <D:any-other-property/> <D:searchable/><D:selectable/> </D:propdesc> </D:properties> <D:operators> <D:opdesc> <D:like/><D:operand-property/><D:operand-literal/> </D:opdesc> <D:opdesc allow-pcdata="yes"> <D:contains/> </D:opdesc> </D:operators> </D:basicsearchschema> This response lists four properties.Matching xml:lang Attributes on Properties Thedata typefollowing two optional operators can be used to express conditions on the language of a property value (as expressed using the xml:lang attribute). 5.12.1. DAV:language-defined (Optional) <!ELEMENT language-defined (prop)> This operator evaluates to TRUE if the language for the value of thelast three propertiesgiven property isnot given, soknown, FALSE if itdefaults to xs:string. All are selectable,isn't, and UNKNOWN if thefirst three may be searched. All butproperty itself is not defined. 5.12.2. DAV:language-matches (Optional) <!ELEMENT language-matches (prop, literal)> This operator evaluates to TRUE if thelast may be usedlanguage for the value of the given property is known and matches the language name given ina sort. Oftheoptional DAV operators, DAV:contains<literal> element, FALSE if it doesn't match, andDAV:like are supported. Note: The schema discovery defined here doesUNKNOWN if the property itself is notprovide for discovery of supported values ofdefined. Languages are considered to match if they are the"caseless" attribute. This may require thatsame, or if thereply also listlanguage of themandatory operators. 6. Internationalization Considerations Properties may be language-tagged usingproperty value is a sublanguage of thexml:lang attributelanguage specified in the <literal> element (see[RFC4918],Section4.3).4.3 of [XPATH], "lang function"). 5.12.3. Example of Language-Aware Matching Theoptional operators DAV:language-definedexpression below will evaluate to TRUE if the property "foobar" exists and its language is either unknown, English, or a sublanguage of English. <or xmlns="DAV:"> <not> <language-defined> <prop><foobar/></prop> </language-defined> </not> <language-matches> <prop><foobar/></prop> <literal>en</literal> </language-matches> </or> Reschke, et al.Expires March 3, 2009Standards Track [Page40] Internet-Draft29] RFC 5323 WebDAV SEARCHAugustNovember 2008(Section 5.12.1) and DAV:language-matches (Section 5.12.2) allow5.13. DAV:is-collection The DAV:is-collection operator allows clients toexpress conditions ondetermine whether a resource is a collection (that is, whether its DAV:resourcetype element contains thelanguage tagging information. 7. Security Considerationselement DAV:collection). Rationale: Thissectionoperator is providedto detail issues concerning security implicationsin lieu of defining generic structure queries, whichDASL applications need to be aware. All of the security considerations of HTTP/1.1 ([RFC2616]would suffice for this andWebDAV ([RFC4918]) also applyfor many more powerful queries, but seems inappropriate toDASL. In addition,standardize at thissection will include security risks inherent in searching and retrievaltime. 5.13.1. Example ofresource properties and content. A query MUST NOT allow clients to retrieve informationDAV:is-collection This example shows a search criterion thatwouldn't have been available throughpicks out all, and only, theGET or PROPFIND methodsresources in thefirst place. In particular: o Query constraints on WebDAV properties for which the client does not have read access needscope that are collections. <where xmlns="DAV:"> <is-collection/> </where> 5.14. DAV:is-defined The DAV:is-defined operator allows clients tobe evaluated as if thedetermine whether a propertydid not exist (see Section 5.5.3). o Query constraints on content (as with DAV:contains,is defined on a resource. The meaning of "defined on a resource" is found in Section5.16) for which the client does not have read access need5.5.3. Example: <d:is-defined xmlns:d='DAV:' xmlns:x='http://example.com/ns'> <d:prop><x:someprop/></d:prop> </d:is-defined> 5.15. DAV:like The DAV:like is an optional operator intended tobe evaluated as if a GET would returngive simple wildcard-based pattern matching ability to clients. The operator takes two arguments. The first argument is a4xx status code. A server should prepare for denial of service attacks. For exampleDAV:prop element identifying aclient may issuesingle property to evaluate. The second argument is aqueryDAV:literal element that gives the pattern matching string. Reschke, et al. Standards Track [Page 30] RFC 5323 WebDAV SEARCH November 2008 5.15.1. Syntax forwhichtheresult setLiteral Pattern pattern = [wildcard] 0*( text [wildcard] ) wildcard = exactlyone / zeroormore text = 1*( character / escapeseq ) exactlyone = "_" zeroormore = "%" escapechar = "\" escapeseq = escapechar ( exactlyone / zeroormore / escapechar ) ; character: see [XML], Section 2.2, minus wildcard / escapechar character = HTAB / LF / CR ; whitespace character =/ %x20-24 / %x26-5B / %x5D-5E / %x60-D7FF character =/ %xE000-FFFD / %x10000-10FFFF (Note that the ABNF above isexpensive to calculate or transmit because many resources match or must be evaluated. 7.1. Implications of XML External Entities XML supports a facility known as "external entities",defined inSection 4.2.2terms of[XML], which instructUnicode code points ([UNICODE5]); when a query is transmitted as an XMLprocessor to retrieve and perform an inline includedocument over WebDAV, these characters are typically encoded in UTF-8 or UTF-16.) The value for the literal is composed ofXML located at a particular URI. An external XML entity can be used to appendwildcards separated by segments of text. Wildcards may begin ormodifyend thedocument type declaration (DTD) associated withliteral. The "_" wildcard matches exactly one character. The "%" wildcard matches zero or more characters. The "\" character is anXML document. An external XML entityescape sequence so that the literal canalso be used toincludeXML within the content of an XML document. For non-validating XML, such as"_" and "%". To include theXML used"\" character inthis specification, including an external XML entity is not required by [XML]. However, [XML] does state that an XML processor may, at its discretion, includetheexternal XML entity. External XML entities have no inherent trustworthiness and are subject to allpattern, theattacks that are endemic to any HTTP GET request. Furthermore, itescape sequence "\\" ispossible for an external XML entityused. 5.15.2. Example of DAV:like This example shows how a client might use DAV:like tomodify the DTD, and hence affect the final formidentify those resources whose content type was a subtype of image. <D:where xmlns:D='DAV:'> <D:like caseless="yes"> <D:prop><D:getcontenttype/></D:prop> <D:literal>image/%</D:literal> </D:like> </D:where> 5.16. DAV:contains The DAV:contains operator is anXML document, in the worst case significantly modifying its semantics, or exposing the XMLoptional operator that provides content-based search capability. This operator implicitly searches Reschke, et al.Expires March 3, 2009Standards Track [Page41] Internet-Draft31] RFC 5323 WebDAV SEARCHAugustNovember 2008processoragainst the text content of a resource, not against the content of properties. The DAV:contains operator is intentionally not overly constrained, in order to allow thesecurity risks discussedserver to do the best job it can in[RFC3023]. Therefore, implementers must be aware that external XML entities should be treated as untrustworthy. There is alsoperforming thescalability risk that would accompanysearch. The DAV:contains operator evaluates to awidely deployed application which made useBoolean value. It evaluates to TRUE if the content ofexternal XML entities. In this situation,the resource satisfies the search. Otherwise, it evaluates to FALSE. 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 ispossibleat the discretion of the server implementation. The following non-exhaustive list enumerates things thatthere wouldmay or may not besignificant numbersdone as part ofrequests for one external XML entity, potentially overloading any server which fields requests for the resource containingtheexternal XML entity. 8. Scalability Query grammars are identified by URIs. Applications SHOULD NOT attempt to retrieve these URIs even if they appear tosearch: 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 beretrievable (for example, those that begin with "http://") 9. IANA Considerations This document uses the namespace defined in Section 21 of [RFC4918] for XML elements. 9.1. HTTP Headers This document specifies the HTTP header listed below,interpreted as names. Multiple words may or may not be required to beaddedadjacent or "near" each other. Multiple words may or may not be required tothe permanent HTTP header registry definedoccur in[RFC3864]. 9.1.1. DASL Header field name: DASL Applicable protocol: http Status: standard Author/Change controller: IETF Specification document: this specification (Section 3.2) 10. Contributors This document is based on prior work on the DASL protocol done by the WebDAV DASL working group untiltheyear 2000 -- namely by Alan Babich, Jim Davis, Rick Henderson, Dale Lowry, Saveen Reddy and Surendra Reddy. Reschke, et al. Expires March 3, 2009 [Page 42] Internet-Draft WebDAV SEARCH August 2008 11. Acknowledgements This document has benefited from thoughtful discussion by Lisa Dusseault, Javier Godoy, Sung Kim, Chris Newman, Elias Sinderson, Martin Wallmer, Keith Wannamaker, Jim Whitehead and Kevin Wiggen. 12. References 12.1. Normative References [RFC2119] Bradner, S., "Keysame order. Multiple wordsfor use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. [RFC2616] Fielding, R., Gettys, J., Mogul, J., Nielsen, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. [RFC3023] Makoto, M., St.Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001. [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J. Whitehead, "Versioning Extensionsmay or may not be treated as a phrase. The search may or may not be interpreted as a request toWebDAV", RFC 3253, March 2002. [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol", RFC 3744, May 2004. [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. [RFC4918] Dusseault, L., Ed., "HTTP Extensionsfind documents "similar" to the string operand. Character canonicalization such as that done by the Unicode collation algorithm may or may not be applied. 5.16.1. Result Scoring (DAV:score Element) Servers SHOULD indicate scores forWeb Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007. [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNFthe DAV:contains condition by adding a DAV:score XML element to the DAV:response element. Its 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). Modified DTD fragment forSyntax Specifications: ABNF", STD 68, RFC 5234, January 2008. [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C REC-xml-20060816, August 2006, <http://www.w3.org/TR/2006/REC-xml-20060816>. [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", W3C REC-xpath-19991116, November 1999, <http://www.w3.org/TR/1999/REC-xpath-19991116>.DAV:propstat: <!ELEMENT response (href, ((href*, status)|(propstat+)), responsedescription?, score?) > <!ELEMENT score (#PCDATA) > 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. Reschke, et al.Expires March 3, 2009Standards Track [Page43] Internet-Draft32] RFC 5323 WebDAV SEARCHAugustNovember 2008[XPATHFUNC] Malhotra, A., Melton, J., and N. Walsh, "XQuery 1.05.16.2. Ordering by Score 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). 5.16.3. Examples The example below shows a search for the phrase "Peter Forsberg". Depending on its support for content-based searching, a server MAY treat this as a search for documents that contain the words "Peter" andXPath 2.0 Functions"Forsberg". <D:where xmlns:D='DAV:'> <D:contains>Peter Forsberg</D:contains> </D:where> The example below shows a search for resources that contain "Peter" andOperators", W3C REC-xpath- functions-20070123, January 2007, <http://www.w3.org/TR/2007/REC-xpath-functions-20070123/>. [XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N.,"Forsberg". <D:where xmlns:D='DAV:'> <D:and> <D:contains>Peter</D:contains> <D:contains>Forsberg</D:contains> </D:and> </D:where> 5.17. Limiting the Result Set <!ELEMENT limit (nresults) > <!ELEMENT nresults (#PCDATA)> <!-- only digits --> 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 unsigned integer. 5.17.1. Relationship to Result Ordering If the result set is both limited by DAV:limit andWorld Wide Web Consortium, "XMLordered according to DAV:orderby, the results that are included in the response document SHOULD be those that order highest. Reschke, et al. Standards Track [Page 33] RFC 5323 WebDAV SEARCH November 2008 5.18. The 'caseless' XML Attribute The "caseless" attribute allows clients to specify caseless matching behavior instead of character-by-character matching for DAV: basicsearch operators. The possible values for "caseless" are "yes" or "no". The default value is server-specified. Caseless matching SHOULD be implemented as defined in Section 5.18 of the Unicode Standard ([UNICODE5]). Support for the "caseless" attribute is optional. A server should respond with a status of 422 if it is used but cannot be supported. 5.19. Query SchemaPart 1: Structures", W3C REC-xmlschema-1-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>. [XS2] Biron, P., Malhotra, A.,for DAV:basicsearch The DAV:basicsearch grammar defines a search criteria that is a Boolean-valued expression, andWorld Wide Web Consortium, "XML Schema Part 2: Datatypes Second Edition", W3C REC- xmlschema-2-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>. 12.2. Informative References [BCP47] Phillips, A.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: 1. the set of properties that may be either searched, returned, or used to sort, andM. Davis, "Matchinga hint about the data type of such properties. 2. the set of optional operators defined by the resource. 5.19.1. DTD for DAV:basicsearch QSD <!ELEMENT basicsearchschema (properties, operators)> <!ELEMENT any-other-property EMPTY> <!ELEMENT properties (propdesc*)> <!ELEMENT propdesc ((prop|any-other-property), datatype?, searchable?, selectable?, sortable?, caseless?)> <!ELEMENT operators (opdesc*)> <!ELEMENT opdesc ANY> <!ATTLIST opdesc allow-pcdata (yes|no) #IMPLIED> <!ELEMENT operand-literal EMPTY> <!ELEMENT operand-typed-literal EMPTY> <!ELEMENT operand-property EMPTY> The DAV:properties element holds a list ofLanguage Tags", BCP 47,descriptions of properties. The DAV:operators element describes the optional operators that may be used in a DAV:where element. Reschke, et al. Standards Track [Page 34] RFC4647, September 2006. [DASL] Reddy, S., Lowry, D., Reddy, S., Henderson, R., Davis, J.,5323 WebDAV SEARCH November 2008 5.19.2. DAV:propdesc Element 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 andA. Babich, "DAV Searching & Locating", draft-ietf-dasl-protocol-00 (workmay appear inprogress), July 1999. [DASLREQ] Davis, J., Reddy, S.,any order. Servers SHOULD support all the descriptions defined here, andJ. Slein, "RequirementsMAY define others. 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 forDAV Searchinga value. The remaining four (DAV: searchable, DAV:selectable, DAV:sortable, andLocating", February 1999, <http:// www.webdav.org/dasl/requirements/ draft-dasl-requirements-01.html>. ThisDAV:caseless) 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 isan updated versionnot described at all, then the server MAY still allow the property to be used in the corresponding section. 5.19.2.1. DAV:any-other-property 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). 5.19.3. The DAV:datatype Property Description The DAV:datatype element contains a single XML element that provides a hint about the domain of theInternet Draft "draft-ietf-dasl-requirements-00", but obviously never was submittedproperty, which may be useful tothe IETF. [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration Proceduresa user interface prompting forMessage Header Fields", BCP 90, RFC 3864, September 2004. [RFC4437] Whitehead, J., Clemm, G., and J. Reschke, Ed., "Web Distributed Authoring and Versioning (WebDAV) Redirect Reference Resources", RFC 4437, March 2006. [RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet Application Protocol Collation Registry", RFC 4790, March 2007. [SQL99] Milton, J., "Database Language SQL Part 2: Foundation (SQL/Foundation)", ISO ISO/IEC 9075-2:1999 (E), July 1999.a value to be used in a query. Data types are identified by an element name. Where appropriate, a server SHOULD use the simple data types defined in [XS2]. <!ELEMENT datatype ANY > Reschke, et al.Expires March 3, 2009Standards Track [Page44] Internet-Draft35] RFC 5323 WebDAV SEARCHAugust 2008 [UNICODE5] The Unicode Consortium, "The Unicode Standard - Version 5.0", Addison-Wesley , November 2006, <http://www.unicode.org/versions/Unicode5.0.0/>. ISBN 0321480910 [1] [draft-ietf-webdav-bind] Clemm, G., Crawford, J., Reschke, J., Ed., and J. Whitehead, "Binding Extensions to Web Distributed Authoring and Versioning (WebDAV)", draft-ietf-webdav-bind-20 (work in progress),November2007. URIs [1] <urn:isbn:0321480910> Appendix A. Three-Valued Logic in DAV:basicsearch 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.). ANSI standard three valued logic is undoubtedly2008 Examples from [XS2], Section 3: +----------------+---------------------+ | 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 | +----------------+---------------------+ If themost widely practiced methoddata type ofdealing witha property is not given, then theissues of properties indata type defaults to xs:string. 5.19.4. The DAV:searchable Property Description <!ELEMENT searchable EMPTY> If this element is present, then thesearch condition not havingserver MUST allow this property to appear within avalue (e.g., being null orDAV:where element where an operator allows a property. Allowing a search does notdefined) formean that the property is guaranteed to be defined on every resourceunder scan, and with undefined expressionsin thesearch condition (e.g., division by zero, etc.). Three valued logic works as follows. Undefined expressions are expressions for which the value ofscope, it only indicates theexpression is not defined. Undefined expressions are a completely separate concept fromserver's willingness to check. 5.19.5. The DAV:selectable Property Description <!ELEMENT selectable EMPTY> This element indicates that thetruth value UNKNOWN, which is,property may appear infact, well defined.the DAV:select element. 5.19.6. The DAV:sortable Propertynames and literal constants are considered expressions for purposes of this section. If aDescription This element indicates that the property may appear in thecurrent resource under scan has not been setDAV: orderby element. <!ELEMENT sortable EMPTY> 5.19.7. The DAV:caseless Property Description This element only applies toa value, then the value of thatproperties whose data type is "xs: string" and derived data types as per the DAV:datatype propertyis undefineddescription. Its presence indicates that comparisons performed for searches, and theresource under scan. DASL 1.0 has no arithmetic division operator, but if it did, division by zero would be an undefined arithmetic expression. If any subpart of an arithmetic, string, or datetime subexpression is undefined,comparisons for ordering results on thewhole arithmetic, string, or datetime subexpressionstring property will be caseless (the default isundefined. There are no manifest constants to explicitly represent undefinedcharacter by character). <!ELEMENT caseless EMPTY> Reschke, et al.Expires March 3, 2009Standards Track [Page45] Internet-Draft36] RFC 5323 WebDAV SEARCHAugustNovember 2008number, string, or datetime values. 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.5.19.8. TheBooleanDAV:operators XML Element The DAV:operators element describes every optional operator supported in a query. (Mandatory operatorsDAV:and, DAV:or and DAV:notareevaluated according to the following rules:notUNKNOWN = UNKNOWN UNKNOWN and TRUE = UNKNOWN UNKNOWN and FALSE = FALSE UNKNOWNlisted since they are mandatory andUNKNOWN = UNKNOWN UNKNOWN or TRUE = TRUE UNKNOWN or FALSE = UNKNOWN UNKNOWN or UNKNOWN = UNKNOWN Appendix B. Candidates for Future Protocol Extensions This Section summarizes issues which have been raised duringpermit no variation in syntax.) All optional operators that are supported MUST be listed in thedevelopmentDAV:operators element. The listing for an operator, contained in an DAV:opdesc element, consists ofthis specification, butthe operator (as an empty element), followed by one element forwhich no resolution couldeach operand. The operand MUST befound witheither DAV:operand- property, DAV:operand-literal, or DAV:operand-typed-literal, which indicate that theconstraintsoperand inplace. Future revisions of this specification should revisit these issues, though. B.1. Collation Support Matching and sorting of textual data relies on collations. With respect to WebDAV SEARCH,the corresponding position is acombination of various design approaches couldproperty, a literal value, or a typed literal value, respectively. If an operator is polymorphic (allows more than one operand syntax) then each permitted syntax MUST beused: o Require server support for specific collations. o Requirelisted separately. The DAV:opdesc element MAY have a "allow-pcdata" attribute (defaulting to "no"). A value of "yes" indicates that theserveroperator canadvertise which collationscontain character data, as itsupports.is the case with DAV:contains (see Section 5.16). Definition of additional operators using this format is NOT RECOMMENDED. <operators xmlns='DAV:'> <opdesc> <like/><operand-property/><operand-literal/> </opdesc> </operators> Reschke, et al.Expires March 3, 2009Standards Track [Page46] Internet-Draft37] RFC 5323 WebDAV SEARCHAugustNovember 2008o Allow a client to select the collation to be used. In practice, the current implementations5.19.9. Example ofWebDAV SEARCH usually rely on backends they do not control, andQuery Schema forwhich collation information may not be available. To make things worse, implementationsDAV:basicsearch <D:basicsearchschema xmlns:D="DAV:" xmlns:xs="http://www.w3.org/2001/XMLSchema"> <D:properties> <D:propdesc> <D:prop><D:getcontentlength/></D:prop> <D:datatype><xs:nonNegativeInteger/></D:datatype> <D:searchable/><D:selectable/><D:sortable/> </D:propdesc> <D:propdesc> <D:prop><D:getcontenttype/><D:displayname/></D:prop> <D:searchable/><D:selectable/><D:sortable/> </D:propdesc> <D:propdesc> <D:prop><fstop xmlns="http://ns.example.org"/></D:prop> <D:selectable/> </D:propdesc> <D:propdesc> <D:any-other-property/> <D:searchable/><D:selectable/> </D:propdesc> </D:properties> <D:operators> <D:opdesc> <D:like/><D:operand-property/><D:operand-literal/> </D:opdesc> <D:opdesc allow-pcdata="yes"> <D:contains/> </D:opdesc> </D:operators> </D:basicsearchschema> This response lists four properties. The data type of theDAV:basicsearch grammar frequently need to combine data from multiple underlying stores (such aslast three propertiesand full text content), and thus collation support may vary based on the operator or property. Another open issueiswhat collation formalism to support. At the time of this writing, the two specifications below seemnot given, so it defaults toprovide the necessary frameworkxs:string. All are selectable, andthusthe first three may be searched. All but thebase for future work on collation supportlast may be used inWebDAV SEARCH: 1. "Internet Application Protocol Collation Registry" ([RFC4790]). 2. "XQuery 1.0 and XPath 2.0 Functions and Operators" ([XPATHFUNC], Section 7.3.1). B.2. Count DAV:basicsearch does not allowarequest that returnssort. Of thecount of matching resources. A protocol extension would need to extend DAV:select,optional DAV operators, DAV:contains andalso modify the DAV:multistatus response format. B.3. Diagnostics for Unsupported Queries ThereDAV:like aremany reasons why a given query may not be supported by a server. Query Schema Discovery (Section 4) can be used to discover some constraints, butsupported. Note: The schema discovery defined here does notall. Future revisions should consider the introduction of specific condition codes ([RFC4918], Section 16) to these situations. B.4. Language Matching Section 5.12.2 defines language matching in termsprovide for discovery of supported values of theXPath "lang" function ([XPATH], Section 4.3). Future revisions should consider building on [BCP47] instead. B.5. Matching Media Types Matching media types using the DAV:getcontenttype property and"caseless" attribute. This may require that theDAV:like operator is hard due to DAV:getcontenttypereply alsoallowing parameters. A new operator specifically designed forlist thepurpose ofmandatory operators. Reschke, et al.Expires March 3, 2009Standards Track [Page47] Internet-Draft38] RFC 5323 WebDAV SEARCHAugustNovember 2008matching media types probably would simplify things a lot. See <http ://lists.w3.org/Archives/Public/www-webdav-dasl/2003OctDec/0109.html> for a specific proposal. B.6. Query by Name DAV:basicsearch operates on the properties (and optionally6. Internationalization Considerations Properties may be language-tagged using thecontents) of resources,xml:lang attribute (see [RFC4918], Section 4.3). The optional operators DAV:language-defined (Section 5.12.1) andthus doesn't reallyDAV:language-matches (Section 5.12.2) allowmatching on partsthe expression of conditions on theresource's URI. See <http://lists.w3.org/Archives/ Public/www-webdav-dasl/2003OctDec/0100.html> for a proposed extension covering this use case. B.7. Result Paging A frequently discussed featurelanguage tagging information. 7. Security Considerations This section isthe abilityprovided tospecifically requestdetail issues concerning security implications of which DASL applications need to be aware. All of the"next" setsecurity considerations ofresults, when eitherHTTP/1.1 ([RFC2616] and WebDAV ([RFC4918]) also apply to DASL. In addition, this section will include security risks inherent in theserver decidedsearch and retrieval of resource properties and content. A query MUST NOT allow clients totruncateretrieve information that wouldn't have been available through theresult,GET or PROPFIND methods in theclient explicitly askedfirst place. In particular: o Query constraints on WebDAV properties fora limited set (for instance, usingwhich theDAV:limit elementclient does not have read access need to be evaluated as if the property did not exist (see Section 5.5.3). o Query constraints on content (as with DAV:contains, defined in Section5.17). In this case, it would5.16) for which the client does not have read access need to bedesirableevaluated as ifthe server could keep the full query result, and provideanew URI identifyingGET would return a 4xx status code. A server should prepare for denial-of-service attacks. For example aseparate result resource, allowing theclientto retrieve additional data through GET requests, and removemay issue a query for which the resultthrough a DELETE request. B.8. Search Scope Discovery Given a Search Arbiter resource, there's currently no wayset is expensive todiscover programmatically the supported sets of search scopes. Future revisionscalculate or transmit because many resources match or must be evaluated. 7.1. Implications ofthis specification could specifyXML External Entities XML supports ascope discovery mechanism, similar to the Query Schema Discoveryfacility known as "external entities", defined in Section4. Appendix C. Change Log (to be removed by RFC Editor before publication) C.1. From draft-davis-dasl-protocol-xxx Feb 14, 1998 Initial Draft Feb 28, 1998 Referring4.2.2 of [XML], which instruct an XML processor toDASL asretrieve and perform anextensioninline include of XML located at a particular URI. An external XML entity can be used toHTTP/1.1 rather than DAV. Added new sections "Notational Conventions", "Protocol Model", "Security Considerations". Changed section 3append or modify the document type declaration (DTD) associated with an XML document. An external XML entity can also be used to"Elementsinclude XML within the content ofProtocol". Added some stuffan XML document. For non-validating XML, such as the XML used in this specification, including an external XML entity is not required by [XML]. However, [XML] does state that an XML processor may, at its discretion, include the external XML entity. External XML entities have no inherent trustworthiness and are subject to all the attacks that are endemic tointroduction. Added "result set" terminology. Added "IANA Considerations".any HTTP GET request. Reschke, et al.Expires March 3, 2009Standards Track [Page48] Internet-Draft39] RFC 5323 WebDAV SEARCHAugustNovember 2008Mar 9, 1998 Moved sub-headings of "Elements of Protocol"Furthermore, it is possible for an external XML entity tofirst levelmodify the DTD, andremoved "Elementshence affect the final form ofProtocol" Heading. AddedansentenceXML document, inintroduction explainingthe worst case significantly modifying its semantics, or exposing the XML processor to the security risks discussed in [RFC3023]. Therefore, implementers must be aware thatthisexternal XML entities should be treated as untrustworthy. There is also the scalability risk that would accompany a"sketch" of a protocol. Mar 11, 1998 Added orderby, data typing, three valued logic, query schema property, and element definitions for schema for basicsearch. April 8, 1998 -widely deployed application that madechanges based on last week's DASL BOF. May 8, 1998 Removed most of DAV:searcherror; converted to DAV: searchredirect Altered DAV:basicsearch grammar to use avoiduse ofANY in DTD June 17, 1998 -Added details on Query Schema Discovery -Shortened listexternal XML entities. In this situation, it is possible that there would be significant numbers ofdata types June 23, 1998 moved data types before change history rewrote the data types section removed the casesensitive element and replace with the casesensitive attribute added the casesensitive attribute to the DTDrequests forall operationsone external XML entity, potentially overloading any server thatmight work on a string Jul 20, 1998 A series of changes. See Author's meeting minutesfields requests fordetails. July 28, 1998 Changes as per author's meeting. QSD uses SEARCH, not PROPFIND. Moved text around to keep concepts nearby. Boolean literalsthe resource containing the external XML entity. 8. Scalability Query grammars are1 and 0, not T and F. contains changedidentified by URIs. Applications SHOULD NOT attempt tocontentspassthrough. Renamed rankretrieve these URIs even if they appear toscore. July 28, 1998 Added Dale Lowry as Author September 4, 1998 Added 422 as response when query lists unimplemented operators. DAV:literal declares a default valuebe retrievable (for example, those that begin with "http://"). 9. IANA Considerations This document uses the namespace defined in Section 21 of [RFC4918] forxml:space, 'preserve' (see XML spec, section 2.10) moved to newXMLnamespace syntax September 22, 1998 Changed "simplesearch" to "basicsearch" Changed isnullelements. 9.1. HTTP Headers This document specifies the HTTP header listed below, which has been added toisdefined Defined NULLness as having a 404 or 403 response used ENTITY syntaxthe permanent HTTP header registry defined inDTD Added redirect[RFC3864]. 9.1.1. DASL Header field name: DASL Applicable protocol: http Status: standard Author/Change controller: IETF Specification document: this specification (Section 3.2) Reschke, et al.Expires March 3, 2009Standards Track [Page49] Internet-Draft40] RFC 5323 WebDAV SEARCHAugustNovember 2008October 9, 1998 Fixed a series of typographical and formatting errors. Modified the section of three-valued logic to use a table rather than a text description of10. Contributors This document is based on prior work on therole of UNKNOWN in expressions. November 2, 1998 AddedDASL protocol done by theDAV:contains operator. RemovedWebDAV DASL working group until theDAV:contentpassthrough operator. November 18, 1998 Various author comments for submission June 3, 1999 Cosmetic and minor editorial changes only. Fix nits reportedyear 2000 -- namely by Alan Babich, JimWhitehead in email of April 26, 1999. Converted to HTML from Word 97, manually. April 20, 2000 Removed redirection feature, since 301/302 suffices. Removed Query Schema Discovery (former chapter 4). Everyone agrees this isDavis, Rick Henderson, Dale Lowry, Saveen Reddy, Surendra Reddy, and Judith Slein (see <http://www.webdav.org/dasl/> for the working group's web site, <http://purl.org/NET/webdav/dasl-references/reqs> for auseful feature, but it is apparently too difficult to define at this time,requirements document, andit is not essential<http://purl.org/NET/webdav/dasl-references/dasl-protocol-00> forDASL. C.2. since start of draft-reschke-webdav-search October 09, 2001 Added Julian Reschke as author. Chapter about QSD re-added. Formatted into RFC2629-compliant XML document. Added first comments. IDan early versionnumber kicked up to draft-dasl-protocol-03. October 17, 2001 Updated address information for Jim Davis. Added issueofdatatype vocabularies. Updated issue descriptions for grammar discovery, added issues on query schema DTD. Fixed typos in XML examples. December 17, 2001 Re-introduced split between normative and non- normative references. January 05, 2002 Version bumped up to 04. Started work on resolvingtheissues identifiedspecification). 11. Acknowledgements This document has benefited from thoughtful discussion by Lisa Dusseault, Javier Godoy, Sung Kim, Chris Newman, Elias Sinderson, Martin Wallmer, Keith Wannamaker, Jim Whitehead, and Kevin Wiggen. 12. References 12.1. Normative References [RFC2119] Bradner, S., "Key words for use inthe previous version. JanuaryRFCs to Indicate Requirement Levels", BCP 14,2002 Fixed some XML typos.RFC 2119, March 1997. [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January22, 2002 Closed issues naming-of-elements. Fixed query search DTD2001. [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., andadded optionJ. Whitehead, "Versioning Extensions todiscover properties of "other" (non-listed) properties.WebDAV (Web Distributed Authoring and Versioning)", RFC 3253, March 2002. [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol", RFC 3744, May 2004. [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005. Reschke, et al.Expires March 3, 2009Standards Track [Page50] Internet-Draft41] RFC 5323 WebDAV SEARCHAugustNovember 2008January 25, 2002 Changed into private submission[RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed Authoring andadded reference to historic DASL draft. Marked reference to DASL requirements non-normative. Updated reference to latest deltav spec. January 29, 2002 Added feedback fromVersioning (WebDAV)", RFC 4918, June 2007. [RFC5234] Crocker, D., Ed. andupdated contact infoP. Overell, "Augmented BNF forAlan Babich. Included open issues collected in http://www.webdav.org/dasl/protocol/issues.html. February 8, 2002 Made sure that all artwork fits into 72 characters wide text. February 18, 2002 Changed Insufficient storage handling (multistatus). Moved is-collection to operatorsSyntax Specifications: ABNF", STD 68, RFC 5234, January 2008. [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., andadded to DTD. Made scope/depth mandatory. February 20, 2002 Updated reference to SQL99. February 28, 2002 "Non-normative References" -> "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 XMLF. Yergeau, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C REC-xml-20060816, August 2006, <http://www.w3.org/TR/2006/REC-xml-20060816>. [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", W3C REC-xpath-19991116, November 1999, <http://www.w3.org/TR/1999/REC-xpath-19991116>. [XPATHFUNC] Malhotra, A., Melton, J., and N. Walsh, "XQuery 1.02nd edition. March 1, 2002 Removed superfluous namespace decl in 2.4.2. Reopened JW14andsuggest to drop xml:space support. 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)XPath 2.0 Functions andthe BNF for DAV:like (changed "octets" to "characters"). March 8, 2002 Updated reference to DeltaV (now RFC3253). Added Martin Wallmer's comments, moved JW5 into DAV:basicsearch section. March 11, 2002 Closed open issues regaring the typeOperators", W3C REC-xpath- functions-20070123, January 2007, <http://www.w3.org/ TR/2007/REC-xpath-functions-20070123/>. [XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N., and World Wide Web Consortium, "XML Schema Part 1: Structures", W3C REC-xmlschema-1-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>. [XS2] Biron, P., Malhotra, A., and World Wide Web Consortium, "XML Schema Part 2: Datatypes Second Edition", W3C REC-xmlschema-2-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>. 12.2. Informative References [BCP47] Phillips, A. and M. Davis, "Matching ofsearch arbiters (JW3)Language Tags", BCP 47, RFC 4647, September 2006. [RFC3864] Klyne, G., Nottingham, M., andtheir discovery (JW9). Rephrased requirements on multistatus response bodies (propstat only if properties were selected, removed requirementJ. Mogul, "Registration Procedures forresponsedescription).Message Header Fields", BCP 90, RFC 3864, September 2004. [RFC4437] Whitehead, J., Clemm, G., and J. Reschke, Ed., "Web Distributed Authoring and Versioning (WebDAV) Redirect Reference Resources", RFC 4437, March 2006. Reschke, et al.Expires March 3, 2009Standards Track [Page51] Internet-Draft42] RFC 5323 WebDAV SEARCHAugust 2008 March 23, 2002 RFC2376 -> RFC3023. Added missing first names of authors. OPTIONS added to example for DAV:supported-method-set. C.3. since draft-reschke-webdav-search-00 March 29, 2002 Abstract doesn't refer to DASL WG anymore. 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). May 28, 2002 Updated some issues with Jim Davis's comments. June 10, 2002 Added proposal for different method for query schema discovery, not using pseudo-properties. June 25, 2002 QSD marshalling rewritten. Added issue "isdefined- optional". C.4. since draft-reschke-webdav-search-01 July 04, 2002 Added issue "scope-collection". July 08, 2002 Closed issue "scope-collection". August 12, 2002 Added issues "results-vs-binds" and "select- allprop". October 22, 2002 Added issue "undefined-expressions".November18, 2002 Changed example host names (no change tracking). November 25, 2002 Updated issue "DB2/DB7". Closed issues "undefined expressions", "isdefined-optional"2008 [RFC4790] Newman, C., Duerst, M., and"select-allprop". C.5. since draft-reschke-webdav-search-02A. Gulbrandsen, "Internet Application Protocol Collation Registry", RFC 4790, March 2007. [SQL99] Milton, J., "Database Language SQL Part 2: Foundation (SQL/Foundation)", ISO ISO/IEC 9075-2:1999 (E), July 1999. [UNICODE5] The Unicode Consortium, "The Unicode Standard - Version 5.0", Addison-Wesley , November27, 2002 Added issues "undefined-properties", "like- exactlyone"2006, <http://www.unicode.org/versions/Unicode5.0.0/>. ISBN 0321480910 [1] [WEBDAV-BIND] Clemm, G., Crawford, J., Reschke, J., Ed., and"like-wildcard-adjacent". Closed issue "query-on- href". Added acknowledgments section. November 28, 2002 Closed issue "like-exactlyone". Added issue "mixed-content-properties". 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 referenceJ. Whitehead, "Binding Extensions toACL draft.Web Distributed Authoring and Versioning (WebDAV)", October 2008. URIs [1] <urn:isbn:0321480910> Reschke, et al.Expires March 3, 2009Standards Track [Page52] Internet-Draft43] RFC 5323 WebDAV SEARCHAugustNovember 2008January 9, 2003 Removed duplicate section on invalid scopes. Added comments to some open issues. Closed issues JW25/26, score- pseudo-property and null-ordering. January 10, 2003 Issue limit-vs-ordering plus resolution. Closed issue JW17/JW24b. January 14, 2003 New issue order-precedence. Started resolution of DB2/DB7. January 15, 2003 Started spec of DAV:typed-literal. January 17, 2003 Fix one DAV:like/DAV:getcontenttype example (add / to like expression, make case-insensitive). January 28, 2003 Update issue(s) result-truncation, JW24d. Fixed response headersAppendix A. Three-Valued Logic inOPTIONS example. Added issue qsd-optional. Closed issue(s) order-precedence, case-insensitivity-name. February 07, 2003 Added issue scope-vs-versions. score-pseudo- property: allow DAV:orderby to explicitly specify DAV:score. C.6. since draft-reschke-webdav-search-03 April 24, 2003 Fixed two "?" vs "_" issues (not updatedDAV:basicsearch ANSI standard three-valued logic is used when evaluating the search condition (as defined inlast draft). June 13, 2003 Improve index. C.7. since draft-reschke-webdav-search-04 July 7, 2003 Typo fixed (propstat without status element). August 11, 2003 Remove superfluous IP and copyright sections. September 09, 2003 Addedthe 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.). ANSI standard three-valued logic is undoubtedly the most widely practiced method of dealing with the issues"2.4-multiple-uris"of properties in the search condition not having a value (e.g., being null or not defined) for the resource under scan, and"5.1-name- filtering". October 06, 2003 Fix misplaced section endwith undefined expressions in5.11, add table formatting. Enhance table formatting in 5.18.3. Updated ACL and BIND references. Added XPATH reference. Closed issue JW24dthe search condition (e.g., division byadding new optional operators. Updated more open issues, added issues from January meeting. Add K. Wiggen to Acknowledgements. Add Contributors sectionzero, etc.). Three valued logic works as follows. Undefined expressions are expressions for which theauthorsvalue of theoriginal draft. Close issue "scope-vs-versions" (optional feature added). Close (new) issue "1.3-import-DTD-terminology". Add issue "1.3-import- requirements-terminology". Reschke, et al. Expires March 3, 2009 [Page 53] Internet-Draft WebDAV SEARCH August 2008 October 07, 2003 Typos fixed. Moved statement about DAV: namespace usage into separate (sub-)section. Closed "1.3-import- requirements-terminology". Update I18N Considerations with new xml:lang support info (see issue JW24d). Close issue "DB2/DB7" (remaining typing issuesexpression is not defined. Undefined expressions arenow summarizeda completely separate concept from the truth value UNKNOWN, which is, inissue "typed- literal"). Fix misplaced section endfact, well defined. Property names and literal constants are considered expressions for purposes of this section. If a property insection 7. Started changethe current resource under scan has not been set touse RFC3253-style method definitions and error marshalling. October 08, 2003 Remove obsolete languagea value, then the value of thatallowed reporting invalid scopes and such inside multistatus. Add new issue "5.4.2- scope-vs-redirects". C.8. since draft-reschke-webdav-search-05 October 11, 2003 Separate DAV:basicsearch DTD into separate figuresproperty is undefined forbetter maintainability. Update DTD with language-* operatorsthe resource under scan. DASL 1.0 has no arithmetic division operator, but if it did, division by zero would be an undefined arithmetic expression. If any subpart of an arithmetic, string, or datetime subexpression is undefined, the whole arithmetic, string, or datetime subexpression is undefined. There are no manifest constants to explicitly represent undefined number, string, or datetime values. Since a Boolean value is ultimately returned by the search condition, arithmetic, string, andtyped-literal element (optional). October 14, 2003 Close issue "5.4.2-multiple-scope". November 04, 2003 Update reference from CaseMapdatetime expressions are always arguments toUNICODE4, section 5.18. November 16, 2003 Updated issue "5.1-name-filtering". November 24, 2003 Reformatted scope description (collection vs. non- collection). November 30, 2003 Add issue "5_media_type_match". February 6, 2004 Updated all references. C.9. since draft-reschke-webdav-search-06 July 05, 2004 Fix table in Appendix "Three-Valued Logic in DAV: basicsearch". September 14, 2004 Fix inconsistent DTD in section 5.2other operators. Examples of operators that convert arithmetic, string, and5.4 for scope element. September 30, 2004 Rewrite editorial notedatetime 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. The Boolean operators DAV:and, DAV:or, andabstract. Update references (remove unneeded XMLNS, update refDAV:not are evaluated according toACLthe following rules: not UNKNOWN = UNKNOWN UNKNOWN andBIND specs).TRUE = UNKNOWN Reschke, et al.Expires March 3, 2009Standards Track [Page54] Internet-Draft44] RFC 5323 WebDAV SEARCHAugust 2008 C.10. since draft-reschke-webdav-search-07 October 01, 2004 Fix previous section heading (no change tracking). October 13, 2004 Fix DTD entry for is-collection.November1, 2004 Fix DTD fragment query-schema-discovery. December 11, 2004 Update BIND reference. January 01, 2005 Fix DASL and DASLREQ references. February 06, 2005 Update XS2 reference. February 11, 2005 Rewrite "like"2008 UNKNOWN and"DASL" (response header) grammar in ABNF. May 5, 2005 Update references. Close issue "abnf" (only use ABNF when applicable). C.11. since draft-reschke-webdav-search-08 May 06, 2005 Fix document title. September 25, 2005 Update BIND reference. October 05, 2005 Update RFC4234 reference. October 22, 2005 Author's address update. February 12, 2006 Update BIND reference. March 16, 2006 Add typed literals to QSD. August 20, 2006 Update XML reference. August 28, 2006 Add issues "5.3-select-count" (open)FALSE = FALSE UNKNOWN and"5.4- clarify-depth" (resolved). Update BIND reference (again). C.12. since draft-reschke-webdav-search-09 December 1, 2006 Fix ABNFUNKNOWN = UNKNOWN UNKNOWN or TRUE = TRUE UNKNOWN or FALSE = UNKNOWN UNKNOWN or UNKNOWN = UNKNOWN Appendix B. Candidates forDASL header. December 16, 2006 Close issue "qsd-optional", leave QSD optional. Close issue "2.4-multiple-uris", suggestingFuture Protocol Extensions This section summarizes issues thatservers should only return one response element per resourcehave been raised during the development of this specification, but for which no resolution could be found with the constraints incaseplace. Future revisions ofmultiple bindings. Add and resolve issues "authentication"this specification should revisit these issues, though. B.1. Collation Support Matching and"cleanup- iana" (adding the header registrationsorting of textual data relies on collations. With respect to WebDAV SEARCH, a combination of various design approaches could be used: o Require server support for"DASL"). Re-write Reschke, et al. Expires March 3, 2009 [Page 55] Internet-Draftspecific collations. o Require that the server can advertise which collations it supports. o Allow a client to select the collation to be used. In practice, the current implementations of WebDAV SEARCHAugust 2008 rationalusually rely on backends they do not control, and forusingwhich collation information may not be available. To make things worse, implementations of theDAV: namespace, although this is a non-WG submission. January 4, 2007 Close issue "JW16b/JW24a", being relatedDAV:basicsearch grammar frequently need to"language-comparison". Add Appendix B. Close issues "language- comparison", "5_media_type_match", "5.1-name-filtering" and "5.3- select-count"combine data from multiple underlying stores (such as"won't fix",properties andadd appendices accordingly. January 24, 2007 Update BIND reference. Close issue "5.4.2-scope- vs-redirects". Close issue "typed-literal": specify in terms of the XPATH 2.9 casting mechanism. Close issue "1.3-apply- condition-code-terminology" (no changes). C.13. since draft-reschke-webdav-search-10 January 29, 2007 Issue "result-truncation": Add appendix describingfull text content), and thus collation support may vary based on the operator or property. Another open issueof Result Paging. Describeis what collation formalism to support. At themechanismtime ofmarshalling truncated results in a new normative subsection (leavethis writing, theactual example where it was). Add and resolve issues "rfc2606-compliance" and "response-format". Update contact information for Alan Babich, Jim Davis and Surendra Reddy (no change tracking). February 8, 2007 Update BIND reference. C.14. since draft-reschke-webdav-search-11 Update: draft-newman-i18n-comparator-14 is RFC4790. Update: RFC2518 replaced by draft-ietf-webdav-rfc2518bis. Updated BIND reference. Minor tweaks to intro (document organization and relationtwo specifications below seem toDASL). C.15. since draft-reschke-webdav-search-12 Update: draft-ietf-webdav-rfc2518bis replaced by RFC4918. Updated BIND reference. C.16. since draft-reschke-webdav-search-13 Openprovide the necessary framework andclose issue "qsd-req-validity". Updated BIND reference. C.17. since draft-reschke-webdav-search-14 RFC4234 obsoleted by RFC5234. Addthus may be the base for future work on collation support in WebDAV SEARCH: 1. "Internet Application Protocol Collation Registry" ([RFC4790]). 2. "XQuery 1.0 andresolve issues "5.19.8-opdesc-vs-contains"XPath 2.0 Functions and"dtd". Add clarifications about the behaviour when literal values are not compatible with the type of a comparison.Operators" ([XPATHFUNC], Section 7.3.1). Reschke, et al.Expires March 3, 2009Standards Track [Page56] Internet-Draft45] RFC 5323 WebDAV SEARCHAugustNovember 2008C.18. since draft-reschke-webdav-search-15 Minor editorial improvements. Fix descriptionB.2. Count DAV:basicsearch does not allow a request that returns the count ofDAV:scope/DAV:hrefmatching resources. A protocol extension would need touse proper URI terminology, add referenceextend DAV:select, and also modify the DAV:multistatus response format. B.3. Diagnostics for Unsupported Queries There are many reasons why a given query may not be supported by a server. Query Schema Discovery (Section 4) can be used to discover some constraints, but not all. Future revisions should consider the introduction of specific condition codes ([RFC4918], Section 16) toRFC 3986. Clarify list nature of DASL header. Clarify that the DAV:like pattern ABNF is definedthese situations. B.4. Language Matching Section 5.12.2 defines language matching in terms ofUnicode code points. Update to UNICODE5. Aim for standards track (affects introduction to Appendix B). Thus, makethedependencyXPath "lang" function ([XPATH], Section 4.3). Future revisions should consider building on[RFC4437] clearly optional,[BCP47] instead. B.5. Matching Media Types Matching media types using the DAV:getcontenttype property andmakethereference informative. Also, mention BCP 47 as candidate for future changesDAV:like operator is hard due tolanguage matching. Mention definition of additional condition codes as candidateDAV:getcontenttype also allowing parameters. A new operator specifically designed forfuture changes. Consider DAV:contains in Security Considerations. Update Surendra's and Alan's contact information. Mention search scope discovery as future extensions. Addthe purpose of matching media types probably would simplify things aSHOULD level requirementlot. See <http ://lists.w3.org/Archives/Public/www-webdav-dasl/2003OctDec/0109.html> for a specific proposal. B.6. Query by Name DAV:basicsearchsearch arbiters to support their own URI as search scope. C.19. since draft-reschke-webdav-search-16 In DASL header registration tepmplate, set "Status" to "standard". Add missing bracket in DTD (Section 4.1). Fix brokenoperates on the properties (and optionally the contents) of resources, andmissing XML namespace declarations in examples. C.20. since draft-reschke-webdav-search-17 Typo fixed ("SHOULD not" -> "SHOULD NOT"). Fixed namespace name "http://jennicam.org" to usethus doesn't really allow matching on parts of the resource's URI. See <http://lists.w3.org/Archives/ Public/www-webdav-dasl/2003OctDec/0100.html> for aRFC 2606 compliant domain. State that SEARCHproposed extension covering this use case. B.7. Result Paging A frequently discussed feature isa safe method. Clarify thattheDASL header should be addedability to specifically request thepermanent registry. Add and resolve issue "ordering-vs-limiting". Reschke, et al. Expires March 3, 2009 [Page 57] Internet-Draft WebDAV SEARCH August 2008 Appendix D. Resolved issues (to be removed by RFC Editor before publication) Issues that were"next" set of results, when eitherrejectedthe server decided to truncate the result, orresolved in this version of this document. D.1. safeness In Section 2: Type: edit <http://www.w3.org/mid/4894155E.2000807@gmx.de> julian.reschke@greenbytes.de (2008-08-02): State thatthe client explicitly asked for a limited set (for instance, using the DAV:limit element defined in Section 5.17). Reschke, et al. Standards Track [Page 46] RFC 5323 WebDAV SEARCHmethod is safe. Resolution (2008-08-03): Done. D.2. ordering-vs-limitingNovember 2008 InSection 5.17.1: Type: change jbarone@xythos.com (2008-08-04): I readthisto mean that the full results should firstcase, it would beordered bydesirable if theserver,server could keep the full query result, andthen send backprovide a new URI identifying a separate result resource, allowing therequested limit. This seemsclient tocontradict what's specified in section 2.3.1, where the results are limitedretrieve additional data through GET requests, andthen ordered (if I'm reading it correctly). I think these 2 sections should be consistent with each other. Resolution (2008-08-17): Relax requirementremove the result through a DELETE request. B.8. Search Scope Discovery Given a Search Arbiter resource, there's currently no way toSHOULD. Appendix E. Open issues (to be removed by RFC Editor priordiscover programmatically the supported sets of search scopes. Future revisions of this specification could specify a scope discovery mechanism, similar topublication) E.1. edit Type: edit julian.reschke@greenbytes.de (2004-07-05): Umbrella issue for editorial fixes/enhancements.the Query Schema Discovery defined in Section 4. IndexReschke, et al. Expires March 3, 2009 [Page 58] Internet-Draft WebDAV SEARCH August 2008C caseless attribute28-29, 3626-27, 34 Condition Names DAV:search-grammar-discovery-supported (pre)109 DAV:search-grammar-supported (pre)109 DAV:search-multiple-scope-supported (pre)109 DAV:search-scope-valid (pre)119 Criteria65 D DAV:and2826 DAV:ascending2826 DAV:contains3331 DAV:depth2523 DAV:descending2826 DAV:eq2927 caseless attribute2927 DAV:from2523 DAV:gt2927 DAV:gte2927 DAV:include-versions2523 DAV:is-collection3130 DAV:is-defined3230 DAV:language-defined3129 DAV:language-matches3129 DAV:like3230 DAV:limit3533 DAV:literal2927 DAV:lt2927 DAV:lte2927 DAV:not2826 DAV:nresults3533 DAV:or2826 Reschke, et al. Standards Track [Page 47] RFC 5323 WebDAV SEARCH November 2008 DAV:orderby2826 DAV:scope2523 DAV:score3432 relationship to DAV:orderby3533 DAV:search-grammar-discovery-supported precondition109 DAV:search-grammar-supported precondition109 DAV:search-multiple-scope-supported precondition109 DAV:search-scope-valid precondition119 DAV:select2523 DAV:supported-query-grammar-set property1614 DAV:typed-literal29 DAV:where 26 M Methods Reschke, et al. Expires March 3, 2009 [Page 59] Internet-Draft WebDAV SEARCH August 200828 DAV:where 24 M Methods SEARCH97 O OPTIONS method1513 DASL response header1614 P Properties DAV:supported-query-grammar-set1614 Q Query65 Query Grammar75 Query Grammar Discovery1513 using live property1613 using OPTIONS1513 Query Schema75 R Result75 Result Record75 Result Record Definition75 Result Set75 Result Set Truncation Example1110 S Scope76 Search Arbiter76 SEARCH method97 Search Modifier76 Sort Specification86 Reschke, et al. Standards Track [Page 48] RFC 5323 WebDAV SEARCH November 2008 Authors' Addresses Julian F. Reschke (editor) greenbytes GmbH Hafenweg 16 Muenster, NW 48155 Germany Phone: +49 251 2807760Email:EMail: julian.reschke@greenbytes.de URI: http://greenbytes.de/tech/webdav/Reschke, et al. Expires March 3, 2009 [Page 60] Internet-Draft WebDAV SEARCH August 2008Surendra Reddy Mitrix, Inc. 303 Twin Dolphin Drive, Suite 600-37 Redwood City, CA 94065 U.S.A. Phone: +1 408 500 1135Email:EMail: Surendra.Reddy@mitrix.com Jim Davis 27 Borden Street Toronto, Ontario M5S 2M8 Canada Phone: +1 416 929 5854Email:EMail: jrd3@alum.mit.edu URI: http://www.econetwork.net/~jdavis Alan Babich IBM Corporation 3565 Harbor Blvd. Costa Mesa, CA 92626 U.S.A. Phone: +1 714 327 3403Email:EMail: ababich@us.ibm.com Reschke, et al.Expires March 3, 2009 [Page 61] Internet-Draft WebDAV SEARCH August 2008 Full Copyright Statement Copyright (C) The IETF Trust (2008). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY, THE IETF TRUST AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Intellectual Property The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Reschke, et al. Expires March 3, 2009Standards Track [Page62]49] ----