1
2
3
4
5
6
7Network Working Group J. Reschke, Ed.
8Request for Comments: 5323 greenbytes
9Category: Standards Track S. Reddy
10 Mitrix
11 J. Davis
12
13 A. Babich
14 IBM
15 November 2008
16
17
18 Web Distributed Authoring and Versioning (WebDAV) SEARCH
19
20Status of This Memo
21
22 This document specifies an Internet standards track protocol for the
23 Internet community, and requests discussion and suggestions for
24 improvements. Please refer to the current edition of the "Internet
25 Official Protocol Standards" (STD 1) for the standardization state
26 and status of this protocol. Distribution of this memo is unlimited.
27
28Copyright Notice
29
30 Copyright (c) 2008 IETF Trust and the persons identified as the
31 document authors. All rights reserved.
32
33 This document is subject to BCP 78 and the IETF Trust's Legal
34 Provisions Relating to IETF Documents (http://trustee.ietf.org/
35 license-info) in effect on the date of publication of this document.
36 Please review these documents carefully, as they describe your rights
37 and restrictions with respect to this document.
38
39Abstract
40
41 This document specifies a set of methods, headers, and properties
42 composing Web Distributed Authoring and Versioning (WebDAV) SEARCH,
43 an application of the HTTP/1.1 protocol to efficiently search for DAV
44 resources based upon a set of client-supplied criteria.
45
46
47
48
49
50
51
52
53
54
55
56
57
58Reschke, et al. Standards Track [Page 1]
59
60RFC 5323 WebDAV SEARCH November 2008
61
62
63Table of Contents
64
65 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
66 1.1. DASL . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
67 1.2. Relationship to DAV . . . . . . . . . . . . . . . . . . . 4
68 1.3. Terms . . . . . . . . . . . . . . . . . . . . . . . . . . 5
69 1.4. Notational Conventions . . . . . . . . . . . . . . . . . . 6
70 1.5. Note on Usage of 'DAV:' XML Namespace . . . . . . . . . . 7
71 1.6. An Overview of DASL at Work . . . . . . . . . . . . . . . 7
72 2. The SEARCH Method . . . . . . . . . . . . . . . . . . . . . . 7
73 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 7
74 2.2. The Request . . . . . . . . . . . . . . . . . . . . . . . 8
75 2.2.1. The Request-URI . . . . . . . . . . . . . . . . . . . 8
76 2.2.2. The Request Body . . . . . . . . . . . . . . . . . . . 8
77 2.3. The Successful 207 (Multistatus) Response . . . . . . . . 9
78 2.3.1. Result Set Truncation . . . . . . . . . . . . . . . . 9
79 2.3.2. Extending the PROPFIND Response . . . . . . . . . . . 10
80 2.3.3. Example: A Simple Request and Response . . . . . . . . 10
81 2.3.4. Example: Result Set Truncation . . . . . . . . . . . . 11
82 2.4. Unsuccessful Responses . . . . . . . . . . . . . . . . . . 12
83 2.4.1. Example of an Invalid Scope . . . . . . . . . . . . . 12
84 3. Discovery of Supported Query Grammars . . . . . . . . . . . . 13
85 3.1. The OPTIONS Method . . . . . . . . . . . . . . . . . . . . 13
86 3.2. The DASL Response Header . . . . . . . . . . . . . . . . . 14
87 3.3. DAV:supported-query-grammar-set (Protected) . . . . . . . 14
88 3.4. Example: Grammar Discovery . . . . . . . . . . . . . . . . 15
89 4. Query Schema Discovery: QSD . . . . . . . . . . . . . . . . . 17
90 4.1. Additional SEARCH Semantics . . . . . . . . . . . . . . . 17
91 4.1.1. Example of Query Schema Discovery . . . . . . . . . . 18
92 5. The DAV:basicsearch Grammar . . . . . . . . . . . . . . . . . 19
93 5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . . 19
94 5.2. The DAV:basicsearch DTD . . . . . . . . . . . . . . . . . 20
95 5.2.1. Example Query . . . . . . . . . . . . . . . . . . . . 22
96 5.3. DAV:select . . . . . . . . . . . . . . . . . . . . . . . . 23
97 5.4. DAV:from . . . . . . . . . . . . . . . . . . . . . . . . . 23
98 5.4.1. Relationship to the Request-URI . . . . . . . . . . . 23
99 5.4.2. Scope . . . . . . . . . . . . . . . . . . . . . . . . 24
100 5.5. DAV:where . . . . . . . . . . . . . . . . . . . . . . . . 24
101 5.5.1. Use of Three-Valued Logic in Queries . . . . . . . . . 24
102 5.5.2. Handling Optional Operators . . . . . . . . . . . . . 24
103 5.5.3. Treatment of NULL Values . . . . . . . . . . . . . . . 24
104 5.5.4. Treatment of Properties with Mixed/Element Content . . 25
105 5.5.5. Example: Testing for Equality . . . . . . . . . . . . 25
106 5.5.6. Example: Relative Comparisons . . . . . . . . . . . . 25
107 5.6. DAV:orderby . . . . . . . . . . . . . . . . . . . . . . . 26
108 5.6.1. Example of Sorting . . . . . . . . . . . . . . . . . . 26
109 5.7. Boolean Operators: DAV:and, DAV:or, and DAV:not . . . . . 26
110 5.8. DAV:eq . . . . . . . . . . . . . . . . . . . . . . . . . . 27
111
112
113
114Reschke, et al. Standards Track [Page 2]
115
116RFC 5323 WebDAV SEARCH November 2008
117
118
119 5.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte . . . . . . . . . . . . . 27
120 5.10. DAV:literal . . . . . . . . . . . . . . . . . . . . . . . 27
121 5.11. DAV:typed-literal (Optional) . . . . . . . . . . . . . . . 28
122 5.11.1. Example for Typed Numerical Comparison . . . . . . . . 28
123 5.12. Support for Matching xml:lang Attributes on Properties . . 29
124 5.12.1. DAV:language-defined (Optional) . . . . . . . . . . . 29
125 5.12.2. DAV:language-matches (Optional) . . . . . . . . . . . 29
126 5.12.3. Example of Language-Aware Matching . . . . . . . . . . 29
127 5.13. DAV:is-collection . . . . . . . . . . . . . . . . . . . . 30
128 5.13.1. Example of DAV:is-collection . . . . . . . . . . . . . 30
129 5.14. DAV:is-defined . . . . . . . . . . . . . . . . . . . . . . 30
130 5.15. DAV:like . . . . . . . . . . . . . . . . . . . . . . . . . 30
131 5.15.1. Syntax for the Literal Pattern . . . . . . . . . . . . 31
132 5.15.2. Example of DAV:like . . . . . . . . . . . . . . . . . 31
133 5.16. DAV:contains . . . . . . . . . . . . . . . . . . . . . . . 31
134 5.16.1. Result Scoring (DAV:score Element) . . . . . . . . . . 32
135 5.16.2. Ordering by Score . . . . . . . . . . . . . . . . . . 33
136 5.16.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 33
137 5.17. Limiting the Result Set . . . . . . . . . . . . . . . . . 33
138 5.17.1. Relationship to Result Ordering . . . . . . . . . . . 33
139 5.18. The 'caseless' XML Attribute . . . . . . . . . . . . . . . 34
140 5.19. Query Schema for DAV:basicsearch . . . . . . . . . . . . . 34
141 5.19.1. DTD for DAV:basicsearch QSD . . . . . . . . . . . . . 34
142 5.19.2. DAV:propdesc Element . . . . . . . . . . . . . . . . . 35
143 5.19.3. The DAV:datatype Property Description . . . . . . . . 35
144 5.19.4. The DAV:searchable Property Description . . . . . . . 36
145 5.19.5. The DAV:selectable Property Description . . . . . . . 36
146 5.19.6. The DAV:sortable Property Description . . . . . . . . 36
147 5.19.7. The DAV:caseless Property Description . . . . . . . . 36
148 5.19.8. The DAV:operators XML Element . . . . . . . . . . . . 37
149 5.19.9. Example of Query Schema for DAV:basicsearch . . . . . 38
150 6. Internationalization Considerations . . . . . . . . . . . . . 39
151 7. Security Considerations . . . . . . . . . . . . . . . . . . . 39
152 7.1. Implications of XML External Entities . . . . . . . . . . 39
153 8. Scalability . . . . . . . . . . . . . . . . . . . . . . . . . 40
154 9. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 40
155 9.1. HTTP Headers . . . . . . . . . . . . . . . . . . . . . . . 40
156 9.1.1. DASL . . . . . . . . . . . . . . . . . . . . . . . . . 40
157 10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 41
158 11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 41
159 12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 41
160 12.1. Normative References . . . . . . . . . . . . . . . . . . . 41
161 12.2. Informative References . . . . . . . . . . . . . . . . . . 42
162 Appendix A. Three-Valued Logic in DAV:basicsearch . . . . . . . . 44
163 Appendix B. Candidates for Future Protocol Extensions . . . . . . 45
164 B.1. Collation Support . . . . . . . . . . . . . . . . . . . . 45
165 B.2. Count . . . . . . . . . . . . . . . . . . . . . . . . . . 46
166 B.3. Diagnostics for Unsupported Queries . . . . . . . . . . . 46
167
168
169
170Reschke, et al. Standards Track [Page 3]
171
172RFC 5323 WebDAV SEARCH November 2008
173
174
175 B.4. Language Matching . . . . . . . . . . . . . . . . . . . . 46
176 B.5. Matching Media Types . . . . . . . . . . . . . . . . . . . 46
177 B.6. Query by Name . . . . . . . . . . . . . . . . . . . . . . 46
178 B.7. Result Paging . . . . . . . . . . . . . . . . . . . . . . 46
179 B.8. Search Scope Discovery . . . . . . . . . . . . . . . . . . 47
180 Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
181
1821. Introduction
183
1841.1. DASL
185
186 This document defines Web Distributed Authoring and Versioning
187 (WebDAV) SEARCH, an application of HTTP/1.1 forming a lightweight
188 search protocol to transport queries and result sets that allows
189 clients to make use of server-side search facilities. It is based on
190 earlier work done in the IETF DASL Working Group (see Section 10).
191 In this specification, the terms "WebDAV SEARCH" and "DASL" are used
192 interchangeably.
193
194 DASL minimizes the complexity of clients so as to facilitate
195 widespread deployment of applications capable of utilizing the DASL
196 search mechanisms.
197
198 DASL consists of:
199
200 o the SEARCH method and the request/response formats defined for it
201 (Section 2),
202
203 o feature discovery through the "DASL" response header and the
204 optional DAV:supported-grammar-set property (Section 3),
205
206 o optional grammar schema discovery (Section 4), and
207
208 o one mandatory grammar: DAV:basicsearch (Section 5).
209
2101.2. Relationship to DAV
211
212 DASL relies on the resource and property model defined by [RFC4918].
213 DASL does not alter this model. Instead, DASL allows clients to
214 access DAV-modeled resources through server-side search.
215
216
217
218
219
220
221
222
223
224
225
226Reschke, et al. Standards Track [Page 4]
227
228RFC 5323 WebDAV SEARCH November 2008
229
230
2311.3. Terms
232
233 This document uses the terms defined in [RFC2616], [RFC4918],
234 [RFC3253], and in this section.
235
236 Criteria
237
238 An expression against which each resource in the search scope is
239 evaluated.
240
241 Query
242
243 A query is a combination of a search scope, search criteria,
244 result record definition, sort specification, and a search
245 modifier.
246
247 Query Grammar
248
249 A set of definitions of XML elements, attributes, and constraints
250 on their relations and values that defines a set of queries and
251 the intended semantics.
252
253 Query Schema
254
255 A listing, for any given grammar and scope, of the properties and
256 operators that may be used in a query with that grammar and scope.
257
258 Result
259
260 A result is a result set, optionally augmented with other
261 information describing the search as a whole.
262
263 Result Record
264
265 A description of a resource. A result record is a set of
266 properties, and possibly other descriptive information.
267
268 Result Record Definition
269
270 A specification of the set of properties to be returned in the
271 result record.
272
273 Result Set
274
275 A set of records, one for each resource for which the search
276 criteria evaluated to True.
277
278
279
280
281
282Reschke, et al. Standards Track [Page 5]
283
284RFC 5323 WebDAV SEARCH November 2008
285
286
287 Scope
288
289 A set of resources to be searched.
290
291 Search Arbiter
292
293 A resource that supports the SEARCH method.
294
295 Search Modifier
296
297 An instruction that governs the execution of the query but is not
298 part of the search scope, result record definition, the search
299 criteria, or the sort specification. An example of a search
300 modifier is one that controls how much time the server can spend
301 on the query before giving a response.
302
303 Sort Specification
304
305 A specification of an ordering on the result records in the result
306 set.
307
3081.4. Notational Conventions
309
310 This specification uses the Augmented Backus-Naur Form (ABNF)
311 notation of [RFC5234], unless explicitly stated otherwise.
312
313 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
314 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
315 document are to be interpreted as described in [RFC2119].
316
317 This document uses XML DTD fragments ([XML], Section 3.2) as a purely
318 notational convention. WebDAV request and response bodies cannot be
319 validated by a DTD due to the specific extensibility rules defined in
320 Section 17 of [RFC4918] and due to the fact that all XML elements
321 defined by this specification use the XML namespace name "DAV:". In
322 particular:
323
324 1. element names use the "DAV:" namespace,
325
326 2. element ordering is irrelevant unless explicitly stated,
327
328 3. extension elements (elements not already defined as valid child
329 elements) may be added anywhere, except when explicitly stated
330 otherwise,
331
332 4. extension attributes (attributes not already defined as valid for
333 this element) may be added anywhere, except when explicitly
334 stated otherwise.
335
336
337
338Reschke, et al. Standards Track [Page 6]
339
340RFC 5323 WebDAV SEARCH November 2008
341
342
343 When an XML element type in the "DAV:" namespace is referenced in
344 this document outside of the context of an XML fragment, the string
345 "DAV:" will be prefixed to the element type.
346
347 Similarly, when an XML element type in the namespace
348 "http://www.w3.org/2001/XMLSchema" is referenced in this document
349 outside of the context of an XML fragment, the string "xs:" will be
350 prefixed to the element type.
351
352 This document inherits, and sometimes extends, DTD productions from
353 Section 14 of [RFC4918].
354
3551.5. Note on Usage of 'DAV:' XML Namespace
356
357 This specification defines elements, properties, and condition names
358 in the XML namespace "DAV:". In general, only specifications
359 authored by IETF working groups are supposed to do this. In this
360 case an exception was made, because WebDAV SEARCH started its life in
361 the IETF DASL working group (<http://www.webdav.org/dasl/>, and at
362 the time the working group closed down there was already significant
363 deployment of this specification.
364
3651.6. An Overview of DASL at Work
366
367 One can express the basic usage of DASL in the following steps:
368
369 o The client constructs a query using the DAV:basicsearch grammar.
370
371 o The client invokes the SEARCH method on a resource that will
372 perform the search (the search arbiter) and includes a text/xml or
373 application/xml request entity that contains the query.
374
375 o The search arbiter performs the query.
376
377 o The search arbiter sends the results of the query back to the
378 client in the response. The server MUST send an entity that
379 matches the WebDAV multistatus format ([RFC4918], Section 13).
380
3812. The SEARCH Method
382
3832.1. Overview
384
385 The client invokes the SEARCH method to initiate a server-side
386 search. The body of the request defines the query. The server MUST
387 emit an entity matching the WebDAV multistatus format ([RFC4918],
388 Section 13).
389
390
391
392
393
394Reschke, et al. Standards Track [Page 7]
395
396RFC 5323 WebDAV SEARCH November 2008
397
398
399 The SEARCH method plays the role of transport mechanism for the query
400 and the result set. It does not define the semantics of the query.
401 The type of the query defines the semantics.
402
403 SEARCH is a safe method; it does not have any significance other than
404 executing a query and returning a query result (see [RFC2616],
405 Section 9.1.1).
406
4072.2. The Request
408
409 The client invokes the SEARCH method on the resource named by the
410 Request-URI.
411
4122.2.1. The Request-URI
413
414 The Request-URI identifies the search arbiter. Any HTTP resource may
415 function as search arbiter. It is not a new type of resource (in the
416 sense of DAV:resourcetype as defined in [RFC4918], Section 15.9), nor
417 does it have to be a WebDAV-compliant resource.
418
419 The SEARCH method defines no relationship between the arbiter and the
420 scope of the search; rather, the particular query grammar used in the
421 query defines the relationship. For example, a query grammar may
422 force the Request-URI to correspond exactly to the search scope.
423
4242.2.2. The Request Body
425
426 The server MUST process a text/xml or application/xml request body,
427 and MAY process request bodies in other formats. See [RFC3023] for
428 guidance on packaging XML in requests.
429
430 Marshalling:
431
432 If a request body with content type text/xml or application/xml is
433 included, it MUST be either a DAV:searchrequest or a DAV:query-
434 schema-discovery XML element. Its single child element identifies
435 the query grammar.
436
437 For DAV:searchrequest, the definition of search criteria, the
438 result record, and any other details needed to perform the search
439 depend on the individual search grammar.
440
441 For DAV:query-schema-discovery, the semantics is defined in
442 Section 4.
443
444
445
446
447
448
449
450Reschke, et al. Standards Track [Page 8]
451
452RFC 5323 WebDAV SEARCH November 2008
453
454
455 Preconditions:
456
457 (DAV:search-grammar-discovery-supported): when an XML request body
458 is present and has a DAV:query-schema-discovery document element,
459 the server MUST support the query schema discovery mechanism
460 described in Section 4.
461
462 (DAV:search-grammar-supported): when an XML request body is
463 present, the search grammar identified by the document element's
464 child element must be a supported search grammar.
465
466 (DAV:search-multiple-scope-supported): if the SEARCH request
467 specified multiple scopes, the server MUST support this optional
468 feature.
469
470 (DAV:search-scope-valid): the supplied search scope must be valid.
471 There can be various reasons for a search scope to be invalid,
472 including unsupported URI schemes and communication problems.
473 Servers MAY add [RFC4918] compliant DAV:response elements as
474 content to the condition element indicating the precise reason for
475 the failure.
476
4772.3. The Successful 207 (Multistatus) Response
478
479 If the server returns 207 (Multistatus), then the search proceeded
480 successfully, and the response MUST use the WebDAV multistatus format
481 ([RFC4918], Section 13). The results of this method SHOULD NOT be
482 cached.
483
484 There MUST be one DAV:response for each resource that matched the
485 search criteria. For each such response, the DAV:href element
486 contains the URI of the resource, and the response MUST include a
487 DAV:propstat element.
488
489 Note: the WebDAV multistatus format requires at least one DAV:
490 response child element. This specification relaxes that
491 restriction so that empty results can be represented.
492
493 Note that for each matching resource found, there may be multiple
494 URIs within the search scope mapped to it. In this case, a server
495 SHOULD report only one of these URIs. Clients can use the live
496 property DAV:resource-id, defined in Section 3.1 of [WEBDAV-BIND] to
497 identify possible duplicates.
498
4992.3.1. Result Set Truncation
500
501 A server MAY limit the number of resources in a reply, for example,
502 to limit the amount of resources expended in processing a query. If
503
504
505
506Reschke, et al. Standards Track [Page 9]
507
508RFC 5323 WebDAV SEARCH November 2008
509
510
511 it does so, the reply MUST use status code 207, return a DAV:
512 multistatus response body, and indicate a status of 507 (Insufficient
513 Storage) for the search arbiter URI. It SHOULD include the partial
514 results.
515
516 When a result set is truncated, there may be many more resources that
517 satisfy the search criteria but that were not examined.
518
519 If partial results are included and the client requested an ordered
520 result set in the original request, then any partial results that are
521 returned MUST be ordered as the client directed.
522
523 Note that the partial results returned MAY be any subset of the
524 result set that would have satisfied the original query.
525
5262.3.2. Extending the PROPFIND Response
527
528 A response MAY include more information than PROPFIND defines, so
529 long as the extra information does not invalidate the PROPFIND
530 response. Query grammars SHOULD define how the response matches the
531 PROPFIND response.
532
5332.3.3. Example: A Simple Request and Response
534
535 This example demonstrates the request and response framework. The
536 following XML document shows a simple (hypothetical) natural language
537 query. The name of the query element is natural-language-query in
538 the XML namespace "http://example.com/foo". The actual query is
539 "Find the locations of good Thai restaurants in Los Angeles". For
540 this hypothetical query, the arbiter returns two properties for each
541 selected resource.
542
543 >> Request:
544
545 SEARCH / HTTP/1.1
546 Host: example.org
547 Content-Type: application/xml; charset="utf-8"
548 Content-Length: 252
549
550 <?xml version="1.0" encoding="UTF-8"?>
551 <D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo">
552 <F:natural-language-query>
553 Find the locations of good Thai restaurants in Los Angeles
554 </F:natural-language-query>
555 </D:searchrequest>
556
557
558
559
560
561
562Reschke, et al. Standards Track [Page 10]
563
564RFC 5323 WebDAV SEARCH November 2008
565
566
567 >> Response:
568
569 HTTP/1.1 207 Multi-Status
570 Content-Type: text/xml; charset="utf-8"
571 Content-Length: 429
572
573 <?xml version="1.0" encoding="UTF-8"?>
574 <D:multistatus xmlns:D="DAV:"
575 xmlns:R="http://example.org/propschema">
576 <D:response>
577 <D:href>http://siamiam.example/</D:href>
578 <D:propstat>
579 <D:prop>
580 <R:location>259 W. Hollywood</R:location>
581 <R:rating><R:stars>4</R:stars></R:rating>
582 </D:prop>
583 <D:status>HTTP/1.1 200 OK</D:status>
584 </D:propstat>
585 </D:response>
586 </D:multistatus>
587
5882.3.4. Example: Result Set Truncation
589
590 In the example below, the server returns just two results, and then
591 indicates that the result is truncated by adding a DAV:response
592 element for the search arbiter resource with 507 (Insufficient
593 Storage) status.
594
595 >> Request:
596
597 SEARCH / HTTP/1.1
598 Host: example.net
599 Content-Type: text/xml; charset="utf-8"
600 Content-Length: xxx
601
602 ... the query goes here ...
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618Reschke, et al. Standards Track [Page 11]
619
620RFC 5323 WebDAV SEARCH November 2008
621
622
623 >> Response:
624
625 HTTP/1.1 207 Multistatus
626 Content-Type: text/xml; charset="utf-8"
627 Content-Length: 640
628
629 <?xml version="1.0" encoding="utf-8"?>
630 <D:multistatus xmlns:D="DAV:">
631 <D:response>
632 <D:href>http://www.example.net/sounds/unbrokenchain.au</D:href>
633 <D:status>HTTP/1.1 200 OK</D:status>
634 </D:response>
635 <D:response>
636 <D:href>http://tech.mit.example/arch96/photos/Lesh1.jpg</D:href>
637 <D:status>HTTP/1.1 200 OK</D:status>
638 </D:response>
639 <D:response>
640 <D:href>http://example.net</D:href>
641 <D:status>HTTP/1.1 507 Insufficient Storage</D:status>
642 <D:responsedescription xml:lang="en">
643 Only first two matching records were returned
644 </D:responsedescription>
645 </D:response>
646 </D:multistatus>
647
6482.4. Unsuccessful Responses
649
650 If a SEARCH request could not be executed or the attempt to execute
651 it resulted in an error, the server MUST indicate the failure with an
652 appropriate status code and SHOULD add a response body as defined in
653 Section 1.6 of [RFC3253]. Unless otherwise stated, condition
654 elements are empty; however, specific condition elements MAY include
655 additional child elements that describe the error condition in more
656 detail.
657
6582.4.1. Example of an Invalid Scope
659
660 In the example below, a request failed because the scope identifies a
661 HTTP resource that was not found.
662
663
664
665
666
667
668
669
670
671
672
673
674Reschke, et al. Standards Track [Page 12]
675
676RFC 5323 WebDAV SEARCH November 2008
677
678
679 >> Response:
680
681 HTTP/1.1 409 Conflict
682 Content-Type: text/xml; charset="utf-8"
683 Content-Length: 275
684
685 <?xml version="1.0" encoding="UTF-8"?>
686 <d:error xmlns:d="DAV:">
687 <d:search-scope-valid>
688 <d:response>
689 <d:href>http://www.example.com/X</d:href>
690 <d:status>HTTP/1.1 404 Object Not Found</d:status>
691 </d:response>
692 </d:search-scope-valid>
693 </d:error>
694
6953. Discovery of Supported Query Grammars
696
697 Servers MUST support discovery of the query grammars supported by a
698 search arbiter resource.
699
700 Clients can determine which query grammars are supported by an
701 arbiter by invoking OPTIONS on the search arbiter. If the resource
702 supports SEARCH, then the DASL response header will appear in the
703 response. The DASL response header lists the supported grammars.
704
705 Servers supporting the WebDAV extensions [RFC3253] and/or [RFC3744]
706 MUST also:
707
708 o report SEARCH in the live property DAV:supported-method-set for
709 all search arbiter resources, and
710
711 o support the live property DAV:supported-query-grammar-set as
712 defined in Section 3.3.
713
7143.1. The OPTIONS Method
715
716 The OPTIONS method allows the client to discover if a resource
717 supports the SEARCH method and to determine the list of search
718 grammars supported for that resource.
719
720 The client issues the OPTIONS method against a resource named by the
721 Request-URI. This is a normal invocation of OPTIONS as defined in
722 Section 9.2 of [RFC2616].
723
724
725
726
727
728
729
730Reschke, et al. Standards Track [Page 13]
731
732RFC 5323 WebDAV SEARCH November 2008
733
734
735 If a resource supports the SEARCH method, then the server MUST list
736 SEARCH in the Allow header defined in Section 14.7 of [RFC2616].
737
738 DASL servers MUST include the DASL header in the OPTIONS response.
739 This header identifies the search grammars supported by that
740 resource.
741
7423.2. The DASL Response Header
743
744 DASLHeader = "DASL" ":" 1#Coded-URL
745 Coded-URL = <defined in Section 10.1 of [RFC4918]>
746
747 (This grammar uses the augmented BNF format defined in Section 2.1 of
748 [RFC2616].)
749
750 The DASL response header indicates server support for query grammars
751 in the OPTIONS method. The value is a list of URIs that indicate the
752 types of supported grammars. Note that although the URIs can be used
753 to identify each supported search grammar, there is not necessarily a
754 direct relationship between the URI and the XML element name that can
755 be used in XML based SEARCH requests (the element name itself is
756 identified by its namespace name (a URI reference) and the element's
757 local name).
758
759 Note: this header field value is defined as a comma-separated list
760 ([RFC2616], Section 4.2); thus, grammar URIs can appear in
761 multiple header instances, separated by commas, or both.
762
763 For example:
764
765 DASL: <http://foobar.example/syntax1>,
766 <http://akuma.example/syntax2>, <DAV:basicsearch>
767 DASL: <http://example.com/foo/natural-language-query>
768
7693.3. DAV:supported-query-grammar-set (Protected)
770
771 This WebDAV property is required for any server supporting either
772 [RFC3253] and/or [RFC3744] and identifies the XML-based query
773 grammars that are supported by the search arbiter resource.
774
775 <!ELEMENT supported-query-grammar-set (supported-query-grammar*)>
776 <!ELEMENT supported-query-grammar (grammar)>
777 <!ELEMENT grammar ANY>
778 <!-- ANY value: a query grammar element type -->
779
780
781
782
783
784
785
786Reschke, et al. Standards Track [Page 14]
787
788RFC 5323 WebDAV SEARCH November 2008
789
790
7913.4. Example: Grammar Discovery
792
793 This example shows that the server supports search on the /somefolder
794 resource with the query grammars: DAV:basicsearch,
795 http://foobar.example/syntax1 and http://akuma.example/syntax2. Note
796 that servers supporting WebDAV SEARCH MUST support DAV:basicsearch.
797
798 >> Request:
799
800 OPTIONS /somefolder HTTP/1.1
801 Host: example.org
802
803 >> Response:
804
805 HTTP/1.1 200 OK
806 Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
807 Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
808 DASL: <DAV:basicsearch>
809 DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2>
810
811 This example shows the equivalent taking advantage of a server's
812 support for DAV:supported-method-set and DAV:supported-query-grammar-
813 set.
814
815 >> Request:
816
817 PROPFIND /somefolder HTTP/1.1
818 Host: example.org
819 Depth: 0
820 Content-Type: text/xml; charset="utf-8"
821 Content-Length: 165
822
823 <?xml version="1.0" encoding="UTF-8" ?>
824 <propfind xmlns="DAV:">
825 <prop>
826 <supported-query-grammar-set/>
827 <supported-method-set/>
828 </prop>
829 </propfind>
830
831
832
833
834
835
836
837
838
839
840
841
842Reschke, et al. Standards Track [Page 15]
843
844RFC 5323 WebDAV SEARCH November 2008
845
846
847 >> Response:
848
849 HTTP/1.1 207 Multi-Status
850 Content-Type: text/xml; charset="utf-8"
851 Content-Length: 1349
852
853 <?xml version="1.0" encoding="utf-8" ?>
854 <multistatus xmlns="DAV:">
855 <response>
856 <href>http://example.org/somefolder</href>
857 <propstat>
858 <prop>
859 <supported-query-grammar-set>
860 <supported-query-grammar>
861 <grammar><basicsearch/></grammar>
862 </supported-query-grammar>
863 <supported-query-grammar>
864 <grammar><syntax1 xmlns="http://foobar.example/"/></grammar>
865 </supported-query-grammar>
866 <supported-query-grammar>
867 <grammar><syntax2 xmlns="http://akuma.example/"/></grammar>
868 </supported-query-grammar>
869 </supported-query-grammar-set>
870 <supported-method-set>
871 <supported-method name="COPY" />
872 <supported-method name="DELETE" />
873 <supported-method name="GET" />
874 <supported-method name="HEAD" />
875 <supported-method name="LOCK" />
876 <supported-method name="MKCOL" />
877 <supported-method name="MOVE" />
878 <supported-method name="OPTIONS" />
879 <supported-method name="POST" />
880 <supported-method name="PROPFIND" />
881 <supported-method name="PROPPATCH" />
882 <supported-method name="PUT" />
883 <supported-method name="SEARCH" />
884 <supported-method name="TRACE" />
885 <supported-method name="UNLOCK" />
886 </supported-method-set>
887 </prop>
888 <status>HTTP/1.1 200 OK</status>
889 </propstat>
890 </response>
891 </multistatus>
892
893
894
895
896
897
898Reschke, et al. Standards Track [Page 16]
899
900RFC 5323 WebDAV SEARCH November 2008
901
902
903 Note that the query grammar element names marshalled as part of the
904 DAV:supported-query-grammar-set can be directly used as element names
905 in an XML-based query.
906
9074. Query Schema Discovery: QSD
908
909 Servers MAY support the discovery of the schema for a query grammar.
910
911 The DASL response header and the DAV:supported-query-grammar-set
912 property provide means for clients to discover the set of query
913 grammars supported by a resource. This alone is not sufficient
914 information for a client to generate a query. For example, the DAV:
915 basicsearch grammar defines a set of queries consisting of a set of
916 operators applied to a set of properties and values, but the grammar
917 itself does not specify which properties may be used in the query.
918 QSD for the DAV:basicsearch grammar allows a client to discover the
919 set of properties that are searchable, selectable, and sortable.
920 Moreover, although the DAV:basicsearch grammar defines a minimal set
921 of operators, it is possible that a resource might support additional
922 operators in a query. For example, a resource might support an
923 optional operator that can be used to express content-based queries
924 in a proprietary syntax. QSD allows a client to discover these
925 operators and their syntax. The set of discoverable quantities will
926 differ from grammar to grammar, but each grammar can define a means
927 for a client to discover what can be discovered.
928
929 In general, the schema for a given query grammar depends on both the
930 resource (the arbiter) and the scope. A given resource might have
931 access to one set of properties for one potential scope, and another
932 set for a different scope. For example, consider a server able to
933 search two distinct collections: one holding cooking recipes, the
934 other design documents for nuclear weapons. While both collections
935 might support properties such as author, title, and date, the first
936 might also define properties such as calories and preparation time,
937 while the second defined properties such as yield and applicable
938 patents. Two distinct arbiters indexing the same collection might
939 also have access to different properties. For example, the recipe
940 collection mentioned above might also be indexed by a value-added
941 server that also stored the names of chefs who had tested the recipe.
942 Note also that the available query schema might also depend on other
943 factors, such as the identity of the principal conducting the search,
944 but these factors are not exposed in this protocol.
945
9464.1. Additional SEARCH Semantics
947
948 Each query grammar supported by DASL defines its own syntax for
949 expressing the possible query schema. A client retrieves the schema
950 for a given query grammar on an arbiter resource with a given scope
951
952
953
954Reschke, et al. Standards Track [Page 17]
955
956RFC 5323 WebDAV SEARCH November 2008
957
958
959 by invoking the SEARCH method on that arbiter with that grammar and
960 scope and with a root element of DAV:query-schema-discovery rather
961 than DAV:searchrequest.
962
963 Marshalling:
964
965 The request body MUST be a DAV:query-schema-discovery element.
966
967 <!ELEMENT query-schema-discovery ANY>
968 <!-- ANY value: XML element specifying the query grammar
969 and the scope -->
970
971 The response body takes the form of a DAV:multistatus element
972 ([RFC4918], Section 13), where DAV:response is extended to hold
973 the returned query grammar inside a DAV:query-schema container
974 element.
975
976 <!ELEMENT response (href, status, query-schema?,
977 responsedescription?) >
978 <!ELEMENT query-schema ANY>
979
980 The content of this container is an XML element whose name and syntax
981 depend upon the grammar, and whose value may (and likely will) vary
982 depending upon the grammar, arbiter, and scope.
983
9844.1.1. Example of Query Schema Discovery
985
986 In this example, the arbiter is recipes.example, the grammar is DAV:
987 basicsearch, the scope is also recipes.example.
988
989 >> Request:
990
991 SEARCH / HTTP/1.1
992 Host: recipes.example
993 Content-Type: application/xml; charset="utf-8"
994 Content-Length: 258
995
996 <?xml version="1.0"?>
997 <query-schema-discovery xmlns="DAV:">
998 <basicsearch>
999 <from>
1000 <scope>
1001 <href>http://recipes.example</href>
1002 <depth>infinity</depth>
1003 </scope>
1004 </from>
1005 </basicsearch>
1006 </query-schema-discovery>
1007
1008
1009
1010Reschke, et al. Standards Track [Page 18]
1011
1012RFC 5323 WebDAV SEARCH November 2008
1013
1014
1015 >> Response:
1016
1017 HTTP/1.1 207 Multistatus
1018 Content-Type: application/xml; charset="utf-8"
1019 Content-Length: xxx
1020
1021 <?xml version="1.0"?>
1022 <multistatus xmlns="DAV:">
1023 <response>
1024 <href>http://recipes.example</href>
1025 <status>HTTP/1.1 200 OK</status>
1026 <query-schema>
1027 <basicsearchschema>
1028 <!-- (See Section 5.19 for
1029 the actual contents) -->
1030 </basicsearchschema>
1031 </query-schema>
1032 </response>
1033 </multistatus>
1034
1035 The query schema for DAV:basicsearch is defined in Section 5.19.
1036
10375. The DAV:basicsearch Grammar
1038
10395.1. Introduction
1040
1041 DAV:basicsearch uses an extensible XML syntax that allows clients to
1042 express search requests that are generally useful for WebDAV
1043 scenarios. DASL-extended servers MUST accept this grammar, and MAY
1044 accept other grammars.
1045
1046 DAV:basicsearch has several components:
1047
1048 o DAV:select provides the result record definition.
1049
1050 o DAV:from defines the scope.
1051
1052 o DAV:where defines the criteria.
1053
1054 o DAV:orderby defines the sort order of the result set.
1055
1056 o DAV:limit provides constraints on the query as a whole.
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066Reschke, et al. Standards Track [Page 19]
1067
1068RFC 5323 WebDAV SEARCH November 2008
1069
1070
10715.2. The DAV:basicsearch DTD
1072
1073 <!-- "basicsearch" element -->
1074
1075 <!ELEMENT basicsearch (select, from, where?, orderby?, limit?) >
1076
1077 <!-- "select" element -->
1078
1079 <!ELEMENT select (allprop | prop) >
1080
1081 <!-- "from" element -->
1082
1083 <!ELEMENT from (scope+) >
1084 <!ELEMENT scope (href, depth, include-versions?) >
1085 <!ELEMENT include-versions EMPTY >
1086
1087 <!-- "where" element -->
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122Reschke, et al. Standards Track [Page 20]
1123
1124RFC 5323 WebDAV SEARCH November 2008
1125
1126
1127 <!ENTITY % comp_ops "eq | lt | gt| lte | gte">
1128 <!ENTITY % log_ops "and | or | not">
1129 <!ENTITY % special_ops "is-collection | is-defined |
1130 language-defined | language-matches">
1131 <!ENTITY % string_ops "like">
1132 <!ENTITY % content_ops "contains">
1133
1134 <!ENTITY % all_ops "%comp_ops; | %log_ops; | %special_ops; |
1135 %string_ops; | %content_ops;">
1136
1137 <!ELEMENT where ( %all_ops; ) >
1138
1139 <!ELEMENT and ( %all_ops; )+ >
1140
1141 <!ELEMENT or ( %all_ops; )+ >
1142
1143 <!ELEMENT not ( %all_ops; ) >
1144
1145 <!ELEMENT lt (prop, (literal|typed-literal)) >
1146 <!ATTLIST lt caseless (yes|no) #IMPLIED>
1147
1148 <!ELEMENT lte (prop, (literal|typed-literal)) >
1149 <!ATTLIST lte caseless (yes|no) #IMPLIED>
1150
1151 <!ELEMENT gt (prop, (literal|typed-literal)) >
1152 <!ATTLIST gt caseless (yes|no) #IMPLIED>
1153
1154 <!ELEMENT gte (prop, (literal|typed-literal)) >
1155 <!ATTLIST gte caseless (yes|no) #IMPLIED>
1156
1157 <!ELEMENT eq (prop, (literal|typed-literal)) >
1158 <!ATTLIST eq caseless (yes|no) #IMPLIED>
1159
1160 <!ELEMENT literal (#PCDATA)>
1161 <!ELEMENT typed-literal (#PCDATA)>
1162 <!ATTLIST typed-literal xsi:type CDATA #IMPLIED>
1163
1164 <!ELEMENT is-collection EMPTY >
1165 <!ELEMENT is-defined (prop) >
1166
1167 <!ELEMENT language-defined (prop) >
1168 <!ELEMENT language-matches (prop, literal) >
1169
1170 <!ELEMENT like (prop, literal) >
1171 <!ATTLIST like caseless (yes|no) #IMPLIED>
1172
1173 <!ELEMENT contains (#PCDATA)>
1174
1175
1176
1177
1178Reschke, et al. Standards Track [Page 21]
1179
1180RFC 5323 WebDAV SEARCH November 2008
1181
1182
1183 <!-- "orderby" element -->
1184
1185 <!ELEMENT orderby (order+) >
1186 <!ELEMENT order ((prop | score), (ascending | descending)?)>
1187 <!ATTLIST order caseless (yes|no) #IMPLIED>
1188 <!ELEMENT ascending EMPTY>
1189 <!ELEMENT descending EMPTY>
1190
1191 <!-- "limit" element -->
1192
1193 <!ELEMENT limit (nresults) >
1194 <!ELEMENT nresults (#PCDATA) >
1195
11965.2.1. Example Query
1197
1198 This query retrieves the content length values for all resources
1199 located under the server's "/container1/" URI namespace whose length
1200 exceeds 10000 sorted ascending by size.
1201
1202 <d:searchrequest xmlns:d="DAV:">
1203 <d:basicsearch>
1204 <d:select>
1205 <d:prop><d:getcontentlength/></d:prop>
1206 </d:select>
1207 <d:from>
1208 <d:scope>
1209 <d:href>/container1/</d:href>
1210 <d:depth>infinity</d:depth>
1211 </d:scope>
1212 </d:from>
1213 <d:where>
1214 <d:gt>
1215 <d:prop><d:getcontentlength/></d:prop>
1216 <d:literal>10000</d:literal>
1217 </d:gt>
1218 </d:where>
1219 <d:orderby>
1220 <d:order>
1221 <d:prop><d:getcontentlength/></d:prop>
1222 <d:ascending/>
1223 </d:order>
1224 </d:orderby>
1225 </d:basicsearch>
1226 </d:searchrequest>
1227
1228
1229
1230
1231
1232
1233
1234Reschke, et al. Standards Track [Page 22]
1235
1236RFC 5323 WebDAV SEARCH November 2008
1237
1238
12395.3. DAV:select
1240
1241 DAV:select defines the result record, which is a set of properties
1242 and values. This document defines two possible values: DAV:allprop
1243 and DAV:prop, both defined in Section 14 of [RFC4918].
1244
12455.4. DAV:from
1246
1247 <!ELEMENT scope (href, depth, include-versions?) >
1248 <!ELEMENT include-versions EMPTY >
1249
1250 DAV:from defines the query scope. This contains one or more DAV:
1251 scope elements. Support for multiple scope elements is optional,
1252 however servers MUST fail a request specifying multiple DAV:scope
1253 elements if they can't support it (see Section 2.2.2, precondition
1254 DAV:search-multiple-scope-supported). The scope element contains
1255 mandatory DAV:href and DAV:depth elements.
1256
1257 DAV:href indicates the URI reference ([RFC3986], Section 4.1) to use
1258 as a scope.
1259
1260 When the scope is a collection, if DAV:depth is "0", the search
1261 includes only the collection. When it is "1", the search includes
1262 the collection and its immediate children. When it is "infinity", it
1263 includes the collection and all its progeny.
1264
1265 When the scope is not a collection, the depth is ignored and the
1266 search applies just to the resource itself.
1267
1268 If the server supports WebDAV Redirect Reference Resources
1269 ([RFC4437]) and the search scope contains a redirect reference
1270 resource, then it applies only to that resource, not to its target.
1271
1272 When the child element DAV:include-versions is present, the search
1273 scope will include all versions (see [RFC3253], Section 2.2.1) of all
1274 version-controlled resources in scope. Servers that do support
1275 versioning but do not support the DAV:include-versions feature MUST
1276 signal an error if it is used in a query (see Section 2.2.2,
1277 precondition DAV:search-scope-valid).
1278
12795.4.1. Relationship to the Request-URI
1280
1281 If the DAV:scope element is a URI ([RFC3986], Section 3), the scope
1282 is exactly that URI.
1283
1284 If the DAV:scope element is a relative reference ([RFC3986], Section
1285 4.2), the scope is taken to be relative to the Request-URI.
1286
1287
1288
1289
1290Reschke, et al. Standards Track [Page 23]
1291
1292RFC 5323 WebDAV SEARCH November 2008
1293
1294
12955.4.2. Scope
1296
1297 A Scope can be an arbitrary URI reference.
1298
1299 Servers, of course, may support only particular scopes. This may
1300 include limitations for particular schemes such as "http:" or "ftp:"
1301 or certain URI namespaces. However, WebDAV-compliant search arbiters
1302 minimally SHOULD support scopes that match their own URI.
1303
13045.5. DAV:where
1305
1306 The DAV:where element defines the search condition for inclusion of
1307 resources in the result set. The value of this element is an XML
1308 element that defines a search operator that evaluates to one of the
1309 Boolean truth values TRUE, FALSE, or UNKNOWN. The search operator
1310 contained by DAV:where may itself contain and evaluate additional
1311 search operators as operands, which in turn may contain and evaluate
1312 additional search operators as operands, etc., recursively.
1313
13145.5.1. Use of Three-Valued Logic in Queries
1315
1316 Each operator defined for use in the where clause that returns a
1317 Boolean value MUST evaluate to TRUE, FALSE, or UNKNOWN. The resource
1318 under scan is included as a member of the result set if and only if
1319 the search condition evaluates to TRUE.
1320
1321 Consult Appendix A for details on the application of three-valued
1322 logic in query expressions.
1323
13245.5.2. Handling Optional Operators
1325
1326 If a query contains an operator that is not supported by the server,
1327 then the server MUST respond with a 422 (Unprocessable Entity) status
1328 code.
1329
13305.5.3. Treatment of NULL Values
1331
1332 If a PROPFIND for a property value would yield a non-2xx (see Section
1333 10.2 of [RFC2616]) response for that property, then that property is
1334 considered NULL.
1335
1336 NULL values are "less than" all other values in comparisons.
1337
1338 Empty strings (zero length strings) are not NULL values. An empty
1339 string is "less than" a string with length greater than zero.
1340
1341 The DAV:is-defined operator is defined to test if the value of a
1342 property is not NULL.
1343
1344
1345
1346Reschke, et al. Standards Track [Page 24]
1347
1348RFC 5323 WebDAV SEARCH November 2008
1349
1350
13515.5.4. Treatment of Properties with Mixed/Element Content
1352
1353 Comparisons of properties that do not have simple types (text-only
1354 content) is out of scope for the standard operators defined for DAV:
1355 basicsearch and therefore is defined to be UNKNOWN (as per
1356 Appendix A). For querying the DAV:resourcetype property, see
1357 Section 5.13.
1358
13595.5.5. Example: Testing for Equality
1360
1361 The example shows a single operator (DAV:eq) applied in the criteria.
1362
1363 <d:where xmlns:d='DAV:'>
1364 <d:eq>
1365 <d:prop>
1366 <d:getcontentlength/>
1367 </d:prop>
1368 <d:literal>100</d:literal>
1369 </d:eq>
1370 </d:where>
1371
13725.5.6. Example: Relative Comparisons
1373
1374 The example shows a more complex operation involving several
1375 operators (DAV:and, DAV:eq, DAV:gt) applied in the criteria. This
1376 DAV:where expression matches those resources of type "image/gif" over
1377 4K in size.
1378
1379 <D:where xmlns:D='DAV:'>
1380 <D:and>
1381 <D:eq>
1382 <D:prop>
1383 <D:getcontenttype/>
1384 </D:prop>
1385 <D:literal>image/gif</D:literal>
1386 </D:eq>
1387 <D:gt>
1388 <D:prop>
1389 <D:getcontentlength/>
1390 </D:prop>
1391 <D:literal>4096</D:literal>
1392 </D:gt>
1393 </D:and>
1394 </D:where>
1395
1396
1397
1398
1399
1400
1401
1402Reschke, et al. Standards Track [Page 25]
1403
1404RFC 5323 WebDAV SEARCH November 2008
1405
1406
14075.6. DAV:orderby
1408
1409 The DAV:orderby element specifies the ordering of the result set. It
1410 contains one or more DAV:order elements, each of which specifies a
1411 comparison between two items in the result set. Informally, a
1412 comparison specifies a test that determines whether one resource
1413 appears before another in the result set. Comparisons are applied in
1414 the order they occur in the DAV:orderby element, earlier comparisons
1415 being more significant.
1416
1417 The comparisons defined here use only a single property from each
1418 resource, compared using the same ordering as the DAV:lt operator
1419 (ascending) or DAV:gt operator (descending). If neither direction is
1420 specified, the default is DAV:ascending.
1421
1422 In the context of the DAV:orderby element, null values are considered
1423 to collate before any actual (i.e., non-null) value, including
1424 strings of zero length (this is compatible with [SQL99]).
1425
1426 The "caseless" attribute may be used to indicate case-sensitivity for
1427 comparisons (Section 5.18).
1428
14295.6.1. Example of Sorting
1430
1431 This sort orders first by last name of the author and then by size,
1432 in descending order, so that for each author, the largest works
1433 appear first.
1434
1435 <d:orderby xmlns:d='DAV:' xmlns:r='http://example.com/ns'>
1436 <d:order>
1437 <d:prop><r:lastname/></d:prop>
1438 <d:ascending/>
1439 </d:order>
1440 <d:order>
1441 <d:prop><d:getcontentlength/></d:prop>
1442 <d:descending/>
1443 </d:order>
1444 </d:orderby>
1445
14465.7. Boolean Operators: DAV:and, DAV:or, and DAV:not
1447
1448 The DAV:and operator performs a logical AND operation on the
1449 expressions it contains.
1450
1451 The DAV:or operator performs a logical OR operation on the values it
1452 contains.
1453
1454
1455
1456
1457
1458Reschke, et al. Standards Track [Page 26]
1459
1460RFC 5323 WebDAV SEARCH November 2008
1461
1462
1463 The DAV:not operator performs a logical NOT operation on the values
1464 it contains.
1465
14665.8. DAV:eq
1467
1468 The DAV:eq operator provides simple equality matching on property
1469 values.
1470
1471 The "caseless" attribute may be used with this element
1472 (Section 5.18).
1473
14745.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte
1475
1476 The DAV:lt, DAV:lte, DAV:gt, and DAV:gte operators provide
1477 comparisons on property values, using less-than, less-than or equal,
1478 greater-than, and greater-than or equal, respectively. The
1479 "caseless" attribute may be used with these elements (Section 5.18).
1480
14815.10. DAV:literal
1482
1483 DAV:literal allows literal values to be placed in an expression.
1484
1485 White space in literal values is significant in comparisons. For
1486 consistency with [RFC4918], clients SHOULD NOT specify the attribute
1487 "xml:space" (Section 2.10 of [XML]) to override this behavior.
1488
1489 In comparisons, the contents of DAV:literal SHOULD be treated as
1490 string, with the following exceptions:
1491
1492 o when operand for a comparison with a DAV:getcontentlength
1493 property, it SHOULD be treated as an unsigned integer value (the
1494 behavior for values not in this format is undefined),
1495
1496 o when operand for a comparison with a DAV:creationdate or DAV:
1497 getlastmodified property, it SHOULD be treated as a date value in
1498 the ISO-8601 subset defined for the DAV:creationdate property (see
1499 Section 15.1 of [RFC4918]; the behavior of values not in this
1500 format is undefined),
1501
1502 o when operand for a comparison with a property for which the type
1503 is known and when compatible with that type, it MAY be treated
1504 according to this type.
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514Reschke, et al. Standards Track [Page 27]
1515
1516RFC 5323 WebDAV SEARCH November 2008
1517
1518
15195.11. DAV:typed-literal (Optional)
1520
1521 There are situations in which a client may want to force a comparison
1522 not to be string-based (as defined for DAV:literal). In these cases,
1523 a typed comparison can be enforced by using DAV:typed-literal
1524 instead.
1525
1526 <!ELEMENT typed-literal (#PCDATA)>
1527
1528 The data type is specified using the xsi:type attribute defined in
1529 Section 2.6.1 of [XS1]. If the type is not specified, it defaults to
1530 "xs:string".
1531
1532 A server MUST reject a request using an unknown type with a status of
1533 422 (Unprocessable Entity). It SHOULD reject a request if the value
1534 provided in DAV:typed-literal cannot be cast to the specified type.
1535
1536 The comparison evaluates to UNKNOWN if the property value cannot be
1537 cast to the specified datatype (see [XPATHFUNC], Section 17).
1538
15395.11.1. Example for Typed Numerical Comparison
1540
1541 Consider a set of resources with the dead property "edits" in the
1542 namespace "http://ns.example.org":
1543
1544 +-----+----------------+
1545 | URI | property value |
1546 +-----+----------------+
1547 | /a | "-1" |
1548 | /b | "01" |
1549 | /c | "3" |
1550 | /d | "test" |
1551 | /e | (undefined) |
1552 +-----+----------------+
1553
1554 The expression
1555
1556 <lt xmlns="DAV:"
1557 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
1558 xmlns:xs="http://www.w3.org/2001/XMLSchema">
1559 <prop><edits xmlns="http://ns.example.org"/></prop>
1560 <typed-literal xsi:type="xs:integer">3</typed-literal>
1561 </lt>
1562
1563 will evaluate to TRUE for the resources "/a" and "/b" (their property
1564 values can be parsed as type xs:integer, and the numerical comparison
1565 evaluates to true), to FALSE for "/c" (property value is compatible,
1566 but numerical comparison evaluates to false), and UNKNOWN for "/d"
1567
1568
1569
1570Reschke, et al. Standards Track [Page 28]
1571
1572RFC 5323 WebDAV SEARCH November 2008
1573
1574
1575 and "/e" (the property either is undefined, or its value cannot be
1576 parsed as xs:integer).
1577
15785.12. Support for Matching xml:lang Attributes on Properties
1579
1580 The following two optional operators can be used to express
1581 conditions on the language of a property value (as expressed using
1582 the xml:lang attribute).
1583
15845.12.1. DAV:language-defined (Optional)
1585
1586 <!ELEMENT language-defined (prop)>
1587
1588 This operator evaluates to TRUE if the language for the value of the
1589 given property is known, FALSE if it isn't, and UNKNOWN if the
1590 property itself is not defined.
1591
15925.12.2. DAV:language-matches (Optional)
1593
1594 <!ELEMENT language-matches (prop, literal)>
1595
1596 This operator evaluates to TRUE if the language for the value of the
1597 given property is known and matches the language name given in the
1598 <literal> element, FALSE if it doesn't match, and UNKNOWN if the
1599 property itself is not defined.
1600
1601 Languages are considered to match if they are the same, or if the
1602 language of the property value is a sublanguage of the language
1603 specified in the <literal> element (see Section 4.3 of [XPATH], "lang
1604 function").
1605
16065.12.3. Example of Language-Aware Matching
1607
1608 The expression below will evaluate to TRUE if the property "foobar"
1609 exists and its language is either unknown, English, or a sublanguage
1610 of English.
1611
1612 <or xmlns="DAV:">
1613 <not>
1614 <language-defined>
1615 <prop><foobar/></prop>
1616 </language-defined>
1617 </not>
1618 <language-matches>
1619 <prop><foobar/></prop>
1620 <literal>en</literal>
1621 </language-matches>
1622 </or>
1623
1624
1625
1626Reschke, et al. Standards Track [Page 29]
1627
1628RFC 5323 WebDAV SEARCH November 2008
1629
1630
16315.13. DAV:is-collection
1632
1633 The DAV:is-collection operator allows clients to determine whether a
1634 resource is a collection (that is, whether its DAV:resourcetype
1635 element contains the element DAV:collection).
1636
1637 Rationale: This operator is provided in lieu of defining generic
1638 structure queries, which would suffice for this and for many more
1639 powerful queries, but seems inappropriate to standardize at this
1640 time.
1641
16425.13.1. Example of DAV:is-collection
1643
1644 This example shows a search criterion that picks out all, and only,
1645 the resources in the scope that are collections.
1646
1647 <where xmlns="DAV:">
1648 <is-collection/>
1649 </where>
1650
16515.14. DAV:is-defined
1652
1653 The DAV:is-defined operator allows clients to determine whether a
1654 property is defined on a resource. The meaning of "defined on a
1655 resource" is found in Section 5.5.3.
1656
1657 Example:
1658
1659 <d:is-defined xmlns:d='DAV:' xmlns:x='http://example.com/ns'>
1660 <d:prop><x:someprop/></d:prop>
1661 </d:is-defined>
1662
16635.15. DAV:like
1664
1665 The DAV:like is an optional operator intended to give simple
1666 wildcard-based pattern matching ability to clients.
1667
1668 The operator takes two arguments.
1669
1670 The first argument is a DAV:prop element identifying a single
1671 property to evaluate.
1672
1673 The second argument is a DAV:literal element that gives the pattern
1674 matching string.
1675
1676
1677
1678
1679
1680
1681
1682Reschke, et al. Standards Track [Page 30]
1683
1684RFC 5323 WebDAV SEARCH November 2008
1685
1686
16875.15.1. Syntax for the Literal Pattern
1688
1689 pattern = [wildcard] 0*( text [wildcard] )
1690
1691 wildcard = exactlyone / zeroormore
1692 text = 1*( character / escapeseq )
1693
1694 exactlyone = "_"
1695 zeroormore = "%"
1696 escapechar = "\"
1697 escapeseq = escapechar ( exactlyone / zeroormore / escapechar )
1698
1699 ; character: see [XML], Section 2.2, minus wildcard / escapechar
1700 character = HTAB / LF / CR ; whitespace
1701 character =/ %x20-24 / %x26-5B / %x5D-5E / %x60-D7FF
1702 character =/ %xE000-FFFD / %x10000-10FFFF
1703
1704 (Note that the ABNF above is defined in terms of Unicode code points
1705 ([UNICODE5]); when a query is transmitted as an XML document over
1706 WebDAV, these characters are typically encoded in UTF-8 or UTF-16.)
1707
1708 The value for the literal is composed of wildcards separated by
1709 segments of text. Wildcards may begin or end the literal.
1710
1711 The "_" wildcard matches exactly one character.
1712
1713 The "%" wildcard matches zero or more characters.
1714
1715 The "\" character is an escape sequence so that the literal can
1716 include "_" and "%". To include the "\" character in the pattern,
1717 the escape sequence "\\" is used.
1718
17195.15.2. Example of DAV:like
1720
1721 This example shows how a client might use DAV:like to identify those
1722 resources whose content type was a subtype of image.
1723
1724 <D:where xmlns:D='DAV:'>
1725 <D:like caseless="yes">
1726 <D:prop><D:getcontenttype/></D:prop>
1727 <D:literal>image/%</D:literal>
1728 </D:like>
1729 </D:where>
1730
17315.16. DAV:contains
1732
1733 The DAV:contains operator is an optional operator that provides
1734 content-based search capability. This operator implicitly searches
1735
1736
1737
1738Reschke, et al. Standards Track [Page 31]
1739
1740RFC 5323 WebDAV SEARCH November 2008
1741
1742
1743 against the text content of a resource, not against the content of
1744 properties. The DAV:contains operator is intentionally not overly
1745 constrained, in order to allow the server to do the best job it can
1746 in performing the search.
1747
1748 The DAV:contains operator evaluates to a Boolean value. It evaluates
1749 to TRUE if the content of the resource satisfies the search.
1750 Otherwise, it evaluates to FALSE.
1751
1752 Within the DAV:contains XML element, the client provides a phrase: a
1753 single word or whitespace delimited sequence of words. Servers MAY
1754 ignore punctuation in a phrase. Case-sensitivity is at the
1755 discretion of the server implementation.
1756
1757 The following non-exhaustive list enumerates things that may or may
1758 not be done as part of the search: Phonetic methods such as "soundex"
1759 may or may not be used. Word stemming may or may not be performed.
1760 Thesaurus expansion of words may or may not be done. Right or left
1761 truncation may or may not be performed. The search may be case
1762 insensitive or case sensitive. The word or words may or may not be
1763 interpreted as names. Multiple words may or may not be required to
1764 be adjacent or "near" each other. Multiple words may or may not be
1765 required to occur in the same order. Multiple words may or may not
1766 be treated as a phrase. The search may or may not be interpreted as
1767 a request to find documents "similar" to the string operand.
1768 Character canonicalization such as that done by the Unicode collation
1769 algorithm may or may not be applied.
1770
17715.16.1. Result Scoring (DAV:score Element)
1772
1773 Servers SHOULD indicate scores for the DAV:contains condition by
1774 adding a DAV:score XML element to the DAV:response element. Its
1775 value is defined only in the context of a particular query result.
1776 The value is a string representing the score, an integer from zero to
1777 10000 inclusive, where a higher value indicates a higher score (e.g.,
1778 more relevant).
1779
1780 Modified DTD fragment for DAV:propstat:
1781
1782 <!ELEMENT response (href, ((href*, status)|(propstat+)),
1783 responsedescription?, score?) >
1784 <!ELEMENT score (#PCDATA) >
1785
1786 Clients should note that, in general, it is not meaningful to compare
1787 the numeric values of scores from two different query results unless
1788 both were executed by the same underlying search system on the same
1789 collection of resources.
1790
1791
1792
1793
1794Reschke, et al. Standards Track [Page 32]
1795
1796RFC 5323 WebDAV SEARCH November 2008
1797
1798
17995.16.2. Ordering by Score
1800
1801 To order search results by their score, the DAV:score element may be
1802 added as child to the DAV:orderby element (in place of a DAV:prop
1803 element).
1804
18055.16.3. Examples
1806
1807 The example below shows a search for the phrase "Peter Forsberg".
1808
1809 Depending on its support for content-based searching, a server MAY
1810 treat this as a search for documents that contain the words "Peter"
1811 and "Forsberg".
1812
1813 <D:where xmlns:D='DAV:'>
1814 <D:contains>Peter Forsberg</D:contains>
1815 </D:where>
1816
1817 The example below shows a search for resources that contain "Peter"
1818 and "Forsberg".
1819
1820 <D:where xmlns:D='DAV:'>
1821 <D:and>
1822 <D:contains>Peter</D:contains>
1823 <D:contains>Forsberg</D:contains>
1824 </D:and>
1825 </D:where>
1826
18275.17. Limiting the Result Set
1828
1829 <!ELEMENT limit (nresults) >
1830 <!ELEMENT nresults (#PCDATA)> <!-- only digits -->
1831
1832 The DAV:limit XML element contains requested limits from the client
1833 to limit the size of the reply or amount of effort expended by the
1834 server. The DAV:nresults XML element contains a requested maximum
1835 number of DAV:response elements to be returned in the response body.
1836 The server MAY disregard this limit. The value of this element is an
1837 unsigned integer.
1838
18395.17.1. Relationship to Result Ordering
1840
1841 If the result set is both limited by DAV:limit and ordered according
1842 to DAV:orderby, the results that are included in the response
1843 document SHOULD be those that order highest.
1844
1845
1846
1847
1848
1849
1850Reschke, et al. Standards Track [Page 33]
1851
1852RFC 5323 WebDAV SEARCH November 2008
1853
1854
18555.18. The 'caseless' XML Attribute
1856
1857 The "caseless" attribute allows clients to specify caseless matching
1858 behavior instead of character-by-character matching for DAV:
1859 basicsearch operators.
1860
1861 The possible values for "caseless" are "yes" or "no". The default
1862 value is server-specified. Caseless matching SHOULD be implemented
1863 as defined in Section 5.18 of the Unicode Standard ([UNICODE5]).
1864
1865 Support for the "caseless" attribute is optional. A server should
1866 respond with a status of 422 if it is used but cannot be supported.
1867
18685.19. Query Schema for DAV:basicsearch
1869
1870 The DAV:basicsearch grammar defines a search criteria that is a
1871 Boolean-valued expression, and allows for an arbitrary set of
1872 properties to be included in the result record. The result set may
1873 be sorted on a set of property values. Accordingly, the DTD for
1874 schema discovery for this grammar allows the server to express:
1875
1876 1. the set of properties that may be either searched, returned, or
1877 used to sort, and a hint about the data type of such properties.
1878
1879 2. the set of optional operators defined by the resource.
1880
18815.19.1. DTD for DAV:basicsearch QSD
1882
1883 <!ELEMENT basicsearchschema (properties, operators)>
1884 <!ELEMENT any-other-property EMPTY>
1885 <!ELEMENT properties (propdesc*)>
1886 <!ELEMENT propdesc ((prop|any-other-property), datatype?,
1887 searchable?, selectable?, sortable?,
1888 caseless?)>
1889 <!ELEMENT operators (opdesc*)>
1890 <!ELEMENT opdesc ANY>
1891 <!ATTLIST opdesc allow-pcdata (yes|no) #IMPLIED>
1892 <!ELEMENT operand-literal EMPTY>
1893 <!ELEMENT operand-typed-literal EMPTY>
1894 <!ELEMENT operand-property EMPTY>
1895
1896 The DAV:properties element holds a list of descriptions of
1897 properties.
1898
1899 The DAV:operators element describes the optional operators that may
1900 be used in a DAV:where element.
1901
1902
1903
1904
1905
1906Reschke, et al. Standards Track [Page 34]
1907
1908RFC 5323 WebDAV SEARCH November 2008
1909
1910
19115.19.2. DAV:propdesc Element
1912
1913 Each instance of a DAV:propdesc element describes the property or
1914 properties in the DAV:prop element it contains. All subsequent
1915 elements are descriptions that apply to those properties. All
1916 descriptions are optional and may appear in any order. Servers
1917 SHOULD support all the descriptions defined here, and MAY define
1918 others.
1919
1920 DASL defines five descriptions. The first, DAV:datatype, provides a
1921 hint about the type of the property value, and may be useful to a
1922 user interface prompting for a value. The remaining four (DAV:
1923 searchable, DAV:selectable, DAV:sortable, and DAV:caseless) identify
1924 portions of the query (DAV:where, DAV:select, and DAV:orderby,
1925 respectively). If a property has a description for a section, then
1926 the server MUST allow the property to be used in that section. These
1927 descriptions are optional. If a property does not have such a
1928 description, or is not described at all, then the server MAY still
1929 allow the property to be used in the corresponding section.
1930
19315.19.2.1. DAV:any-other-property
1932
1933 This element can be used in place of DAV:prop to describe properties
1934 of WebDAV properties not mentioned in any other DAV:prop element.
1935 For instance, this can be used to indicate that all other properties
1936 are searchable and selectable without giving details about their
1937 types (a typical scenario for dead properties).
1938
19395.19.3. The DAV:datatype Property Description
1940
1941 The DAV:datatype element contains a single XML element that provides
1942 a hint about the domain of the property, which may be useful to a
1943 user interface prompting for a value to be used in a query. Data
1944 types are identified by an element name. Where appropriate, a server
1945 SHOULD use the simple data types defined in [XS2].
1946
1947 <!ELEMENT datatype ANY >
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962Reschke, et al. Standards Track [Page 35]
1963
1964RFC 5323 WebDAV SEARCH November 2008
1965
1966
1967 Examples from [XS2], Section 3:
1968
1969 +----------------+---------------------+
1970 | Qualified name | Example |
1971 +----------------+---------------------+
1972 | xs:boolean | true, false, 1, 0 |
1973 | xs:string | Foobar |
1974 | xs:dateTime | 1994-11-05T08:15:5Z |
1975 | xs:float | .314159265358979E+1 |
1976 | xs:integer | -259, 23 |
1977 +----------------+---------------------+
1978
1979 If the data type of a property is not given, then the data type
1980 defaults to xs:string.
1981
19825.19.4. The DAV:searchable Property Description
1983
1984 <!ELEMENT searchable EMPTY>
1985
1986 If this element is present, then the server MUST allow this property
1987 to appear within a DAV:where element where an operator allows a
1988 property. Allowing a search does not mean that the property is
1989 guaranteed to be defined on every resource in the scope, it only
1990 indicates the server's willingness to check.
1991
19925.19.5. The DAV:selectable Property Description
1993
1994 <!ELEMENT selectable EMPTY>
1995
1996 This element indicates that the property may appear in the DAV:select
1997 element.
1998
19995.19.6. The DAV:sortable Property Description
2000
2001 This element indicates that the property may appear in the DAV:
2002 orderby element.
2003
2004 <!ELEMENT sortable EMPTY>
2005
20065.19.7. The DAV:caseless Property Description
2007
2008 This element only applies to properties whose data type is "xs:
2009 string" and derived data types as per the DAV:datatype property
2010 description. Its presence indicates that comparisons performed for
2011 searches, and the comparisons for ordering results on the string
2012 property will be caseless (the default is character by character).
2013
2014 <!ELEMENT caseless EMPTY>
2015
2016
2017
2018Reschke, et al. Standards Track [Page 36]
2019
2020RFC 5323 WebDAV SEARCH November 2008
2021
2022
20235.19.8. The DAV:operators XML Element
2024
2025 The DAV:operators element describes every optional operator supported
2026 in a query. (Mandatory operators are not listed since they are
2027 mandatory and permit no variation in syntax.) All optional operators
2028 that are supported MUST be listed in the DAV:operators element.
2029
2030 The listing for an operator, contained in an DAV:opdesc element,
2031 consists of the operator (as an empty element), followed by one
2032 element for each operand. The operand MUST be either DAV:operand-
2033 property, DAV:operand-literal, or DAV:operand-typed-literal, which
2034 indicate that the operand in the corresponding position is a
2035 property, a literal value, or a typed literal value, respectively.
2036 If an operator is polymorphic (allows more than one operand syntax)
2037 then each permitted syntax MUST be listed separately.
2038
2039 The DAV:opdesc element MAY have a "allow-pcdata" attribute
2040 (defaulting to "no"). A value of "yes" indicates that the operator
2041 can contain character data, as it is the case with DAV:contains (see
2042 Section 5.16). Definition of additional operators using this format
2043 is NOT RECOMMENDED.
2044
2045 <operators xmlns='DAV:'>
2046 <opdesc>
2047 <like/><operand-property/><operand-literal/>
2048 </opdesc>
2049 </operators>
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074Reschke, et al. Standards Track [Page 37]
2075
2076RFC 5323 WebDAV SEARCH November 2008
2077
2078
20795.19.9. Example of Query Schema for DAV:basicsearch
2080
2081 <D:basicsearchschema xmlns:D="DAV:"
2082 xmlns:xs="http://www.w3.org/2001/XMLSchema">
2083 <D:properties>
2084 <D:propdesc>
2085 <D:prop><D:getcontentlength/></D:prop>
2086 <D:datatype><xs:nonNegativeInteger/></D:datatype>
2087 <D:searchable/><D:selectable/><D:sortable/>
2088 </D:propdesc>
2089 <D:propdesc>
2090 <D:prop><D:getcontenttype/><D:displayname/></D:prop>
2091 <D:searchable/><D:selectable/><D:sortable/>
2092 </D:propdesc>
2093 <D:propdesc>
2094 <D:prop><fstop xmlns="http://ns.example.org"/></D:prop>
2095 <D:selectable/>
2096 </D:propdesc>
2097 <D:propdesc>
2098 <D:any-other-property/>
2099 <D:searchable/><D:selectable/>
2100 </D:propdesc>
2101 </D:properties>
2102 <D:operators>
2103 <D:opdesc>
2104 <D:like/><D:operand-property/><D:operand-literal/>
2105 </D:opdesc>
2106 <D:opdesc allow-pcdata="yes">
2107 <D:contains/>
2108 </D:opdesc>
2109 </D:operators>
2110 </D:basicsearchschema>
2111
2112 This response lists four properties. The data type of the last three
2113 properties is not given, so it defaults to xs:string. All are
2114 selectable, and the first three may be searched. All but the last
2115 may be used in a sort. Of the optional DAV operators, DAV:contains
2116 and DAV:like are supported.
2117
2118 Note: The schema discovery defined here does not provide for
2119 discovery of supported values of the "caseless" attribute. This
2120 may require that the reply also list the mandatory operators.
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130Reschke, et al. Standards Track [Page 38]
2131
2132RFC 5323 WebDAV SEARCH November 2008
2133
2134
21356. Internationalization Considerations
2136
2137 Properties may be language-tagged using the xml:lang attribute (see
2138 [RFC4918], Section 4.3). The optional operators DAV:language-defined
2139 (Section 5.12.1) and DAV:language-matches (Section 5.12.2) allow the
2140 expression of conditions on the language tagging information.
2141
21427. Security Considerations
2143
2144 This section is provided to detail issues concerning security
2145 implications of which DASL applications need to be aware. All of the
2146 security considerations of HTTP/1.1 ([RFC2616] and WebDAV ([RFC4918])
2147 also apply to DASL. In addition, this section will include security
2148 risks inherent in the search and retrieval of resource properties and
2149 content.
2150
2151 A query MUST NOT allow clients to retrieve information that wouldn't
2152 have been available through the GET or PROPFIND methods in the first
2153 place. In particular:
2154
2155 o Query constraints on WebDAV properties for which the client does
2156 not have read access need to be evaluated as if the property did
2157 not exist (see Section 5.5.3).
2158
2159 o Query constraints on content (as with DAV:contains, defined in
2160 Section 5.16) for which the client does not have read access need
2161 to be evaluated as if a GET would return a 4xx status code.
2162
2163 A server should prepare for denial-of-service attacks. For example a
2164 client may issue a query for which the result set is expensive to
2165 calculate or transmit because many resources match or must be
2166 evaluated.
2167
21687.1. Implications of XML External Entities
2169
2170 XML supports a facility known as "external entities", defined in
2171 Section 4.2.2 of [XML], which instruct an XML processor to retrieve
2172 and perform an inline include of XML located at a particular URI. An
2173 external XML entity can be used to append or modify the document type
2174 declaration (DTD) associated with an XML document. An external XML
2175 entity can also be used to include XML within the content of an XML
2176 document. For non-validating XML, such as the XML used in this
2177 specification, including an external XML entity is not required by
2178 [XML]. However, [XML] does state that an XML processor may, at its
2179 discretion, include the external XML entity.
2180
2181 External XML entities have no inherent trustworthiness and are
2182 subject to all the attacks that are endemic to any HTTP GET request.
2183
2184
2185
2186Reschke, et al. Standards Track [Page 39]
2187
2188RFC 5323 WebDAV SEARCH November 2008
2189
2190
2191 Furthermore, it is possible for an external XML entity to modify the
2192 DTD, and hence affect the final form of an XML document, in the worst
2193 case significantly modifying its semantics, or exposing the XML
2194 processor to the security risks discussed in [RFC3023]. Therefore,
2195 implementers must be aware that external XML entities should be
2196 treated as untrustworthy.
2197
2198 There is also the scalability risk that would accompany a widely
2199 deployed application that made use of external XML entities. In this
2200 situation, it is possible that there would be significant numbers of
2201 requests for one external XML entity, potentially overloading any
2202 server that fields requests for the resource containing the external
2203 XML entity.
2204
22058. Scalability
2206
2207 Query grammars are identified by URIs. Applications SHOULD NOT
2208 attempt to retrieve these URIs even if they appear to be retrievable
2209 (for example, those that begin with "http://").
2210
22119. IANA Considerations
2212
2213 This document uses the namespace defined in Section 21 of [RFC4918]
2214 for XML elements.
2215
22169.1. HTTP Headers
2217
2218 This document specifies the HTTP header listed below, which has been
2219 added to the permanent HTTP header registry defined in [RFC3864].
2220
22219.1.1. DASL
2222
2223 Header field name: DASL
2224
2225 Applicable protocol: http
2226
2227 Status: standard
2228
2229 Author/Change controller: IETF
2230
2231 Specification document: this specification (Section 3.2)
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242Reschke, et al. Standards Track [Page 40]
2243
2244RFC 5323 WebDAV SEARCH November 2008
2245
2246
224710. Contributors
2248
2249 This document is based on prior work on the DASL protocol done by the
2250 WebDAV DASL working group until the year 2000 -- namely by Alan
2251 Babich, Jim Davis, Rick Henderson, Dale Lowry, Saveen Reddy, Surendra
2252 Reddy, and Judith Slein (see <http://www.webdav.org/dasl/> for the
2253 working group's web site,
2254 <http://purl.org/NET/webdav/dasl-references/reqs> for a requirements
2255 document, and
2256 <http://purl.org/NET/webdav/dasl-references/dasl-protocol-00> for an
2257 early version of the specification).
2258
225911. Acknowledgements
2260
2261 This document has benefited from thoughtful discussion by Lisa
2262 Dusseault, Javier Godoy, Sung Kim, Chris Newman, Elias Sinderson,
2263 Martin Wallmer, Keith Wannamaker, Jim Whitehead, and Kevin Wiggen.
2264
226512. References
2266
226712.1. Normative References
2268
2269 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
2270 Requirement Levels", BCP 14, RFC 2119, March 1997.
2271
2272 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
2273 Masinter, L., Leach, P., and T. Berners-Lee,
2274 "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616,
2275 June 1999.
2276
2277 [RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media
2278 Types", RFC 3023, January 2001.
2279
2280 [RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J.
2281 Whitehead, "Versioning Extensions to WebDAV (Web
2282 Distributed Authoring and Versioning)", RFC 3253,
2283 March 2002.
2284
2285 [RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead,
2286 "Web Distributed Authoring and Versioning (WebDAV)
2287 Access Control Protocol", RFC 3744, May 2004.
2288
2289 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter,
2290 "Uniform Resource Identifier (URI): Generic Syntax",
2291 STD 66, RFC 3986, January 2005.
2292
2293
2294
2295
2296
2297
2298Reschke, et al. Standards Track [Page 41]
2299
2300RFC 5323 WebDAV SEARCH November 2008
2301
2302
2303 [RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web
2304 Distributed Authoring and Versioning (WebDAV)",
2305 RFC 4918, June 2007.
2306
2307 [RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for
2308 Syntax Specifications: ABNF", STD 68, RFC 5234,
2309 January 2008.
2310
2311 [XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E.,
2312 and F. Yergeau, "Extensible Markup Language (XML) 1.0
2313 (Fourth Edition)", W3C REC-xml-20060816, August 2006,
2314 <http://www.w3.org/TR/2006/REC-xml-20060816>.
2315
2316 [XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath)
2317 Version 1.0", W3C REC-xpath-19991116, November 1999,
2318 <http://www.w3.org/TR/1999/REC-xpath-19991116>.
2319
2320 [XPATHFUNC] Malhotra, A., Melton, J., and N. Walsh, "XQuery 1.0
2321 and XPath 2.0 Functions and Operators", W3C REC-xpath-
2322 functions-20070123, January 2007, <http://www.w3.org/
2323 TR/2007/REC-xpath-functions-20070123/>.
2324
2325 [XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N.,
2326 and World Wide Web Consortium, "XML Schema Part 1:
2327 Structures", W3C REC-xmlschema-1-20041028,
2328 October 2004,
2329 <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>.
2330
2331 [XS2] Biron, P., Malhotra, A., and World Wide Web
2332 Consortium, "XML Schema Part 2: Datatypes Second
2333 Edition", W3C REC-xmlschema-2-20041028, October 2004,
2334 <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.
2335
233612.2. Informative References
2337
2338 [BCP47] Phillips, A. and M. Davis, "Matching of Language
2339 Tags", BCP 47, RFC 4647, September 2006.
2340
2341 [RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration
2342 Procedures for Message Header Fields", BCP 90,
2343 RFC 3864, September 2004.
2344
2345 [RFC4437] Whitehead, J., Clemm, G., and J. Reschke, Ed., "Web
2346 Distributed Authoring and Versioning (WebDAV) Redirect
2347 Reference Resources", RFC 4437, March 2006.
2348
2349
2350
2351
2352
2353
2354Reschke, et al. Standards Track [Page 42]
2355
2356RFC 5323 WebDAV SEARCH November 2008
2357
2358
2359 [RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet
2360 Application Protocol Collation Registry", RFC 4790,
2361 March 2007.
2362
2363 [SQL99] Milton, J., "Database Language SQL Part 2: Foundation
2364 (SQL/Foundation)", ISO ISO/IEC 9075-2:1999 (E),
2365 July 1999.
2366
2367 [UNICODE5] The Unicode Consortium, "The Unicode Standard -
2368 Version 5.0", Addison-Wesley , November 2006,
2369 <http://www.unicode.org/versions/Unicode5.0.0/>.
2370
2371 ISBN 0321480910 [1]
2372
2373 [WEBDAV-BIND] Clemm, G., Crawford, J., Reschke, J., Ed., and J.
2374 Whitehead, "Binding Extensions to Web Distributed
2375 Authoring and Versioning (WebDAV)", October 2008.
2376
2377URIs
2378
2379 [1] <urn:isbn:0321480910>
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410Reschke, et al. Standards Track [Page 43]
2411
2412RFC 5323 WebDAV SEARCH November 2008
2413
2414
2415Appendix A. Three-Valued Logic in DAV:basicsearch
2416
2417 ANSI standard three-valued logic is used when evaluating the search
2418 condition (as defined in the ANSI standard SQL specifications, for
2419 example, in ANSI X3.135-1992, Section 8.12, pp. 188-189, Section 8.2,
2420 p. 169, General Rule 1)a), etc.).
2421
2422 ANSI standard three-valued logic is undoubtedly the most widely
2423 practiced method of dealing with the issues of properties in the
2424 search condition not having a value (e.g., being null or not defined)
2425 for the resource under scan, and with undefined expressions in the
2426 search condition (e.g., division by zero, etc.). Three valued logic
2427 works as follows.
2428
2429 Undefined expressions are expressions for which the value of the
2430 expression is not defined. Undefined expressions are a completely
2431 separate concept from the truth value UNKNOWN, which is, in fact,
2432 well defined. Property names and literal constants are considered
2433 expressions for purposes of this section. If a property in the
2434 current resource under scan has not been set to a value, then the
2435 value of that property is undefined for the resource under scan.
2436 DASL 1.0 has no arithmetic division operator, but if it did, division
2437 by zero would be an undefined arithmetic expression.
2438
2439 If any subpart of an arithmetic, string, or datetime subexpression is
2440 undefined, the whole arithmetic, string, or datetime subexpression is
2441 undefined.
2442
2443 There are no manifest constants to explicitly represent undefined
2444 number, string, or datetime values.
2445
2446 Since a Boolean value is ultimately returned by the search condition,
2447 arithmetic, string, and datetime expressions are always arguments to
2448 other operators. Examples of operators that convert arithmetic,
2449 string, and datetime expressions to Boolean values are the six
2450 relational operators ("greater than", "less than", "equals", etc.).
2451 If either or both operands of a relational operator have undefined
2452 values, then the relational operator evaluates to UNKNOWN.
2453 Otherwise, the relational operator evaluates to TRUE or FALSE,
2454 depending upon the outcome of the comparison.
2455
2456 The Boolean operators DAV:and, DAV:or, and DAV:not are evaluated
2457 according to the following rules:
2458
2459 not UNKNOWN = UNKNOWN
2460
2461 UNKNOWN and TRUE = UNKNOWN
2462
2463
2464
2465
2466Reschke, et al. Standards Track [Page 44]
2467
2468RFC 5323 WebDAV SEARCH November 2008
2469
2470
2471 UNKNOWN and FALSE = FALSE
2472
2473 UNKNOWN and UNKNOWN = UNKNOWN
2474
2475 UNKNOWN or TRUE = TRUE
2476
2477 UNKNOWN or FALSE = UNKNOWN
2478
2479 UNKNOWN or UNKNOWN = UNKNOWN
2480
2481Appendix B. Candidates for Future Protocol Extensions
2482
2483 This section summarizes issues that have been raised during the
2484 development of this specification, but for which no resolution could
2485 be found with the constraints in place. Future revisions of this
2486 specification should revisit these issues, though.
2487
2488B.1. Collation Support
2489
2490 Matching and sorting of textual data relies on collations. With
2491 respect to WebDAV SEARCH, a combination of various design approaches
2492 could be used:
2493
2494 o Require server support for specific collations.
2495
2496 o Require that the server can advertise which collations it
2497 supports.
2498
2499 o Allow a client to select the collation to be used.
2500
2501 In practice, the current implementations of WebDAV SEARCH usually
2502 rely on backends they do not control, and for which collation
2503 information may not be available. To make things worse,
2504 implementations of the DAV:basicsearch grammar frequently need to
2505 combine data from multiple underlying stores (such as properties and
2506 full text content), and thus collation support may vary based on the
2507 operator or property.
2508
2509 Another open issue is what collation formalism to support. At the
2510 time of this writing, the two specifications below seem to provide
2511 the necessary framework and thus may be the base for future work on
2512 collation support in WebDAV SEARCH:
2513
2514 1. "Internet Application Protocol Collation Registry" ([RFC4790]).
2515
2516 2. "XQuery 1.0 and XPath 2.0 Functions and Operators" ([XPATHFUNC],
2517 Section 7.3.1).
2518
2519
2520
2521
2522Reschke, et al. Standards Track [Page 45]
2523
2524RFC 5323 WebDAV SEARCH November 2008
2525
2526
2527B.2. Count
2528
2529 DAV:basicsearch does not allow a request that returns the count of
2530 matching resources.
2531
2532 A protocol extension would need to extend DAV:select, and also modify
2533 the DAV:multistatus response format.
2534
2535B.3. Diagnostics for Unsupported Queries
2536
2537 There are many reasons why a given query may not be supported by a
2538 server. Query Schema Discovery (Section 4) can be used to discover
2539 some constraints, but not all.
2540
2541 Future revisions should consider the introduction of specific
2542 condition codes ([RFC4918], Section 16) to these situations.
2543
2544B.4. Language Matching
2545
2546 Section 5.12.2 defines language matching in terms of the XPath "lang"
2547 function ([XPATH], Section 4.3). Future revisions should consider
2548 building on [BCP47] instead.
2549
2550B.5. Matching Media Types
2551
2552 Matching media types using the DAV:getcontenttype property and the
2553 DAV:like operator is hard due to DAV:getcontenttype also allowing
2554 parameters. A new operator specifically designed for the purpose of
2555 matching media types probably would simplify things a lot. See <http
2556 ://lists.w3.org/Archives/Public/www-webdav-dasl/2003OctDec/0109.html>
2557 for a specific proposal.
2558
2559B.6. Query by Name
2560
2561 DAV:basicsearch operates on the properties (and optionally the
2562 contents) of resources, and thus doesn't really allow matching on
2563 parts of the resource's URI. See <http://lists.w3.org/Archives/
2564 Public/www-webdav-dasl/2003OctDec/0100.html> for a proposed extension
2565 covering this use case.
2566
2567B.7. Result Paging
2568
2569 A frequently discussed feature is the ability to specifically request
2570 the "next" set of results, when either the server decided to truncate
2571 the result, or the client explicitly asked for a limited set (for
2572 instance, using the DAV:limit element defined in Section 5.17).
2573
2574
2575
2576
2577
2578Reschke, et al. Standards Track [Page 46]
2579
2580RFC 5323 WebDAV SEARCH November 2008
2581
2582
2583 In this case, it would be desirable if the server could keep the full
2584 query result, and provide a new URI identifying a separate result
2585 resource, allowing the client to retrieve additional data through GET
2586 requests, and remove the result through a DELETE request.
2587
2588B.8. Search Scope Discovery
2589
2590 Given a Search Arbiter resource, there's currently no way to discover
2591 programmatically the supported sets of search scopes. Future
2592 revisions of this specification could specify a scope discovery
2593 mechanism, similar to the Query Schema Discovery defined in
2594 Section 4.
2595
2596Index
2597
2598 C
2599 caseless attribute 26-27, 34
2600 Condition Names
2601 DAV:search-grammar-discovery-supported (pre) 9
2602 DAV:search-grammar-supported (pre) 9
2603 DAV:search-multiple-scope-supported (pre) 9
2604 DAV:search-scope-valid (pre) 9
2605 Criteria 5
2606
2607 D
2608 DAV:and 26
2609 DAV:ascending 26
2610 DAV:contains 31
2611 DAV:depth 23
2612 DAV:descending 26
2613 DAV:eq 27
2614 caseless attribute 27
2615 DAV:from 23
2616 DAV:gt 27
2617 DAV:gte 27
2618 DAV:include-versions 23
2619 DAV:is-collection 30
2620 DAV:is-defined 30
2621 DAV:language-defined 29
2622 DAV:language-matches 29
2623 DAV:like 30
2624 DAV:limit 33
2625 DAV:literal 27
2626 DAV:lt 27
2627 DAV:lte 27
2628 DAV:not 26
2629 DAV:nresults 33
2630 DAV:or 26
2631
2632
2633
2634Reschke, et al. Standards Track [Page 47]
2635
2636RFC 5323 WebDAV SEARCH November 2008
2637
2638
2639 DAV:orderby 26
2640 DAV:scope 23
2641 DAV:score 32
2642 relationship to DAV:orderby 33
2643 DAV:search-grammar-discovery-supported precondition 9
2644 DAV:search-grammar-supported precondition 9
2645 DAV:search-multiple-scope-supported precondition 9
2646 DAV:search-scope-valid precondition 9
2647 DAV:select 23
2648 DAV:supported-query-grammar-set property 14
2649 DAV:typed-literal 28
2650 DAV:where 24
2651
2652 M
2653 Methods
2654 SEARCH 7
2655
2656 O
2657 OPTIONS method 13
2658 DASL response header 14
2659
2660 P
2661 Properties
2662 DAV:supported-query-grammar-set 14
2663
2664 Q
2665 Query 5
2666 Query Grammar 5
2667 Query Grammar Discovery 13
2668 using live property 13
2669 using OPTIONS 13
2670 Query Schema 5
2671
2672 R
2673 Result 5
2674 Result Record 5
2675 Result Record Definition 5
2676 Result Set 5
2677 Result Set Truncation
2678 Example 10
2679
2680 S
2681 Scope 6
2682 Search Arbiter 6
2683 SEARCH method 7
2684 Search Modifier 6
2685 Sort Specification 6
2686
2687
2688
2689
2690Reschke, et al. Standards Track [Page 48]
2691
2692RFC 5323 WebDAV SEARCH November 2008
2693
2694
2695Authors' Addresses
2696
2697 Julian F. Reschke (editor)
2698 greenbytes GmbH
2699 Hafenweg 16
2700 Muenster, NW 48155
2701 Germany
2702
2703 Phone: +49 251 2807760
2704 EMail: julian.reschke@greenbytes.de
2705 URI: http://greenbytes.de/tech/webdav/
2706
2707
2708 Surendra Reddy
2709 Mitrix, Inc.
2710 303 Twin Dolphin Drive, Suite 600-37
2711 Redwood City, CA 94065
2712 U.S.A.
2713
2714 Phone: +1 408 500 1135
2715 EMail: Surendra.Reddy@mitrix.com
2716
2717
2718 Jim Davis
2719 27 Borden Street
2720 Toronto, Ontario M5S 2M8
2721 Canada
2722
2723 Phone: +1 416 929 5854
2724 EMail: jrd3@alum.mit.edu
2725 URI: http://www.econetwork.net/~jdavis
2726
2727 Alan Babich
2728 IBM Corporation
2729 3565 Harbor Blvd.
2730 Costa Mesa, CA 92626
2731 U.S.A.
2732
2733 Phone: +1 714 327 3403
2734 EMail: ababich@us.ibm.com
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746Reschke, et al. Standards Track [Page 49]
2747
2748