idnits 2.17.1 draft-reschke-webdav-search-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- ** Looks like you're using RFC 2026 boilerplate. This must be updated to follow RFC 3978/3979, as updated by RFC 4748. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- ** The document seems to lack a 1id_guidelines paragraph about Internet-Drafts being working documents. == No 'Intended status' indicated for this document; assuming Proposed Standard Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the RFC 3978 Section 5.4 Copyright Line does not match the current year == The document seems to lack the recommended RFC 2119 boilerplate, even if it appears to use RFC 2119 keywords -- however, there's a paragraph with a matching beginning. Boilerplate error? (The document does seem to have the reference to RFC 2119 which the ID-Checklist requires). == Using lowercase 'not' together with uppercase 'MUST', 'SHALL', 'SHOULD', or 'RECOMMENDED' is not an accepted usage according to RFC 2119. Please use uppercase 'NOT' together with RFC 2119 keywords (if that is what you mean). Found 'SHOULD not' in this paragraph: Query grammars are identified by URIs. Applications SHOULD not attempt to retrieve these URIs even if they appear to be retrievable (for example, those that begin with "http://") -- The document seems to lack a disclaimer for pre-RFC5378 work, but may have content which was first submitted before 10 November 2008. If you have contacted all the original authors and they are all willing to grant the BCP78 rights to the IETF Trust, then this is fine, and you can ignore this comment. If not, you may need to add the pre-RFC5378 disclaimer. (See the Legal Provisions document at https://trustee.ietf.org/license-info for more information.) -- The document date (February 2003) is 7740 days in the past. Is this intentional? Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) == Unused Reference: 'XMLNS' is defined on line 1598, but no explicit reference was found in the text == Outdated reference: A later version (-13) exists of draft-ietf-webdav-acl-09 ** Obsolete normative reference: RFC 2518 (Obsoleted by RFC 4918) ** Obsolete normative reference: RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) ** Obsolete normative reference: RFC 3023 (Obsoleted by RFC 7303) -- Possible downref: Non-RFC (?) normative reference: ref. 'XML' -- Possible downref: Non-RFC (?) normative reference: ref. 'XMLNS' -- Possible downref: Non-RFC (?) normative reference: ref. 'XS1' -- Possible downref: Non-RFC (?) normative reference: ref. 'XS2' == Outdated reference: A later version (-27) exists of draft-ietf-webdav-bind-00 -- No information found for draft-dasl-protocol - is the name correct? -- No information found for draft-dasl-requirements - is the name correct? Summary: 5 errors (**), 0 flaws (~~), 7 warnings (==), 8 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group J. F. Reschke 3 Internet Draft greenbytes 4 Expires: August 2003 S. Reddy 5 Oracle 6 J. Davis 7 Intelligent Markets 8 A. Babich 9 Filenet 10 February 2003 12 WebDAV SEARCH 13 draft-reschke-webdav-search-03 15 Status of this Memo 17 This document is an Internet-Draft and is in full conformance with 18 all provisions of Section 10 of RFC2026. Internet-Drafts are working 19 documents of the Internet Engineering Task Force (IETF), its areas, 20 and its working groups. Note that other groups may also distribute 21 working documents as Internet-Drafts. 23 Internet-Drafts are draft documents valid for a maximum of six months 24 and may be updated, replaced, or obsoleted by other documents at any 25 time. It is inappropriate to use Internet-Drafts as reference 26 material or to cite them other than as "work in progress". 28 The list of current Internet-Drafts can be accessed at 29 http://www.ietf.org/ietf/1id-abstracts.txt. 31 The list of Internet-Draft Shadow Directories can be accessed at 32 http://www.ietf.org/shadow.html. 34 This Internet-Draft will expire in August 2003. 36 Copyright Notice 38 Copyright (C) The Internet Society (2003). All Rights Reserved. 40 Abstract 42 This document specifies a set of methods, headers, properties and 43 content-types composing WebDAV SEARCH, an application of the HTTP/1.1 44 protocol to efficiently search for DAV resources based upon a set of 45 client-supplied criteria. 47 Distribution of this document is unlimited. Please send comments to 48 the Distributed Authoring and Versioning (WebDAV) DASL mailing list 49 at www-webdav-dasl@w3.org, which may be joined by sending a message 50 with subject "subscribe" to www-webdav-dasl-request@w3.org. 51 Discussions of the WebDAV DASL mailing list are archived at URL: 52 http://www.w3.org/pub/WWW/Archives/Public/www-webdav-dasl/. 54 Table of Contents 56 Abstract . . . . . . . . . . . . . . . . . . . . . . . . . . . 1 57 Table of Contents . . . . . . . . . . . . . . . . . . . . . . 3 58 1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 6 59 1.1 DASL . . . . . . . . . . . . . . . . . . . . . . . . . . 6 60 1.2 Relationship to DAV . . . . . . . . . . . . . . . . . . 6 61 1.3 Terms . . . . . . . . . . . . . . . . . . . . . . . . . 6 62 1.4 Notational Conventions . . . . . . . . . . . . . . . . . 7 63 1.5 An Overview of DASL at Work . . . . . . . . . . . . . . 7 64 2 The SEARCH Method . . . . . . . . . . . . . . . . . . . . . 8 65 2.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . 8 66 2.2 The Request . . . . . . . . . . . . . . . . . . . . . . 8 67 2.2.1 The Request-URI . . . . . . . . . . . . . . . . . . 8 68 2.2.2 The Request Body . . . . . . . . . . . . . . . . . . 8 69 2.3 The DAV:searchrequest XML Element . . . . . . . . . . . 9 70 2.4 The Successful 207 (Multistatus) Response . . . . . . . 9 71 2.4.1 Extending the PROPFIND Response . . . . . . . . . . 9 72 2.4.2 Example: A Simple Request and Response . . . . . . . 10 73 2.4.3 Example: Result Set Truncation . . . . . . . . . . . 11 74 2.5 Unsuccessful Responses . . . . . . . . . . . . . . . . . 12 75 2.6 Invalid Scopes . . . . . . . . . . . . . . . . . . . . . 12 76 2.6.1 Indicating an Invalid Scope . . . . . . . . . . . . 12 77 2.6.2 Example of an Invalid Scope . . . . . . . . . . . . 13 78 3 Discovery of Supported Query Grammars . . . . . . . . . . . 14 79 3.1 The OPTIONS Method . . . . . . . . . . . . . . . . . . . 14 80 3.2 The DASL Response Header . . . . . . . . . . . . . . . . 14 81 3.3 DAV:supported-query-grammar-set (protected) . . . . . . 15 82 3.4 Example: Grammar Discovery . . . . . . . . . . . . . . . 15 83 4 Query Schema Discovery: QSD . . . . . . . . . . . . . . . . 18 84 4.1 Additional SEARCH semantics . . . . . . . . . . . . . . 18 85 4.1.1 Example of query schema discovery . . . . . . . . . 19 86 5 The DAV:basicsearch Grammar . . . . . . . . . . . . . . . . 21 87 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . 21 88 5.2 The DAV:basicsearch DTD . . . . . . . . . . . . . . . . 21 89 5.2.1 Example Query . . . . . . . . . . . . . . . . . . . 22 90 5.3 DAV:select . . . . . . . . . . . . . . . . . . . . . . . 23 91 5.4 DAV:from . . . . . . . . . . . . . . . . . . . . . . . . 23 92 5.4.1 Relationship to the Request-URI . . . . . . . . . . 24 93 5.4.2 Scope . . . . . . . . . . . . . . . . . . . . . . . 24 94 5.5 DAV:where . . . . . . . . . . . . . . . . . . . . . . . 24 95 5.5.1 Use of Three-Valued Logic in Queries . . . . . . . . 24 96 5.5.2 Handling Optional operators . . . . . . . . . . . . 24 97 5.5.3 Treatment of NULL Values . . . . . . . . . . . . . . 25 98 5.5.4 Treatment of properties with mixed/element content . 25 99 5.5.5 Example: Testing for Equality . . . . . . . . . . . 25 100 5.5.6 Example: Relative Comparisons . . . . . . . . . . . 26 101 5.6 DAV:orderby . . . . . . . . . . . . . . . . . . . . . . 26 102 5.6.1 Comparing Natural Language Strings . . . . . . . . . 27 103 5.6.2 Example of Sorting . . . . . . . . . . . . . . . . . 27 104 5.7 Boolean Operators: DAV:and, DAV:or, and DAV:not . . . . 27 105 5.8 DAV:eq . . . . . . . . . . . . . . . . . . . . . . . . . 28 106 5.9 DAV:lt, DAV:lte, DAV:gt, DAV:gte . . . . . . . . . . . . 28 107 5.10 DAV:literal . . . . . . . . . . . . . . . . . . . . . . 28 108 5.11 DAV:typed-literal (optional) . . . . . . . . . . . . . 28 109 5.11 Example for typed numerical comparison . . . . . . . . 29 110 5.13 DAV:is-collection . . . . . . . . . . . . . . . . . . . 30 111 5.13.1 Example of DAV:is-collection . . . . . . . . . . . 30 112 5.14 DAV:is-defined . . . . . . . . . . . . . . . . . . . . 30 113 5.15 DAV:like . . . . . . . . . . . . . . . . . . . . . . . 31 114 5.15.1 Syntax for the Literal Pattern . . . . . . . . . . 31 115 5.15.2 Example of DAV:like . . . . . . . . . . . . . . . . 31 116 5.16 DAV:contains . . . . . . . . . . . . . . . . . . . . . 32 117 5.16.1 Result scoring (DAV:score element) . . . . . . . . 32 118 5.16.2 Ordering by score . . . . . . . . . . . . . . . . . 33 119 5.16.3 Examples . . . . . . . . . . . . . . . . . . . . . 33 120 5.17 Limiting the result set . . . . . . . . . . . . . . . . 34 121 5.17.1 Relationship to result ordering . . . . . . . . . . 34 122 5.18 The "caseless" XML attribute . . . . . . . . . . . . . 34 123 5.19 Query schema for DAV:basicsearch . . . . . . . . . . . 35 124 5.19.1 DTD for DAV:basicsearch QSD . . . . . . . . . . . . 35 125 5.19.2 DAV:propdesc Element . . . . . . . . . . . . . . . 35 126 5.19.2.1 DAV:any-other-property . . . . . . . . . . . . 36 127 5.19.3 The DAV:datatype Property Description . . . . . . . 36 128 5.19.4 The DAV:searchable Property Description . . . . . . 37 129 5.19.5 The DAV:selectable Property Description . . . . . . 37 130 5.19.6 The DAV:sortable Property Description . . . . . . . 37 131 5.19.7 The DAV:caseless Property Description . . . . . . . 38 132 5.19.8 The DAV:operators XML Element . . . . . . . . . . . 38 133 5.19.9 Example of Query Schema for DAV:basicsearch . . . . 38 134 6 Internationalization Considerations . . . . . . . . . . . . 40 135 7 Security Considerations . . . . . . . . . . . . . . . . . . 41 136 8 Scalability . . . . . . . . . . . . . . . . . . . . . . . . 42 137 9 Authentication . . . . . . . . . . . . . . . . . . . . . . . 43 138 10 IANA Considerations . . . . . . . . . . . . . . . . . . . . 44 139 11 Copyright . . . . . . . . . . . . . . . . . . . . . . . . . 45 140 12 Intellectual Property . . . . . . . . . . . . . . . . . . . 46 141 13 Acknowledgements . . . . . . . . . . . . . . . . . . . . . 47 142 Normative References . . . . . . . . . . . . . . . . . . . . . 48 143 Informative References . . . . . . . . . . . . . . . . . . . . 48 144 Author's Addresses . . . . . . . . . . . . . . . . . . . . . . 49 145 A Three-Valued Logic in DAV:basicsearch . . . . . . . . . . . 51 146 B Change Log . . . . . . . . . . . . . . . . . . . . . . . . . 53 147 B.1 From draft-davis-dasl-protocol-xxx . . . . . . . . . . . 53 148 B.2 since start of draft-reschke-webdav-search . . . . . . . 54 149 B.3 since draft-reschke-webdav-search-00 . . . . . . . . . . 56 150 B.4 since draft-reschke-webdav-search-01 . . . . . . . . . . 56 151 B.5 since draft-reschke-webdav-search-02 . . . . . . . . . . 56 152 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58 154 1 Introduction 156 1.1 DASL 158 This document defines WebDAV SEARCH, an application of HTTP/1.1 159 forming a lightweight search protocol to transport queries and result 160 sets and allows clients to make use of server-side search facilities. 161 It is based on the expired draft for WebDAV DASL [DASL]. [DASLREQ] 162 describes the motivation for DASL. 164 DASL will minimize the complexity of clients so as to facilitate 165 widespread deployment of applications capable of utilizing the DASL 166 search mechanisms. 168 DASL consists of: 170 o the SEARCH method, 172 o the DASL response header, 174 o the DAV:searchrequest XML element, 176 o the DAV:queryschema property, 178 o the DAV:basicsearch XML element and query grammar, and 180 o the DAV:basicsearchschema XML element. 182 For WebDAV-compliant servers, it also defines a new live property 183 DAV:supported-query-grammar-set. 185 1.2 Relationship to DAV 187 DASL relies on the resource and property model defined by [RFC2518]. 188 DASL does not alter this model. Instead, DASL allows clients to 189 access DAV-modeled resources through server-side search. 191 1.3 Terms 193 This draft uses the terms defined in [RFC2616], [RFC2518], and 194 [DASLREQ]. 196 1.4 Notational Conventions 198 The augmented BNF used by this document to describe protocol elements 199 is exactly the same as the one described in Section 2.1 of [RFC2616]. 200 Because this augmented BNF uses the basic production rules provided 201 in Section 2.2 of [RFC2616], those rules apply to this document as 202 well. 204 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT" 205 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 206 document are to be interpreted as described in [RFC2119]. 208 When an XML element type in the "DAV:" namespace is referenced in 209 this document outside of the context of an XML fragment, the string 210 "DAV:" will be prefixed to the element type. 212 Note that this draft currently defines elements and properties in the 213 WebDAV namespace "DAV:", which it shouldn't do as it isn't a work 214 item of the WebDAV working group. The reason for this is the desire 215 for some kind of backward compatibility to the expired DASL drafts 216 and the assumption that the draft may become an official RFC 217 submission of the WebDAV working group at a later point of time. 219 Similarily, when an XML element type in the namespace 220 "http://www.w3.org/2001/XMLSchema" is referenced in this document 221 outside of the context of an XML fragment, the string "xs:" will be 222 prefixed to the element type. 224 1.5 An Overview of DASL at Work 226 One can express the basic usage of DASL in the following steps: 228 o The client constructs a query using the DAV:basicsearch grammar. 230 o The client invokes the SEARCH method on a resource that will 231 perform the search (the search arbiter) and includes a text/xml or 232 application/xml request entity that contains the query. 234 o The search arbiter performs the query. 236 o The search arbiter sends the results of the query back to the 237 client in the response. The server MUST send an entity that 238 matches the [RFC2518] PROPFIND response. 240 2 The SEARCH Method 242 2.1 Overview 244 The client invokes the SEARCH method to initiate a server-side 245 search. The body of the request defines the query. The server MUST 246 emit an entity matching the [RFC2518] PROPFIND response. 248 The SEARCH method plays the role of transport mechanism for the query 249 and the result set. It does not define the semantics of the query. 250 The type of the query defines the semantics. 252 2.2 The Request 254 The client invokes the SEARCH method on the resource named by the 255 Request-URI. 257 2.2.1 The Request-URI 259 The Request-URI identifies the search arbiter. Any HTTP resource may 260 function as search arbiter. It is not a new type of resource (in the 261 sense of DAV:resourcetype as defined in [RFC2518]), nor does it have 262 to be a WebDAV-compliant resource. 264 The SEARCH method defines no relationship between the arbiter and the 265 scope of the search, rather the particular query grammar used in the 266 query defines the relationship. For example, the FOO query grammar 267 may force the request-URI to correspond exactly to the search scope. 269 2.2.2 The Request Body 271 The server MUST process a text/xml or application/xml request body, 272 and MAY process request bodies in other formats. See [RFC3023] for 273 guidance on packaging XML in requests. 275 If the client sends a text/xml or application/xml body, it MUST 276 include the DAV:searchrequest XML element. The DAV:searchrequest XML 277 element identifies the query grammar, defines the criteria, the 278 result record, and any other details needed to perform the search. 280 2.3 The DAV:searchrequest XML Element 282 284 The DAV:searchrequest XML element contains a single XML element that 285 defines the query. The name of the query element defines the type of 286 the query. The value of that element defines the query itself. 288 2.4 The Successful 207 (Multistatus) Response 290 If the server returns 207 (Multistatus), then the search proceeded 291 successfully and the response MUST match that of a PROPFIND. The 292 results of this method SHOULD NOT be cached. 294 There MUST be one DAV:response for each resource that matched the 295 search criteria. For each such response, the DAV:href element 296 contains the URI of the resource, and the response MUST include a 297 DAV:propstat element. 299 Note that for each matching resource found there may be multiple URIs 300 within the search scope mapped to it. In this case, a server SHOULD 301 report all of these URIs. Clients can use the live property 302 DAV:resource-id defined in [BIND] to identify possible duplicates. 304 In addition, the server MAY include DAV:response items in the reply 305 where the DAV:href element contains a URI that is not a matching 306 resource, e.g. that of a scope or the query arbiter. Each such 307 response item MUST NOT contain a DAV:propstat element, and MUST 308 contain a DAV:status element (unless no property was selected). 310 2.4.1 Extending the PROPFIND Response 312 A response MAY include more information than PROPFIND defines so long 313 as the extra information does not invalidate the PROPFIND response. 314 Query grammars SHOULD define how the response matches the PROPFIND 315 response. 317 2.4.2 Example: A Simple Request and Response 319 This example demonstrates the request and response framework. The 320 following XML document shows a simple (hypothetical) natural language 321 query. The name of the query element is natural-language-query in the 322 XML namespace "http://example.com/foo". The actual query is "Find the 323 locations of good Thai restaurants in Los Angeles". For this 324 hypothetical query, the arbiter returns two properties for each 325 selected resource. 327 >> Request: 329 SEARCH / HTTP/1.1 330 Host: example.org 331 Content-Type: application/xml 332 Content-Length: xxx 334 335 336 337 Find the locations of good Thai restaurants in Los Angeles 338 339 341 >> Response: 343 HTTP/1.1 207 Multi-Status 344 Content-Type: text/xml; charset="utf-8" 345 Content-Length: xxx 347 348 350 351 http://siamiam.test/ 352 353 354 259 W. Hollywood 355 4 356 357 358 359 361 2.4.3 Example: Result Set Truncation 363 A server MAY limit the number of resources in a reply, for example to 364 limit the amount of resources expended in processing a query. If it 365 does so, the reply MUST use status code 207, return a DAV:multistatus 366 response body and indicate a status of 507 (Insufficient Storage) for 367 the search arbiter URI. It SHOULD include the partial results. 369 When a result set is truncated, there may be many more resources that 370 satisfy the search criteria but that were not examined. 372 If partial results are included and the client requested an ordered 373 result set in the original request, then any partial results that are 374 returned MUST be ordered as the client directed. 376 Note that the partial results returned MAY be any subset of the 377 result set that would have satisfied the original query. 379 >> Request: 381 SEARCH / HTTP/1.1 382 Host: example.net 383 Content-Type: text/xml; charset="utf-8" 384 Content-Length: xxx 386 ... the query goes here ... 388 >> Response: 390 HTTP/1.1 207 Multistatus 391 Content-Type: text/xml; charset="utf-8" 392 Content-Length: xxx 394 395 396 397 http://www.example.net/sounds/unbrokenchain.au 398 399 400 HTTP/1.1 200 OK 401 402 403 404 http://tech.mit.test/archive96/photos/Lesh1.jpg 405 406 407 HTTP/1.1 200 OK 408 409 410 411 http://example.net 412 HTTP/1.1 507 Insufficient Storage 413 414 Only first two matching records were returned 415 416 417 419 2.5 Unsuccessful Responses 421 If an error occurred that prevented execution of the query, the 422 server MUST indicate the failure with the appropriate status code and 423 SHOULD include a DAV:multistatus element to point out errors 424 associated with scopes. 426 400 Bad Request. The query could not be executed. The request may be 427 malformed (not valid XML for example). Additionally, this can be used 428 for invalid scopes and search redirections. 430 422 Unprocessable entity. The query could not be executed. If a 431 application/xml or text/xml request entity was provided, then it may 432 have been well-formed but may have contained an unsupported or 433 unimplemented query operator. 435 2.6 Invalid Scopes 437 2.6.1 Indicating an Invalid Scope 439 A client may submit a scope that the arbiter may be unable to query. 440 The inability to query may be due to network failure, administrative 441 policy, security, etc. This raises the condition described as an 442 "invalid scope". 444 To indicate an invalid scope, the server MUST respond with a 400 (Bad 445 Request). 447 The response includes a body with a DAV:multistatus element. Each 448 DAV:response in the DAV:multistatus identifies a scope. To indicate 449 that this scope is the source of the error, the server MUST include 450 the DAV:scopeerror element. 452 2.6.2 Example of an Invalid Scope 454 >> Response: 456 HTTP/1.1 400 Bad-Request 457 Content-Type: text/xml; charset="utf-8" 458 Content-Length: xxx 460 462 463 464 http://www.example.com/X 465 HTTP/1.1 404 Object Not Found 466 467 468 470 3 Discovery of Supported Query Grammars 472 Servers MUST support discovery of the query grammars supported by a 473 search arbiter resource. 475 Clients can determine which query grammars are supported by an 476 arbiter by invoking OPTIONS on the search arbiter. If the resource 477 supports SEARCH, then the DASL response header will appear in the 478 response. The DASL response header lists the supported grammars. 480 Servers supporting the WebDAV extensions [RFC3253] and/or [ACL] MUST 481 also 483 o report SEARCH in the live property DAV:supported-method-set for 484 all search arbiter resources and 486 o support the live property DAV:supported-query-grammar-set as 487 defined in section 3.3. 489 3.1 The OPTIONS Method 491 The OPTIONS method allows the client to discover if a resource 492 supports the SEARCH method and to determine the list of search 493 grammars supported for that resource. 495 The client issues the OPTIONS method against a resource named by the 496 Request-URI. This is a normal invocation of OPTIONS defined in 497 [RFC2616]. 499 If a resource supports the SEARCH method, then the server MUST list 500 SEARCH in the OPTIONS response as defined by [RFC2616]. 502 DASL servers MUST include the DASL header in the OPTIONS response. 503 This header identifies the search grammars supported by that 504 resource. 506 3.2 The DASL Response Header 508 >> Response: 510 DASLHeader = "DASL" ":" Coded-URL-List 511 Coded-URL-List : Coded-URL [ "," Coded-URL-List ] 512 Coded-URL ; defined in section 9.4 of [RFC2518] 513 The DASL response header indicates server support for a query grammar 514 in the OPTIONS method. The value is a URI that indicates the type of 515 grammar. Note that although the URI can be used to identify each 516 supported search grammar, there is not necessarily a direct 517 relationship between the URI and the XML element name that can be 518 used in XML based SEARCH requests (the element name itself is 519 identified by it's namespace name (a URI reference) and the element's 520 local name). 522 This header MAY be repeated. 524 For example: 526 DASL: 527 DASL: 528 DASL: 529 DASL: 531 3.3 DAV:supported-query-grammar-set (protected) 533 This WebDAV property is required for any server supporting either 534 [RFC3253] and/or [ACL] and identifies the XML based query grammars 535 that are supported by the search arbiter resource. 537 539 541 543 ANY value: a query grammar element type 545 3.4 Example: Grammar Discovery 547 This example shows that the server supports search on the /somefolder 548 resource with the query grammars: DAV:basicsearch, 549 http://foobar.test/syntax1 and http://akuma.test/syntax2. Note that 550 every server MUST support DAV:basicsearch. 552 >> Request: 554 OPTIONS /somefolder HTTP/1.1 555 Host: example.org 557 >> Response: 559 HTTP/1.1 200 OK 560 Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE 561 Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH 562 DASL: 563 DASL: 564 DASL: 566 This example shows the equivalent taking advantage of a server's 567 support for DAV:supported-method-set and DAV:supported-query-grammar- 568 set. 570 >> Request: 572 PROPFIND /somefolder HTTP/1.1 573 Host: example.org 574 Depth: 0 575 Content-Type: text/xml; charset="utf-8" 576 Content-Length: xxx 578 579 580 581 582 583 584 586 >> Response: 588 HTTP/1.1 207 Multi-Status 589 Content-Type: text/xml; charset="utf-8" 590 Content-Length: xxx 591 592 593 594 http://example.org/somefolder 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 HTTP/1.1 200 OK 627 628 629 631 Note that the query grammar element names marshalled as part of the 632 DAV:supported-query-grammar-set can be directly used as element names 633 in an XML based query. 635 4 Query Schema Discovery: QSD 637 Servers MAY support the discovery of the schema for a query grammar. 639 The DASL response header and the DAV:supported-query-grammar-set 640 property provide means for clients to discover the set of query 641 grammars supported by a resource. This alone is not sufficient 642 information for a client to generate a query. For example, the 643 DAV:basicsearch grammar defines a set of queries consisting of a set 644 of operators applied to a set of properties and values, but the 645 grammar itself does not specify which properties may be used in the 646 query. QSD for the DAV:basicsearch grammar allows a client to 647 discover the set of properties that are searchable, selectable, and 648 sortable. Moreover, although the DAV:basicsearch grammar defines a 649 minimal set of operators, it is possible that a resource might 650 support additional operators in a query. For example, a resource 651 might support a optional operator that can be used to express 652 content-based queries in a proprietary syntax. QSD allows a client to 653 discover these operators and their syntax. The set of discoverable 654 quantities will differ from grammar to grammar, but each grammar can 655 define a means for a client to discover what can be discovered. 657 In general, the schema for a given query grammar depends on both the 658 resource (the arbiter) and the scope. A given resource might have 659 access to one set of properties for one potential scope, and another 660 set for a different scope. For example, consider a server able to 661 search two distinct collections, one holding cooking recipes, the 662 other design documents for nuclear weapons. While both collections 663 might support properties such as author, title, and date, the first 664 might also define properties such as calories and preparation time, 665 while the second defined properties such as yield and applicable 666 patents. Two distinct arbiters indexing the same collection might 667 also have access to different properties. For example, the recipe 668 collection mentioned above might also indexed by a value-added server 669 that also stored the names of chefs who had tested the recipe. Note 670 also that the available query schema might also depend on other 671 factors, such as the identity of the principal conducting the search, 672 but these factors are not exposed in this protocol. 674 4.1 Additional SEARCH semantics 676 Each query grammar supported by DASL defines its own syntax for 677 expressing the possible query schema. A client retrieves the schema 678 for a given query grammar on an arbiter resource with a given scope 679 by invoking the SEARCH method on that arbiter with that grammar and 680 scope and with a root element of DAV:query-schema-discovery rather 681 than DAV:searchrequest. 683 Marshalling: 685 The requst body MUST be DAV:query-schema-discovery element. 687 688 ANY value: XML element defining a valid query 690 The response body takes the form of a RFC2518 DAV:multistatus 691 element, where DAV:response is extended to hold the returned query 692 grammar inside a DAV:query-schema container element. 694 696 698 The content of this container is an XML element whose name and syntax 699 depend upon the grammar, and whose value may (and likely will) vary 700 depending upon the grammar, arbiter, and scope. 702 4.1.1 Example of query schema discovery 704 In this example, the arbiter is recipes.test, the grammar is 705 DAV:basicsearch, the scope is also recipes.test. 707 >> Request: 709 SEARCH / HTTP/1.1 710 Host: recipes.test 711 Content-Type: application/xml 712 Content-Length: xxx 714 715 716 717 718 719 http://recipes.test 720 infinity 721 722 723 724 726 >> Response: 728 HTTP/1.1 207 Multistatus 729 Content-Type: application/xml 730 Content-Length: xxx 732 733 734 735 http://recipes.test 736 HTTP/1.1 200 OK 737 738 739 741 742 743 744 746 The query schema for DAV:basicsearch is defined in section 5.19. 748 5 The DAV:basicsearch Grammar 750 5.1 Introduction 752 DAV:basicsearch uses an extensible XML syntax that allows clients to 753 express search requests that are generally useful for WebDAV 754 scenarios. DASL-extended servers MUST accept this grammar, and MAY 755 accept other grammars. 757 DAV:basicsearch has several components: 759 o DAV:select provides the result record definition. 761 o DAV:from defines the scope. 763 o DAV:where defines the criteria. 765 o DAV:orderby defines the sort order of the result set. 767 o DAV:limit provides constraints on the query as a whole. 769 5.2 The DAV:basicsearch DTD 771 773 775 776 778 779 780 781 782 784 787 788 790 792 794 795 797 798 800 801 803 804 806 807 809 811 813 814 816 818 819 821 822 824 825 827 5.2.1 Example Query 829 This query retrieves the content length values for all resources 830 located under the server's "/container1/" URI namespace whose length 831 exceeds 10000. 833 834 835 836 837 838 839 840 /container1/ 841 infinity 842 843 844 845 846 847 10000 848 849 850 851 852 853 854 855 856 857 859 5.3 DAV:select 861 DAV:select defines the result record, which is a set of properties 862 and values. This document defines two possible values: DAV:allprop 863 and DAV:prop, both defined in [RFC2518] and revised in [RFC3253] . 865 5.4 DAV:from 867 DAV:from defines the query scope. This contains exactly one DAV:scope 868 element. The scope element contains mandatory DAV:href and DAV:depth 869 elements. 871 DAV:href indicates the URI to use as a scope. 873 When the scope is a collection, if DAV:depth is "0", the search 874 includes only the collection. When it is "1", the search includes the 875 (toplevel) members of the collection. When it is "infinity", the 876 search includes all recursive members of the collection. When the 877 scope is not a collection, the depth is ignored and the search 878 applies just to the resource itself. 880 5.4.1 Relationship to the Request-URI 882 If the DAV:scope element is an absolute URI, the scope is exactly 883 that URI. 885 If the DAV:scope element is is an absolute URI reference, the scope 886 is taken to be relative to the request-URI. 888 5.4.2 Scope 890 A Scope can be an arbitrary URI. 892 Servers, of course, may support only particular scopes. This may 893 include limitations for particular schemes such as "http:" or "ftp:" 894 or certain URI namespaces. 896 5.5 DAV:where 898 The DAV:where element defines the search condition for inclusion of 899 resources in the result set. The value of this element is an XML 900 element that defines a search operator that evaluates to one of the 901 Boolean truth values TRUE, FALSE, or UNKNOWN. The search operator 902 contained by DAV:where may itself contain and evaluate additional 903 search operators as operands, which in turn may contain and evaluate 904 additional search operators as operands, etc. recursively. 906 5.5.1 Use of Three-Valued Logic in Queries 908 Each operator defined for use in the where clause that returns a 909 Boolean value MUST evaluate to TRUE, FALSE, or UNKNOWN. The resource 910 under scan is included as a member of the result set if and only if 911 the search condition evaluates to TRUE. 913 Consult appendix A for details on the application of three-valued 914 logic in query expressions. 916 5.5.2 Handling Optional operators 918 If a query contains an operator that is not supported by the server, 919 then the server MUST respond with a 422 (Unprocessable Entity) status 920 code. 922 5.5.3 Treatment of NULL Values 924 If a PROPFIND for a property value would yield a non-2xx (see 925 [RFC2616], section 10.2) response for that property, then that 926 property is considered NULL. 928 NULL values are "less than" all other values in comparisons. 930 Empty strings (zero length strings) are not NULL values. An empty 931 string is "less than" a string with length greater than zero. 933 The DAV:isdefined operator is defined to test if the value of a 934 property is NULL. 936 5.5.4 Treatment of properties with mixed/element content 938 Comparisons of properties that do not have simple types (text-only 939 content) is out-of-scope for the standard operators defined for 940 DAV:basicsearch and therefore is defined to be UNKNOWN (as per 941 appendix A). For querying the DAV:resourcetype property, see section 942 5.13. 944 5.5.5 Example: Testing for Equality 946 The example shows a single operator (DAV:eq) applied in the criteria. 948 949 950 951 952 953 100 954 955 957 5.5.6 Example: Relative Comparisons 959 The example shows a more complex operation involving several 960 operators (DAV:and, DAV:eq, DAV:gt) applied in the criteria. This 961 DAV:where expression matches those resources that are "image/gifs" 962 over 4K in size. 964 965 966 967 968 969 970 image/gif 971 972 973 974 975 976 4096 977 978 979 981 5.6 DAV:orderby 983 The DAV:orderby element specifies the ordering of the result set. It 984 contains one or more DAV:order elements, each of which specifies a 985 comparison between two items in the result set. Informally, a 986 comparison specifies a test that determines whether one resource 987 appears before another in the result set. Comparisons are applied in 988 the order they occur in the DAV:orderby element, earlier comparisons 989 being more significant. 991 The comparisons defined here use only a single property from each 992 resource, compared using the same ordering as the DAV:lt operator 993 (ascending) or DAV:gt operator (descending). If neither direction is 994 specified, the default is DAV:ascending. 996 In the context of the DAV:orderby element, null values are considered 997 to collate before any actual (i.e., non null) value, including 998 strings of zero length (this is compatible with [SQL99]). 1000 5.6.1 Comparing Natural Language Strings 1002 Comparisons on strings take into account the language defined for 1003 that property. Clients MAY specify the language using the xml:lang 1004 attribute. If no language is specified either by the client or 1005 defined for that property by the server or if a comparison is 1006 performed on strings of two different languages, the results are 1007 undefined. 1009 The "caseless" attribute may be used to indicate case-sensitivity for 1010 comparisons. 1012 5.6.2 Example of Sorting 1014 This sort orders first by last name of the author, and then by size, 1015 in descending order, so that for each author, the largest works 1016 appear first. 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1029 5.7 Boolean Operators: DAV:and, DAV:or, and DAV:not 1031 The DAV:and operator performs a logical AND operation on the 1032 expressions it contains. 1034 The DAV:or operator performs a logical OR operation on the values it 1035 contains. 1037 The DAV:not operator performs a logical NOT operation on the values 1038 it contains. 1040 5.8 DAV:eq 1042 The DAV:eq operator provides simple equality matching on property 1043 values. 1045 The "caseless" attribute may be used with this element. 1047 5.9 DAV:lt, DAV:lte, DAV:gt, DAV:gte 1049 The DAV:lt, DAV:lte, DAV:gt, and DAV:gte operators provide 1050 comparisons on property values, using less-than, less-than or equal, 1051 greater-than, and greater-than or equal respectively. The "caseless" 1052 attribute may be used with these elements. 1054 5.10 DAV:literal 1056 DAV:literal allows literal values to be placed in an expression. 1058 White space in literal values is significant in comparisons. For 1059 consistency with [RFC2518], clients SHOULD NOT specify the attribute 1060 "xml:space" (section 2.10 of [XML]) to override this behaviour. 1062 In comparisons, the contents of DAV:literal SHOULD be treated as 1063 string, with the following exceptions: 1065 o when operand for a comparison with a DAV:getcontentlength 1066 property, it SHOULD be treated as an integer value (the behaviour 1067 for non-integer values is undefined), 1069 o when operand for a comparison with a DAV:creationdate or 1070 DAV:getlastmodified property, it SHOULD be treated as a date value 1071 in the ISO-8601 subset defined for the DAV:creationdate property 1072 ([RFC2518], section 13.1). 1074 o when operand for a comparison with a property for which the type 1075 is known, it MAY be treated according to this type. 1077 5.11 DAV:typed-literal (optional) 1079 There are situations in which a client may want to force a comparison 1080 not to be string-based (as defined for DAV:literal). In these cases, 1081 a typed comparison can be enforced by using DAV:typed-literal 1082 instead. 1084 1086 The data type is specified using the xsi:type attribute defined in 1087 [XS1], section 2.6.1. If the type is not specified, it defaults to 1088 "xs:string". 1090 A server MUST reject a request with an unknown type. 1092 5.11 Example for typed numerical comparison 1094 Consider a set of resources with the dead property "edits" in the 1095 namespace "http://ns.example.org": 1097 URI property value 1099 /a "-1" 1100 /b "01" 1101 /c "3" 1102 /d "test" 1103 /e (undefined) 1105 The expression 1107 1110 1111 3 1112 1114 will evaluate to TRUE for the resources "/a" and "/b" (their property 1115 values can be parsed as type xs:number, and the numerical comparison 1116 evaluates to true), to FALSE for "/c" (property value is compatible, 1117 but numerical comparison evaluates to false) and UNKNOWN fot "/d" and 1118 "/e" (the property either is undefined, or its value can not be 1119 parsed as xs:number). 1121 5.13 DAV:is-collection 1123 The DAV:is-collection operator allows clients to determine whether a 1124 resource is a collection (that is, whether it's DAV:resourcetype 1125 element contains the element DAV:collection). 1127 Rationale: This operator is provided in lieu of defining generic 1128 structure queries, which would suffice for this and for many more 1129 powerful queries, but seems inappropriate to standardize at this 1130 time. 1132 5.13.1 Example of DAV:is-collection 1134 This example shows a search criterion that picks out all and only the 1135 resources in the scope that are collections. 1137 1138 1139 1141 5.14 DAV:is-defined 1143 The DAV:is-defined operator allows clients to determine whether a 1144 property is defined on a resource. The meaning of "defined on a 1145 resource" is found in section 5.5.3. 1147 Example: 1149 1150 1151 1153 5.15 DAV:like 1155 The DAV:like is an optional operator intended to give simple 1156 wildcard-based pattern matching ability to clients. 1158 The operator takes two arguments. 1160 The first argument is a DAV:prop element identifying a single 1161 property to evaluate. 1163 The second argument is a DAV:literal element that gives the pattern 1164 matching string. 1166 5.15.1 Syntax for the Literal Pattern 1168 Pattern := [wildcard] 0*( text [wildcard] ) 1169 wildcard := exactlyone | zeroormore 1170 text := 1*( | escapesequence ) 1171 exactlyone : = "_" 1172 zeroormore := "%" 1173 escapechar := "\" 1174 escapesequence := "\" ( exactlyone | zeroormore | escapechar ) 1175 character: valid XML characters (see section 2.2 of [XML]), 1176 minus ( exactlyone | zeroormore | escapechar ) 1178 The value for the literal is composed of wildcards separated by 1179 segments of text. Wildcards may begin or end the literal. 1181 The "?" wildcard matches exactly one character. 1183 The "%" wildcard matches zero or more characters 1185 The " 1187 5.15.2 Example of DAV:like 1189 This example shows how a client might use DAV:like to identify those 1190 resources whose content type was a subtype of image. 1192 1193 1194 1195 image/% 1196 1197 1199 5.16 DAV:contains 1201 The DAV:contains operator is an optional operator that provides 1202 content-based search capability. This operator implicitly searches 1203 against the text content of a resource, not against content of 1204 properties. The DAV:contains operator is intentionally not overly 1205 constrained, in order to allow the server to do the best job it can 1206 in performing the search. 1208 The DAV:contains operator evaluates to a Boolean value. It evaluates 1209 to TRUE if the content of the resource satisfies the search. 1210 Otherwise, It evaluates to FALSE. 1212 Within the DAV:contains XML element, the client provides a phrase: a 1213 single word or whitespace delimited sequence of words. Servers MAY 1214 ignore punctuation in a phrase. Case-sensitivity is left to the 1215 server. 1217 The following things may or may not be done as part of the search: 1218 Phonetic methods such as "soundex" may or may not be used. Word 1219 stemming may or may not be performed. Thesaurus expansion of words 1220 may or may not be done. Right or left truncation may or may not be 1221 performed. The search may be case insensitive or case sensitive. The 1222 word or words may or may not be interpreted as names. Multiple words 1223 may or may not be required to be adjacent or "near" each other. 1224 Multiple words may or may not be required to occur in the same order. 1225 Multiple words may or may not be treated as a phrase. The search may 1226 or may not be interpreted as a request to find documents "similar" to 1227 the string operand. 1229 5.16.1 Result scoring (DAV:score element) 1231 Servers SHOULD indicate scores for the DAV:contains condition by 1232 adding a DAV:score XML element to the DAV:response element. It's 1233 value is defined only in the context of a particular query result. 1234 The value is a string representing the score, an integer from zero to 1235 10000 inclusive, where a higher value indicates a higher score (e.g. 1237 more relevant). 1239 Modified DTD fragment for DAV:propstat: 1241 1243 1245 Clients should note that, in general, it is not meaningful to compare 1246 the numeric values of scores from two different query results unless 1247 both were executed by the same underlying search system on the same 1248 collection of resources. 1250 5.16.2 Ordering by score 1252 To order search results by their score, the DAV:score element may be 1253 added as child to the DAV:orderby element (in place of a DAV:prop 1254 element). 1256 5.16.3 Examples 1258 The example below shows a search for the phrase "Peter Forsberg". 1260 Depending on its support for content-based searching, a server MAY 1261 treat this as a search for documents that contain the words "Peter" 1262 and "Forsberg". 1264 1265 Peter Forsberg 1266 1268 The example below shows a search for resources that contain "Peter" 1269 and "Forsberg". 1271 1272 1273 Peter 1274 Forsberg 1275 1276 1278 5.17 Limiting the result set 1280 1281 ;only digits 1283 The DAV:limit XML element contains requested limits from the client 1284 to limit the size of the reply or amount of effort expended by the 1285 server. The DAV:nresults XML element contains a requested maximum 1286 number of DAV:response elements to be returned in the response body. 1287 The server MAY disregard this limit. The value of this element is an 1288 integer. 1290 5.17.1 Relationship to result ordering 1292 If the result set is both limited by DAV:limit and ordered according 1293 to DAV:orderby, the results that are included in the response 1294 document must be those that order highest. 1296 5.18 The "caseless" XML attribute 1298 The "caseless" attribute allows clients to specify caseless matching 1299 behaviour instead of character-by-character matching for 1300 DAV:basicsearch operators. 1302 The possible values for "caseless" are "yes" or "no". The default 1303 value is server-specified. Caseless matching SHOULD be implemented as 1304 defined in [CaseMap]. 1306 Support for the "caseless" attribute is optional. A server should 1307 respond with a status of 422 if it is used but cannot be supported. 1309 5.19 Query schema for DAV:basicsearch 1311 The DAV:basicsearch grammar defines a search criteria that is a 1312 Boolean-valued expression, and allows for an arbitrary set of 1313 properties to be included in the result record. The result set may be 1314 sorted on a set of property values. Accordingly the DTD for schema 1315 discovery for this grammar allows the server to express: 1317 1. the set of properties that may be either searched, returned, or 1318 used to sort, and a hint about the data type of such properties 1320 2. the set of optional operators defined by the resource. 1322 5.19.1 DTD for DAV:basicsearch QSD 1324 1325 1326 1327 1330 1331 1332 1333 1335 The DAV:properties element holds a list of descriptions of 1336 properties. 1338 The DAV:operators element describes the optional operators that may 1339 be used in a DAV:where element. 1341 5.19.2 DAV:propdesc Element 1343 Each instance of a DAV:propdesc element describes the property or 1344 properties in the DAV:prop element it contains. All subsequent 1345 elements are descriptions that apply to those properties. All 1346 descriptions are optional and may appear in any order. Servers SHOULD 1347 support all the descriptions defined here, and MAY define others. 1349 DASL defines five descriptions. The first, DAV:datatype, provides a 1350 hint about the type of the property value, and may be useful to a 1351 user interface prompting for a value. The remaining four 1352 (DAV:searchable, DAV:selectable, DAV:sortable, and DAV:caseless) 1353 identify portions of the query (DAV:where, DAV:select, and 1354 DAV:orderby, respectively). If a property has a description for a 1355 section, then the server MUST allow the property to be used in that 1356 section. These descriptions are optional. If a property does not have 1357 such a description, or is not described at all, then the server MAY 1358 still allow the property to be used in the corresponding section. 1360 5.19.2.1 DAV:any-other-property 1362 This element can be used in place of DAV:prop to describe properties 1363 of WebDAV properties not mentioned in any other DAV:prop element. For 1364 instance, this can be used to indicate that all other properties are 1365 searchable and selectable without giving details about their types (a 1366 typical scenario for dead properties). 1368 5.19.3 The DAV:datatype Property Description 1370 The DAV:datatype element contains a single XML element that provides 1371 a hint about the domain of the property, which may be useful to a 1372 user interface prompting for a value to be used in a query. Datatypes 1373 are identified by an element name. Where appropriate, a server SHOULD 1374 use the simple datatypes defined in [XS2]. 1376 1378 Examples from [XS2], section 3: 1380 Qualified name Example 1382 xs:boolean true, false, 1, 0 1383 xs:string Foobar 1384 xs:dateTime 1994-11-05T08:15:5Z 1385 xs:float .314159265358979E+1 1386 xs:integer -259, 23 1387 If the data type of a property is not given, then the data type 1388 defaults to xs:string. 1390 5.19.4 The DAV:searchable Property Description 1392 1394 If this element is present, then the server MUST allow this property 1395 to appear within a DAV:where element where an operator allows a 1396 property. Allowing a search does not mean that the property is 1397 guaranteed to be defined on every resource in the scope, it only 1398 indicates the server's willingness to check. 1400 5.19.5 The DAV:selectable Property Description 1402 1404 This element indicates that the property may appear in the DAV:select 1405 element. 1407 5.19.6 The DAV:sortable Property Description 1409 This element indicates that the property may appear in the 1410 DAV:orderby element. 1412 1414 5.19.7 The DAV:caseless Property Description 1416 This element only applies to properties whose data type is 1417 "xs:string" and derived data types as per the DAV:datatype property 1418 description. Its presence indicates that compares performed for 1419 searches, and the comparisons for ordering results on the string 1420 property will be caseless (the default is character-by-character). 1422 1424 5.19.8 The DAV:operators XML Element 1426 The DAV:operators element describes every optional operator supported 1427 in a query. (Mandatory operators are not listed since they are 1428 mandatory and permit no variation in syntax.). All optional operators 1429 that are supported MUST be listed in the DAV:operators element. The 1430 listing for an operator consists of the operator (as an empty 1431 element), followed by one element for each operand. The operand MUST 1432 be either DAV:operand-property or DAV:operand-literal, which indicate 1433 that the operand in the corresponding position is a property or a 1434 literal value, respectively. If an operator is polymorphic (allows 1435 more than one operand syntax) then each permitted syntax MUST be 1436 listed separately. 1438 1439 1440 1441 1442 1444 5.19.9 Example of Query Schema for DAV:basicsearch 1446 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1474 This response lists four properties. The datatype of the last three 1475 properties is not given, so it defaults to xs:string. All are 1476 selectable, and the first three may be searched. All but the last may 1477 be used in a sort. Of the optional DAV operators, DAV:isdefined and 1478 DAV:like are supported. 1480 Note: The schema discovery defined here does not provide for 1481 discovery of supported values of the "caseless" attribute. This may 1482 require that the reply also list the mandatory operators. 1484 6 Internationalization Considerations 1486 Clients have the opportunity to tag properties when they are stored 1487 in a language. The server SHOULD read this language-tagging by 1488 examining the xml:lang attribute on any properties stored on a 1489 resource. 1491 The xml:lang attribute specifies a nationalized collation sequence 1492 when properties are compared. 1494 Comparisons when this attribute differs have undefined order. 1496 7 Security Considerations 1498 This section is provided to detail issues concerning security 1499 implications of which DASL applications need to be aware. All of the 1500 security considerations of HTTP/1.1 also apply to DASL. In addition, 1501 this section will include security risks inherent in searching and 1502 retrieval of resource properties and content. 1504 A query must not allow one to retrieve information about values or 1505 existence of properties that one could not obtain via PROPFIND. (e.g. 1506 by use in DAV:orderby, or in expressions on properties.) 1508 A server should prepare for denial of service attacks. For example a 1509 client may issue a query for which the result set is expensive to 1510 calculate or transmit because many resources match or must be 1511 evaluated. 7.1 Implications of XML External Entities 1513 XML supports a facility known as "external entities", defined in 1514 section 4.2.2 of [XML], which instruct an XML processor to retrieve 1515 and perform an inline include of XML located at a particular URI. An 1516 external XML entity can be used to append or modify the document type 1517 declaration (DTD) associated with an XML document. An external XML 1518 entity can also be used to include XML within the content of an XML 1519 document. For non-validating XML, such as the XML used in this 1520 specification, including an external XML entity is not required by 1521 [XML]. However, [XML] does state that an XML processor may, at its 1522 discretion, include the external XML entity. 1524 External XML entities have no inherent trustworthiness and are 1525 subject to all the attacks that are endemic to any HTTP GET request. 1526 Furthermore, it is possible for an external XML entity to modify the 1527 DTD, and hence affect the final form of an XML document, in the worst 1528 case significantly modifying its semantics, or exposing the XML 1529 processor to the security risks discussed in [RFC3023]. Therefore, 1530 implementers must be aware that external XML entities should be 1531 treated as untrustworthy. 1533 There is also the scalability risk that would accompany a widely 1534 deployed application which made use of external XML entities. In this 1535 situation, it is possible that there would be significant numbers of 1536 requests for one external XML entity, potentially overloading any 1537 server which fields requests for the resource containing the external 1538 XML entity. 1540 8 Scalability 1542 Query grammars are identified by URIs. Applications SHOULD not 1543 attempt to retrieve these URIs even if they appear to be retrievable 1544 (for example, those that begin with "http://") 1546 9 Authentication 1548 Authentication mechanisms defined in WebDAV will also apply to DASL. 1550 10 IANA Considerations 1552 This document uses the namespace defined by [RFC2518] for XML 1553 elements. All other IANA considerations mentioned in [RFC2518] are 1554 also applicable to DASL. 1556 11 Copyright 1558 To be supplied. 1560 12 Intellectual Property 1562 To be supplied. 1564 13 Acknowledgements 1566 This draft has benefited from thoughtful discussion by Lisa 1567 Dusseault, Sung Kim, Elias Sinderson, Martin Wallmer and Jim 1568 Whitehead. 1570 Normative References 1572 [ACL] Clemm, G., Hopkins, A., Sedlar, E. and Whitehead, J., 1573 "WebDAV Access Control Protocol", ID draft-ietf-webdav- 1574 acl-09, July 2002. 1576 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1577 Requirement Levels", BCP 14, RFC 2119, March 1997. 1579 [RFC2518] Goland, Y., Whitehead, E., Faizi, A., Carter, S.R. and 1580 Jensen, D., "HTTP Extensions for Distributed Authoring -- 1581 WEBDAV", RFC 2518, February 1999. 1583 [RFC2616] Fielding, R.T., Gettys, J., Mogul, J.C., Nielsen, H.F., 1584 Masinter, L., Leach, P.J. and Berners-Lee, T., "Hypertext 1585 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 1587 [RFC3023] Makoto, M., St.Laurent, S. and Kohn, D., "XML Media 1588 Types", RFC 3023, January 2001. 1590 [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C. and 1591 Whitehead, J., "Versioning Extensions to WebDAV", RFC 1592 3253, March 2002. 1594 [XML] Bray, T., Paoli, J., Sperberg-McQueen, C.M. and Maler, E., 1595 "Extensible Markup Language (XML) 1.0 (2nd ed)", W3C REC- 1596 xml, October 2000. 1598 [XMLNS] Bray, T., Hollander, D. and Layman, A., "Namespaces in 1599 XML", W3C REC-xml-names, January 1999. 1601 [XS1] Thompson, H. S., Beech, D., Maloney, M., Mendelsohn, N. 1602 and World Wide Web Consortium, "XML Schema Part 1: 1603 Structures", W3C XS1, May 2001. 1605 [XS2] Biron, P. V., Malhotra, A. and World Wide Web Consortium, 1606 "XML Schema Part 2: Datatypes", W3C XS2, May 2001. 1608 Informative References 1610 [BIND] Clemm, G., Crawford, J., Reschke, J. F., Slein, J. and 1611 Whitehead, J., "Binding Extensions to WebDAV", ID draft- 1612 ietf-webdav-bind-00, October 2002. 1614 [CaseMap] Davis, M., "Case Mappings", Unicode Techical Reports 21, 1615 February 2001. 1617 [DASL] Reddy, S., Lowry, D., Reddy, S., Henderson, R., Davis, J. 1618 and Babich, A., "DAV Searching & Locating", ID draft-dasl- 1619 protocol-00, July 1999. 1621 [DASLREQ] Davis, J., Reddy, S. and Slein, J., "Requirements for DAV 1622 Searching and Locating", ID draft-dasl-requirements-01, 1623 February 1999. 1625 [SQL99] Milton, J., "Database Language SQL Part 2: Foundation 1626 (SQL/Foundation)", ISO ISO/IEC 9075-2:1999 (E), July 1999. 1628 Author's Addresses 1630 Julian F. Reschke 1631 greenbytes GmbH 1632 Salzmannstrasse 152 1633 Muenster, NW 48159 1634 Germany 1636 Phone: +49 251 2807760 1637 Fax: +49 251 2807761 1638 EMail: julian.reschke@greenbytes.de 1639 URI: http://greenbytes.de/tech/webdav/ 1641 Surendra Reddy 1642 Oracle Corporation 1643 600 Oracle Parkway, M/S 6op3 1644 Redwoodshores, CA 94065 1646 Phone: +1 650 506 5441 1647 EMail: Surendra.Reddy@oracle.com 1649 Jim Davis 1650 Intelligent Markets 1651 410 Jessie Street 6th floor 1652 San Francisco, CA 94103 1654 EMail: jrd3@alum.mit.edu 1655 Alan Babich 1656 FileNET Corp. 1657 3565 Harbor Blvd. 1658 Costa Mesa, CA 92626 1660 Phone: +1 714 327 3403 1661 EMail: ababich@filenet.com 1663 A Three-Valued Logic in DAV:basicsearch 1665 ANSI standard three valued logic is used when evaluating the search 1666 condition (as defined in the ANSI standard SQL specifications, for 1667 example in ANSI X3.135-1992, section 8.12, pp. 188-189, section 8.2, 1668 p. 169, General Rule 1)a), etc.). 1670 ANSI standard three valued logic is undoubtedly the most widely 1671 practiced method of dealing with the issues of properties in the 1672 search condition not having a value (e.g., being null or not defined) 1673 for the resource under scan, and with undefined expressions in the 1674 search condition (e.g., division by zero, etc.). Three valued logic 1675 works as follows. 1677 Undefined expressions are expressions for which the value of the 1678 expression is not defined. Undefined expressions are a completely 1679 separate concept from the truth value UNKNOWN, which is, in fact, 1680 well defined. Property names and literal constants are considered 1681 expressions for purposes of this section. If a property in the 1682 current resource under scan has not been set to a value, then the 1683 value of that property is undefined for the resource under scan. DASL 1684 1.0 has no arithmetic division operator, but if it did, division by 1685 zero would be an undefined arithmetic expression. 1687 If any subpart of an arithmetic, string, or datetime subexpression is 1688 undefined, the whole arithmetic, string, or datetime subexpression is 1689 undefined. 1691 There are no manifest constants to explicitly represent undefined 1692 number, string, or datetime values. 1694 Since a Boolean value is ultimately returned by the search condition, 1695 arithmetic, string, and datetime expressions are always arguments to 1696 other operators. Examples of operators that convert arithmetic, 1697 string, and datetime expressions to Boolean values are the six 1698 relational operators ("greater than", "less than", "equals", etc.). 1699 If either or both operands of a relational operator have undefined 1700 values, then the relational operator evaluates to UNKNOWN. Otherwise, 1701 the relational operator evaluates to TRUE or FALSE, depending upon 1702 the outcome of the comparison. 1704 The Boolean operators DAV:and, DAV:or and DAV:not are evaluated 1705 according to the following rules: 1707 UNKNOWN and UNKNOWN = UNKNOWN 1709 UNKNOWN or UNKNOWN = UNKNOWN 1710 not UNKNOWN = UNKNOWN 1712 UNKNOWN and TRUE = UNKNOWN 1714 UNKNOWN and FALSE = FALSE 1716 UNKNOWN and UNKNOWN = UNKNOWN 1718 UNKNOWN or TRUE = TRUE 1720 UNKNOWN or FALSE = UNKNOWN 1722 UNKNOWN or UNKNOWN = UNKNOWN 1724 B Change Log 1726 B.1 From draft-davis-dasl-protocol-xxx 1728 Feb 14, 1998 Initial Draft 1729 Feb 28, 1998 Referring to DASL as an extension to HTTP/1.1 1730 rather than DAV. 1731 Added new sections "Notational Conventions", 1732 "Protocol Model", "Security Considerations". 1733 Changed section 3 to "Elements of Protocol". 1734 Added some stuff to introduction. 1735 Added "result set" terminology. 1736 Added "IANA Considerations". 1737 Mar 9, 1998 Moved sub-headings of "Elements of Protocol" to 1738 first level and removed "Elements of Protocol" 1739 Heading. 1740 Added an sentence in introduction explaining that 1741 this is a "sketch" of a protocol. 1742 Mar 11, 1998 Added orderby, data typing, three valued logic, 1743 query schema property, and element definitions for 1744 schema for basicsearch. 1745 April 8, 1998 - made changes based on last week's DASL BOF. 1746 May 8, 1998 Removed most of DAV:searcherror; converted to 1747 DAV:searchredirect 1748 Altered DAV:basicsearch grammar to use avoid use 1749 of ANY in DTD 1750 June 17, 1998 -Added details on Query Schema Discovery 1751 -Shortened list of data types 1752 June 23, 1998 moved data types before change history 1753 rewrote the data types section 1754 removed the casesensitive element and replace with 1755 the casesensitive attribute 1756 added the casesensitive attribute to the DTD for 1757 all operations that might work on a string 1758 Jul 20, 1998 A series of changes. See Author's meeting minutes 1759 for details. 1760 July 28, 1998 Changes as per author's meeting. QSD uses SEARCH, 1761 not PROPFIND. 1762 Moved text around to keep concepts nearby. 1763 Boolean literals are 1 and 0, not T and F. 1764 contains changed to contentspassthrough. 1765 Renamed rank to score. 1766 July 28, 1998 Added Dale Lowry as Author 1767 September 4, 1998 Added 422 as response when query lists 1768 unimplemented operators. 1770 DAV:literal declares a default value for 1771 xml:space, 'preserve' (see XML spec, section 2.10) 1772 moved to new XML namespace syntax 1773 September 22, 1998 Changed "simplesearch" to "basicsearch" 1774 Changed isnull to isdefined 1775 Defined NULLness as having a 404 or 403 response 1776 used ENTITY syntax in DTD 1777 Added redirect 1778 October 9, 1998 Fixed a series of typographical and formatting 1779 errors. 1780 Modified the section of three-valued logic to use 1781 a table rather than a text description of the role 1782 of UNKNOWN in expressions. 1783 November 2, 1998 Added the DAV:contains operator. 1784 Removed the DAV:contentpassthrough operator. 1785 November 18, 1998 Various author comments for submission 1786 June 3, 1999 Cosmetic and minor editorial changes only. Fix 1787 nits reported by Jim Whitehead in email of April 1788 26, 1999. Converted to HTML from Word 97, 1789 manually. 1790 April 20, 2000 Removed redirection feature, since 301/302 1791 suffices. Removed Query Schema Discovery (former 1792 chapter 4). Everyone agrees this is a useful 1793 feature, but it is apparently too difficult to 1794 define at this time, and it is not essential for 1795 DASL. 1797 B.2 since start of draft-reschke-webdav-search 1799 October 09, 2001 Added Julian Reschke as author. 1800 Chapter about QSD re-added. 1801 Formatted into RFC2629-compliant XML document. 1802 Added first comments. 1803 ID version number kicked up to draft-dasl- 1804 protocol-03. 1805 October 17, 2001 Updated address information for Jim Davis. 1806 Added issue of datatype vocabularies. 1807 Updated issue descriptions for grammar discovery, 1808 added issues on query schema DTD. 1809 Fixed typos in XML examples. 1810 December 17, 2001 Re-introduced split between normative and non- 1811 normative references. 1813 January 05, 2002 Version bumbed up to 04. Started work on resolving 1814 the issues identified in the previous version. 1815 January 14, 2002 Fixed some XML typos. 1816 January 22, 2002 Closed issues naming-of-elements. Fixed query 1817 search DTD and added option to discover properties 1818 of "other" (non-listed) properties. 1819 January 25, 2002 Changed into private submission and added reference 1820 to historic DASL draft. Marked reference to DASL 1821 requirements non-normative. 1822 Updated reference to latest deltav spec. 1823 January 29, 2002 Added feedback from and updated contact info for 1824 Alan Babich. 1825 Included open issues collected in 1826 http://www.webdav.org/dasl/protocol/issues.html. 1827 February 8, 2002 Made sure that all artwork fits into 72 characters 1828 wide text. 1829 February 18, 2002 Changed Insufficient storage handling 1830 (multistatus). Moved is-collection to operators and 1831 added to DTD. Made scope/depth mandatory. 1832 February 20, 2002 Updated reference to SQL99. 1833 February 28, 2002 "Non-normative References" -> "Informative 1834 References". Abstract updated. Consistently specify 1835 a charset when using text/xml (no change bars). Do 1836 not attempt to define PROPFIND's entity encoding 1837 (take out specific references to text/xml). Remove 1838 irrelevant headers (Connection:) from examples (no 1839 change bars). Added issue on querying based on 1840 DAV:href. Updated introduction to indicate 1841 relationship to DASL draft. Updated HTTP reference 1842 from RFC2068 to RFC2616. Updated XML reference to 1843 XML 1.0 2nd edition. 1844 March 1, 2002 Removed superfluous namespace decl in 2.4.2. 1845 Reopened JW14 and suggest to drop xml:space 1846 support. 1847 March 3, 2002 Removed "xml:space" feature on DAV:literal. Added 1848 issue about string comparison vs. collations vs. 1849 xml:lang. Updated some of the open issues with 1850 details from JimW's original mail in April 1999. 1851 Resolved scope vs relative URI references. Resolved 1852 issues about DAV:ascending (added to index) and the 1853 BNF for DAV:like (changed "octets" to 1854 "characters"). 1855 March 8, 2002 Updated reference to DeltaV (now RFC3253). Added 1856 Martin Wallmer's comments, moved JW5 into 1857 DAV:basicsearch section. 1858 March 11, 2002 Closed open issues regaring the type of search 1859 arbiters (JW3) and their discovery (JW9). Rephrased 1860 requirements on multistatus response bodies 1861 (propstat only if properties were selected, removed 1862 requirement for responsedescription). 1863 March 23, 2002 RFC2376 -> RFC3023. Added missing first names of 1864 authors. OPTIONS added to example for 1865 DAV:supported-method-set. 1867 B.3 since draft-reschke-webdav-search-00 1869 March 29, 2002 Abstract doesn't refer to DASL WG anymore. 1870 April 7, 2002 Fixed section title (wrong property name supported- 1871 search-grammar-set. Changed DAV:casesensitve to 1872 "casesensitive" (it wasn't in the DAV: namespace after 1873 all). 1874 May 28, 2002 Updated some issues with Jim Davis's comments. 1875 June 10, 2002 Added proposal for different method for query schema 1876 discovery, not using pseudo-properties. 1877 June 25, 2002 QSD marshalling rewritten. Added issue "isdefined- 1878 optional". 1880 B.4 since draft-reschke-webdav-search-01 1882 July 04, 2002 Added issue "scope-collection". 1883 July 08, 2002 Closed issue "scope-collection". 1884 August 12, 2002 Added issues "results-vs-binds" and "select- 1885 allprop". 1886 October 22, 2002 Added issue "undefined-expressions". 1887 November 18, 2002 Changed example host names (no change tracking). 1888 November 25, 2002 Updated issue "DB2/DB7". Closed issues "undefined 1889 expressions", "isdefined-optional" and "select- 1890 allprop". 1892 B.5 since draft-reschke-webdav-search-02 1893 November 27, 2002 Added issues "undefined-properties", "like- 1894 exactlyone" and "like-wildcard-adjacent". Closed 1895 issue "query-on-href". Added acknowledgments 1896 section. 1897 November 28, 2002 Closed issue "like-exactlyone". Added issue "mixed- 1898 content-properties". 1899 December 14, 2002 Closed issues "undefined-properties", "results-vs- 1900 binds", "mixed-content-properties". Updated issue 1901 "like-wildcard-adjacent". Added informative 1902 reference to BIND draft. Updated reference to ACL 1903 draft. 1904 January 9, 2003 Removed duplicate section on invalid scopes. Added 1905 comments to some open issues. Closed issues 1906 JW25/26, score-pseudo-property and null-ordering. 1907 January 10, 2003 Issue limit-vs-ordering plus resolution. Closed 1908 issue JW17/JW24b. 1909 January 14, 2003 New issue order-precedence. Started resolution of 1910 DB2/DB7. 1911 January 15, 2003 Started spec of DAV:typed-literal. 1912 January 17, 2003 Fix one DAV:like/DAV:getcontenttype example (add / 1913 to like expression, make case-insensitive). 1914 January 28, 2003 Update issue(s) result-truncation, JW24d. Fixed 1915 response headers in OPTIONS example. Added issue 1916 qsd-optional. Closed issue(s) order-precedence, 1917 case-insensitivity-name. 1918 February 07, 2003 Added issue scope-vs-versions. score-pseudo- 1919 property: allow DAV:orderby to explicitly specify 1920 DAV:score. 1922 Index 1924 D 1926 DAV:ascending 1927 XML element 5.6 1929 DAV:descending 1930 XML element 5.6 1932 DAV:limit 1933 XML element 5.17 1935 DAV:nresults 1936 XML element 5.17 1938 DAV:score 1939 XML element 5.16.1 1940 relationship to DAV:orderby 5.17.1 1942 DAV:searchrequest 1943 XML element 2.3 1945 DAV:supported-query-grammar-set 1946 property 3.3 1948 O 1950 OPTIONS method 1951 3.1DASL response header 3.2 1953 Q 1955 Query Grammar Discovery 1956 3using OPTIONS 3.1 1957 using live property 3.3 1959 R 1961 Result Set Truncation 1962 Example 2.4.3 1964 S 1966 Scope 1967 Invalid 2.6 1969 SEARCH method 1970 2 1972 Full Copyright Statement 1974 Copyright (C) The Internet Society (2003). All Rights Reserved. 1976 This document and translations of it may be copied and furnished 1977 to others, and derivative works that comment on or otherwise 1978 explain it or assist in its implementation may be prepared, 1979 copied, published and distributed, in whole or in part, without 1980 restriction of any kind, provided that the above copyright notice 1981 and this paragraph are included on all such copies and derivative 1982 works. However, this document itself may not be modified in any 1983 way, such as by removing the copyright notice or references to the 1984 Internet Society or other Internet organizations, except as needed 1985 for the purpose of developing Internet standards in which case the 1986 procedures for copyrights defined in the Internet Standards 1987 process must be followed, or as required to translate it into 1988 languages other than English. 1990 The limited permissions granted above are perpetual and will not 1991 be revoked by the Internet Society or its successors or assigns. 1993 This document and the information contained herein is provided on 1994 an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET 1995 ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR 1996 IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF 1997 THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED 1998 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. 2000 Acknowledgement 2002 Funding for the RFC editor function is currently provided by the 2003 Internet Society.