Network Working Group                                    J. Reschke, Ed.
Request for Comments: 5323                                    greenbytes
Category: Standards Track                                       S. Reddy
                                                                  Mitrix
                                                                J. Davis
        
Network Working Group                                    J. Reschke, Ed.
Request for Comments: 5323                                    greenbytes
Category: Standards Track                                       S. Reddy
                                                                  Mitrix
                                                                J. Davis
        

A. Babich IBM November 2008

A.Babich IBM 2008年11月

Web Distributed Authoring and Versioning (WebDAV) SEARCH

Web分布式创作和版本控制(WebDAV)搜索

Status of This Memo

关于下段备忘

This document specifies an Internet standards track protocol for the Internet community, and requests discussion and suggestions for improvements. Please refer to the current edition of the "Internet Official Protocol Standards" (STD 1) for the standardization state and status of this protocol. Distribution of this memo is unlimited.

本文件规定了互联网社区的互联网标准跟踪协议,并要求进行讨论和提出改进建议。有关本协议的标准化状态和状态,请参考当前版本的“互联网官方协议标准”(STD 1)。本备忘录的分发不受限制。

Copyright Notice

版权公告

Copyright (c) 2008 IETF Trust and the persons identified as the document authors. All rights reserved.

版权所有(c)2008 IETF信托基金和确定为文件作者的人员。版权所有。

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/ 许可证信息)在本文件发布之日生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。

Abstract

摘要

This document specifies a set of methods, headers, and properties composing Web Distributed Authoring and Versioning (WebDAV) SEARCH, an application of the HTTP/1.1 protocol to efficiently search for DAV resources based upon a set of client-supplied criteria.

本文档指定了组成Web分布式创作和版本控制(WebDAV)搜索的一组方法、标题和属性,该搜索是HTTP/1.1协议的一个应用程序,用于根据一组客户端提供的标准高效地搜索DAV资源。

Table of Contents

目录

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.1.  DASL . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.2.  Relationship to DAV  . . . . . . . . . . . . . . . . . . .  4
     1.3.  Terms  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
     1.4.  Notational Conventions . . . . . . . . . . . . . . . . . .  6
     1.5.  Note on Usage of 'DAV:' XML Namespace  . . . . . . . . . .  7
     1.6.  An Overview of DASL at Work  . . . . . . . . . . . . . . .  7
   2.  The SEARCH Method  . . . . . . . . . . . . . . . . . . . . . .  7
     2.1.  Overview . . . . . . . . . . . . . . . . . . . . . . . . .  7
     2.2.  The Request  . . . . . . . . . . . . . . . . . . . . . . .  8
       2.2.1.  The Request-URI  . . . . . . . . . . . . . . . . . . .  8
       2.2.2.  The Request Body . . . . . . . . . . . . . . . . . . .  8
     2.3.  The Successful 207 (Multistatus) Response  . . . . . . . .  9
       2.3.1.  Result Set Truncation  . . . . . . . . . . . . . . . .  9
       2.3.2.  Extending the PROPFIND Response  . . . . . . . . . . . 10
       2.3.3.  Example: A Simple Request and Response . . . . . . . . 10
       2.3.4.  Example: Result Set Truncation . . . . . . . . . . . . 11
     2.4.  Unsuccessful Responses . . . . . . . . . . . . . . . . . . 12
       2.4.1.  Example of an Invalid Scope  . . . . . . . . . . . . . 12
   3.  Discovery of Supported Query Grammars  . . . . . . . . . . . . 13
     3.1.  The OPTIONS Method . . . . . . . . . . . . . . . . . . . . 13
     3.2.  The DASL Response Header . . . . . . . . . . . . . . . . . 14
     3.3.  DAV:supported-query-grammar-set (Protected)  . . . . . . . 14
     3.4.  Example: Grammar Discovery . . . . . . . . . . . . . . . . 15
   4.  Query Schema Discovery: QSD  . . . . . . . . . . . . . . . . . 17
     4.1.  Additional SEARCH Semantics  . . . . . . . . . . . . . . . 17
       4.1.1.  Example of Query Schema Discovery  . . . . . . . . . . 18
   5.  The DAV:basicsearch Grammar  . . . . . . . . . . . . . . . . . 19
     5.1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . 19
     5.2.  The DAV:basicsearch DTD  . . . . . . . . . . . . . . . . . 20
       5.2.1.  Example Query  . . . . . . . . . . . . . . . . . . . . 22
     5.3.  DAV:select . . . . . . . . . . . . . . . . . . . . . . . . 23
     5.4.  DAV:from . . . . . . . . . . . . . . . . . . . . . . . . . 23
       5.4.1.  Relationship to the Request-URI  . . . . . . . . . . . 23
       5.4.2.  Scope  . . . . . . . . . . . . . . . . . . . . . . . . 24
     5.5.  DAV:where  . . . . . . . . . . . . . . . . . . . . . . . . 24
       5.5.1.  Use of Three-Valued Logic in Queries . . . . . . . . . 24
       5.5.2.  Handling Optional Operators  . . . . . . . . . . . . . 24
       5.5.3.  Treatment of NULL Values . . . . . . . . . . . . . . . 24
       5.5.4.  Treatment of Properties with Mixed/Element Content . . 25
       5.5.5.  Example: Testing for Equality  . . . . . . . . . . . . 25
       5.5.6.  Example: Relative Comparisons  . . . . . . . . . . . . 25
     5.6.  DAV:orderby  . . . . . . . . . . . . . . . . . . . . . . . 26
       5.6.1.  Example of Sorting . . . . . . . . . . . . . . . . . . 26
     5.7.  Boolean Operators: DAV:and, DAV:or, and DAV:not  . . . . . 26
     5.8.  DAV:eq . . . . . . . . . . . . . . . . . . . . . . . . . . 27
        
   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.1.  DASL . . . . . . . . . . . . . . . . . . . . . . . . . . .  4
     1.2.  Relationship to DAV  . . . . . . . . . . . . . . . . . . .  4
     1.3.  Terms  . . . . . . . . . . . . . . . . . . . . . . . . . .  5
     1.4.  Notational Conventions . . . . . . . . . . . . . . . . . .  6
     1.5.  Note on Usage of 'DAV:' XML Namespace  . . . . . . . . . .  7
     1.6.  An Overview of DASL at Work  . . . . . . . . . . . . . . .  7
   2.  The SEARCH Method  . . . . . . . . . . . . . . . . . . . . . .  7
     2.1.  Overview . . . . . . . . . . . . . . . . . . . . . . . . .  7
     2.2.  The Request  . . . . . . . . . . . . . . . . . . . . . . .  8
       2.2.1.  The Request-URI  . . . . . . . . . . . . . . . . . . .  8
       2.2.2.  The Request Body . . . . . . . . . . . . . . . . . . .  8
     2.3.  The Successful 207 (Multistatus) Response  . . . . . . . .  9
       2.3.1.  Result Set Truncation  . . . . . . . . . . . . . . . .  9
       2.3.2.  Extending the PROPFIND Response  . . . . . . . . . . . 10
       2.3.3.  Example: A Simple Request and Response . . . . . . . . 10
       2.3.4.  Example: Result Set Truncation . . . . . . . . . . . . 11
     2.4.  Unsuccessful Responses . . . . . . . . . . . . . . . . . . 12
       2.4.1.  Example of an Invalid Scope  . . . . . . . . . . . . . 12
   3.  Discovery of Supported Query Grammars  . . . . . . . . . . . . 13
     3.1.  The OPTIONS Method . . . . . . . . . . . . . . . . . . . . 13
     3.2.  The DASL Response Header . . . . . . . . . . . . . . . . . 14
     3.3.  DAV:supported-query-grammar-set (Protected)  . . . . . . . 14
     3.4.  Example: Grammar Discovery . . . . . . . . . . . . . . . . 15
   4.  Query Schema Discovery: QSD  . . . . . . . . . . . . . . . . . 17
     4.1.  Additional SEARCH Semantics  . . . . . . . . . . . . . . . 17
       4.1.1.  Example of Query Schema Discovery  . . . . . . . . . . 18
   5.  The DAV:basicsearch Grammar  . . . . . . . . . . . . . . . . . 19
     5.1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . 19
     5.2.  The DAV:basicsearch DTD  . . . . . . . . . . . . . . . . . 20
       5.2.1.  Example Query  . . . . . . . . . . . . . . . . . . . . 22
     5.3.  DAV:select . . . . . . . . . . . . . . . . . . . . . . . . 23
     5.4.  DAV:from . . . . . . . . . . . . . . . . . . . . . . . . . 23
       5.4.1.  Relationship to the Request-URI  . . . . . . . . . . . 23
       5.4.2.  Scope  . . . . . . . . . . . . . . . . . . . . . . . . 24
     5.5.  DAV:where  . . . . . . . . . . . . . . . . . . . . . . . . 24
       5.5.1.  Use of Three-Valued Logic in Queries . . . . . . . . . 24
       5.5.2.  Handling Optional Operators  . . . . . . . . . . . . . 24
       5.5.3.  Treatment of NULL Values . . . . . . . . . . . . . . . 24
       5.5.4.  Treatment of Properties with Mixed/Element Content . . 25
       5.5.5.  Example: Testing for Equality  . . . . . . . . . . . . 25
       5.5.6.  Example: Relative Comparisons  . . . . . . . . . . . . 25
     5.6.  DAV:orderby  . . . . . . . . . . . . . . . . . . . . . . . 26
       5.6.1.  Example of Sorting . . . . . . . . . . . . . . . . . . 26
     5.7.  Boolean Operators: DAV:and, DAV:or, and DAV:not  . . . . . 26
     5.8.  DAV:eq . . . . . . . . . . . . . . . . . . . . . . . . . . 27
        
     5.9.  DAV:lt, DAV:lte, DAV:gt, DAV:gte . . . . . . . . . . . . . 27
     5.10. DAV:literal  . . . . . . . . . . . . . . . . . . . . . . . 27
     5.11. DAV:typed-literal (Optional) . . . . . . . . . . . . . . . 28
       5.11.1. Example for Typed Numerical Comparison . . . . . . . . 28
     5.12. Support for Matching xml:lang Attributes on Properties . . 29
       5.12.1. DAV:language-defined (Optional)  . . . . . . . . . . . 29
       5.12.2. DAV:language-matches (Optional)  . . . . . . . . . . . 29
       5.12.3. Example of Language-Aware Matching . . . . . . . . . . 29
     5.13. DAV:is-collection  . . . . . . . . . . . . . . . . . . . . 30
       5.13.1. Example of DAV:is-collection . . . . . . . . . . . . . 30
     5.14. DAV:is-defined . . . . . . . . . . . . . . . . . . . . . . 30
     5.15. DAV:like . . . . . . . . . . . . . . . . . . . . . . . . . 30
       5.15.1. Syntax for the Literal Pattern . . . . . . . . . . . . 31
       5.15.2. Example of DAV:like  . . . . . . . . . . . . . . . . . 31
     5.16. DAV:contains . . . . . . . . . . . . . . . . . . . . . . . 31
       5.16.1. Result Scoring (DAV:score Element) . . . . . . . . . . 32
       5.16.2. Ordering by Score  . . . . . . . . . . . . . . . . . . 33
       5.16.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 33
     5.17. Limiting the Result Set  . . . . . . . . . . . . . . . . . 33
       5.17.1. Relationship to Result Ordering  . . . . . . . . . . . 33
     5.18. The 'caseless' XML Attribute . . . . . . . . . . . . . . . 34
     5.19. Query Schema for DAV:basicsearch . . . . . . . . . . . . . 34
       5.19.1. DTD for DAV:basicsearch QSD  . . . . . . . . . . . . . 34
       5.19.2. DAV:propdesc Element . . . . . . . . . . . . . . . . . 35
       5.19.3. The DAV:datatype Property Description  . . . . . . . . 35
       5.19.4. The DAV:searchable Property Description  . . . . . . . 36
       5.19.5. The DAV:selectable Property Description  . . . . . . . 36
       5.19.6. The DAV:sortable Property Description  . . . . . . . . 36
       5.19.7. The DAV:caseless Property Description  . . . . . . . . 36
       5.19.8. The DAV:operators XML Element  . . . . . . . . . . . . 37
       5.19.9. Example of Query Schema for DAV:basicsearch  . . . . . 38
   6.  Internationalization Considerations  . . . . . . . . . . . . . 39
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 39
     7.1.  Implications of XML External Entities  . . . . . . . . . . 39
   8.  Scalability  . . . . . . . . . . . . . . . . . . . . . . . . . 40
   9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 40
     9.1.  HTTP Headers . . . . . . . . . . . . . . . . . . . . . . . 40
       9.1.1.  DASL . . . . . . . . . . . . . . . . . . . . . . . . . 40
   10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 41
   11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 41
   12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 41
     12.1. Normative References . . . . . . . . . . . . . . . . . . . 41
     12.2. Informative References . . . . . . . . . . . . . . . . . . 42
   Appendix A.  Three-Valued Logic in DAV:basicsearch . . . . . . . . 44
   Appendix B.  Candidates for Future Protocol Extensions . . . . . . 45
     B.1.  Collation Support  . . . . . . . . . . . . . . . . . . . . 45
     B.2.  Count  . . . . . . . . . . . . . . . . . . . . . . . . . . 46
     B.3.  Diagnostics for Unsupported Queries  . . . . . . . . . . . 46
        
     5.9.  DAV:lt, DAV:lte, DAV:gt, DAV:gte . . . . . . . . . . . . . 27
     5.10. DAV:literal  . . . . . . . . . . . . . . . . . . . . . . . 27
     5.11. DAV:typed-literal (Optional) . . . . . . . . . . . . . . . 28
       5.11.1. Example for Typed Numerical Comparison . . . . . . . . 28
     5.12. Support for Matching xml:lang Attributes on Properties . . 29
       5.12.1. DAV:language-defined (Optional)  . . . . . . . . . . . 29
       5.12.2. DAV:language-matches (Optional)  . . . . . . . . . . . 29
       5.12.3. Example of Language-Aware Matching . . . . . . . . . . 29
     5.13. DAV:is-collection  . . . . . . . . . . . . . . . . . . . . 30
       5.13.1. Example of DAV:is-collection . . . . . . . . . . . . . 30
     5.14. DAV:is-defined . . . . . . . . . . . . . . . . . . . . . . 30
     5.15. DAV:like . . . . . . . . . . . . . . . . . . . . . . . . . 30
       5.15.1. Syntax for the Literal Pattern . . . . . . . . . . . . 31
       5.15.2. Example of DAV:like  . . . . . . . . . . . . . . . . . 31
     5.16. DAV:contains . . . . . . . . . . . . . . . . . . . . . . . 31
       5.16.1. Result Scoring (DAV:score Element) . . . . . . . . . . 32
       5.16.2. Ordering by Score  . . . . . . . . . . . . . . . . . . 33
       5.16.3. Examples . . . . . . . . . . . . . . . . . . . . . . . 33
     5.17. Limiting the Result Set  . . . . . . . . . . . . . . . . . 33
       5.17.1. Relationship to Result Ordering  . . . . . . . . . . . 33
     5.18. The 'caseless' XML Attribute . . . . . . . . . . . . . . . 34
     5.19. Query Schema for DAV:basicsearch . . . . . . . . . . . . . 34
       5.19.1. DTD for DAV:basicsearch QSD  . . . . . . . . . . . . . 34
       5.19.2. DAV:propdesc Element . . . . . . . . . . . . . . . . . 35
       5.19.3. The DAV:datatype Property Description  . . . . . . . . 35
       5.19.4. The DAV:searchable Property Description  . . . . . . . 36
       5.19.5. The DAV:selectable Property Description  . . . . . . . 36
       5.19.6. The DAV:sortable Property Description  . . . . . . . . 36
       5.19.7. The DAV:caseless Property Description  . . . . . . . . 36
       5.19.8. The DAV:operators XML Element  . . . . . . . . . . . . 37
       5.19.9. Example of Query Schema for DAV:basicsearch  . . . . . 38
   6.  Internationalization Considerations  . . . . . . . . . . . . . 39
   7.  Security Considerations  . . . . . . . . . . . . . . . . . . . 39
     7.1.  Implications of XML External Entities  . . . . . . . . . . 39
   8.  Scalability  . . . . . . . . . . . . . . . . . . . . . . . . . 40
   9.  IANA Considerations  . . . . . . . . . . . . . . . . . . . . . 40
     9.1.  HTTP Headers . . . . . . . . . . . . . . . . . . . . . . . 40
       9.1.1.  DASL . . . . . . . . . . . . . . . . . . . . . . . . . 40
   10. Contributors . . . . . . . . . . . . . . . . . . . . . . . . . 41
   11. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 41
   12. References . . . . . . . . . . . . . . . . . . . . . . . . . . 41
     12.1. Normative References . . . . . . . . . . . . . . . . . . . 41
     12.2. Informative References . . . . . . . . . . . . . . . . . . 42
   Appendix A.  Three-Valued Logic in DAV:basicsearch . . . . . . . . 44
   Appendix B.  Candidates for Future Protocol Extensions . . . . . . 45
     B.1.  Collation Support  . . . . . . . . . . . . . . . . . . . . 45
     B.2.  Count  . . . . . . . . . . . . . . . . . . . . . . . . . . 46
     B.3.  Diagnostics for Unsupported Queries  . . . . . . . . . . . 46
        
     B.4.  Language Matching  . . . . . . . . . . . . . . . . . . . . 46
     B.5.  Matching Media Types . . . . . . . . . . . . . . . . . . . 46
     B.6.  Query by Name  . . . . . . . . . . . . . . . . . . . . . . 46
     B.7.  Result Paging  . . . . . . . . . . . . . . . . . . . . . . 46
     B.8.  Search Scope Discovery . . . . . . . . . . . . . . . . . . 47
   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
        
     B.4.  Language Matching  . . . . . . . . . . . . . . . . . . . . 46
     B.5.  Matching Media Types . . . . . . . . . . . . . . . . . . . 46
     B.6.  Query by Name  . . . . . . . . . . . . . . . . . . . . . . 46
     B.7.  Result Paging  . . . . . . . . . . . . . . . . . . . . . . 46
     B.8.  Search Scope Discovery . . . . . . . . . . . . . . . . . . 47
   Index  . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
        
1. Introduction
1. 介绍
1.1. DASL
1.1. 达斯尔

This document defines Web Distributed Authoring and Versioning (WebDAV) SEARCH, an application of HTTP/1.1 forming a lightweight search protocol to transport queries and result sets that allows clients to make use of server-side search facilities. It is based on earlier work done in the IETF DASL Working Group (see Section 10). In this specification, the terms "WebDAV SEARCH" and "DASL" are used interchangeably.

本文档定义了Web分布式创作和版本控制(WebDAV)搜索,它是HTTP/1.1的一个应用程序,形成了一个轻量级搜索协议,用于传输查询和结果集,允许客户端使用服务器端搜索功能。它是基于IETF DASL工作组的早期工作(见第10节)。在本规范中,术语“WebDAV搜索”和“DASL”可互换使用。

DASL minimizes the complexity of clients so as to facilitate widespread deployment of applications capable of utilizing the DASL search mechanisms.

DASL将客户机的复杂性降至最低,从而促进能够利用DASL搜索机制的应用程序的广泛部署。

DASL consists of:

DASL包括:

o the SEARCH method and the request/response formats defined for it (Section 2),

o 搜索方法和为其定义的请求/响应格式(第2节),

o feature discovery through the "DASL" response header and the optional DAV:supported-grammar-set property (Section 3),

o 通过“DASL”响应头和可选的DAV:supported grammar set属性(第3节)进行功能发现,

o optional grammar schema discovery (Section 4), and

o 可选语法模式发现(第4节),以及

o one mandatory grammar: DAV:basicsearch (Section 5).

o 一个强制性语法:DAV:basicsearch(第5节)。

1.2. Relationship to DAV
1.2. 与DAV的关系

DASL relies on the resource and property model defined by [RFC4918]. DASL does not alter this model. Instead, DASL allows clients to access DAV-modeled resources through server-side search.

DASL依赖于[RFC4918]定义的资源和属性模型。DASL不会改变此模型。相反,DASL允许客户端通过服务器端搜索访问DAV建模的资源。

1.3. Terms
1.3. 条款

This document uses the terms defined in [RFC2616], [RFC4918], [RFC3253], and in this section.

本文件使用[RFC2616]、[RFC4918]、[RFC3253]和本节中定义的术语。

Criteria

标准

An expression against which each resource in the search scope is evaluated.

用于计算搜索范围中每个资源的表达式。

Query

查询

A query is a combination of a search scope, search criteria, result record definition, sort specification, and a search modifier.

查询是搜索范围、搜索条件、结果记录定义、排序规范和搜索修饰符的组合。

Query Grammar

查询语法

A set of definitions of XML elements, attributes, and constraints on their relations and values that defines a set of queries and the intended semantics.

XML元素、属性及其关系和值约束的一组定义,用于定义一组查询和预期语义。

Query Schema

查询模式

A listing, for any given grammar and scope, of the properties and operators that may be used in a query with that grammar and scope.

对于任何给定的语法和范围,可以在具有该语法和范围的查询中使用的属性和运算符的列表。

Result

后果

A result is a result set, optionally augmented with other information describing the search as a whole.

结果是一个结果集,可以选择添加描述整个搜索的其他信息。

Result Record

成绩记录

A description of a resource. A result record is a set of properties, and possibly other descriptive information.

对资源的描述。结果记录是一组属性,可能还有其他描述性信息。

Result Record Definition

结果记录定义

A specification of the set of properties to be returned in the result record.

要在结果记录中返回的属性集的规范。

Result Set

结果集

A set of records, one for each resource for which the search criteria evaluated to True.

一组记录,每个资源对应一条记录,搜索条件的计算结果为True。

Scope

范围

A set of resources to be searched.

要搜索的一组资源。

Search Arbiter

搜索仲裁者

A resource that supports the SEARCH method.

支持搜索方法的资源。

Search Modifier

搜索修改器

An instruction that governs the execution of the query but is not part of the search scope, result record definition, the search criteria, or the sort specification. An example of a search modifier is one that controls how much time the server can spend on the query before giving a response.

一种指令,用于控制查询的执行,但不属于搜索范围、结果记录定义、搜索条件或排序规范的一部分。搜索修饰符的一个示例是控制服务器在给出响应之前可以在查询上花费多少时间的修饰符。

Sort Specification

排序规范

A specification of an ordering on the result records in the result set.

结果集中结果记录的排序规范。

1.4. Notational Conventions
1.4. 符号约定

This specification uses the Augmented Backus-Naur Form (ABNF) notation of [RFC5234], unless explicitly stated otherwise.

除非另有明确说明,否则本规范使用[RFC5234]的增广巴科斯诺尔形式(ABNF)符号。

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in [RFC2119].

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照[RFC2119]中所述进行解释。

This document uses XML DTD fragments ([XML], Section 3.2) as a purely notational convention. WebDAV request and response bodies cannot be validated by a DTD due to the specific extensibility rules defined in Section 17 of [RFC4918] and due to the fact that all XML elements defined by this specification use the XML namespace name "DAV:". In particular:

本文档使用XML DTD片段([XML],第3.2节)作为纯粹的符号约定。由于[RFC4918]第17节中定义的特定扩展性规则以及本规范定义的所有XML元素都使用XML命名空间名称“DAV:”,DTD无法验证WebDAV请求和响应主体。特别地:

1. element names use the "DAV:" namespace,

1. 元素名称使用“DAV:”名称空间,

2. element ordering is irrelevant unless explicitly stated,

2. 除非明确说明,否则元素顺序无关,

3. extension elements (elements not already defined as valid child elements) may be added anywhere, except when explicitly stated otherwise,

3. 扩展元素(尚未定义为有效子元素的元素)可以添加到任何位置,除非另有明确说明,

4. extension attributes (attributes not already defined as valid for this element) may be added anywhere, except when explicitly stated otherwise.

4. 扩展属性(尚未定义为此元素有效的属性)可以添加到任何位置,除非另有明确说明。

When an XML element type in the "DAV:" namespace is referenced in this document outside of the context of an XML fragment, the string "DAV:" will be prefixed to the element type.

当“DAV:”命名空间中的XML元素类型在XML片段上下文之外的文档中被引用时,字符串“DAV:”将作为元素类型的前缀。

Similarly, when an XML element type in the namespace "http://www.w3.org/2001/XMLSchema" is referenced in this document outside of the context of an XML fragment, the string "xs:" will be prefixed to the element type.

类似地,当命名空间中的XML元素类型http://www.w3.org/2001/XMLSchema在XML片段的上下文之外引用,字符串“xs:”将作为元素类型的前缀。

This document inherits, and sometimes extends, DTD productions from Section 14 of [RFC4918].

本文档继承并有时扩展[RFC4918]第14节中的DTD产品。

1.5. Note on Usage of 'DAV:' XML Namespace
1.5. 关于“DAV:”XML名称空间用法的说明

This specification defines elements, properties, and condition names in the XML namespace "DAV:". In general, only specifications authored by IETF working groups are supposed to do this. In this case an exception was made, because WebDAV SEARCH started its life in the IETF DASL working group (<http://www.webdav.org/dasl/>, and at the time the working group closed down there was already significant deployment of this specification.

此规范定义XML命名空间“DAV:”中的元素、属性和条件名称。一般来说,只有IETF工作组编写的规范才应该这样做。在本例中,出现了一个例外,因为WebDAV搜索从IETF DASL工作组开始(<http://www.webdav.org/dasl/>,而在工作组关闭时,该规范已经大量部署。

1.6. An Overview of DASL at Work
1.6. DASL工作概述

One can express the basic usage of DASL in the following steps:

可以通过以下步骤表达DASL的基本用法:

o The client constructs a query using the DAV:basicsearch grammar.

o 客户端使用DAV:basicsearch语法构造查询。

o The client invokes the SEARCH method on a resource that will perform the search (the search arbiter) and includes a text/xml or application/xml request entity that contains the query.

o 客户机对将执行搜索的资源(搜索仲裁器)调用搜索方法,并包括包含查询的text/xml或application/xml请求实体。

o The search arbiter performs the query.

o 搜索仲裁器执行查询。

o The search arbiter sends the results of the query back to the client in the response. The server MUST send an entity that matches the WebDAV multistatus format ([RFC4918], Section 13).

o 搜索仲裁器在响应中将查询结果发送回客户端。服务器必须发送与WebDAV multistatus格式匹配的实体([RFC4918],第13节)。

2. The SEARCH Method
2. 搜索方法
2.1. Overview
2.1. 概述

The client invokes the SEARCH method to initiate a server-side search. The body of the request defines the query. The server MUST emit an entity matching the WebDAV multistatus format ([RFC4918], Section 13).

客户端调用SEARCH方法来启动服务器端搜索。请求的主体定义了查询。服务器必须发出与WebDAV multistatus格式匹配的实体([RFC4918],第13节)。

The SEARCH method plays the role of transport mechanism for the query and the result set. It does not define the semantics of the query. The type of the query defines the semantics.

搜索方法充当查询和结果集的传输机制。它没有定义查询的语义。查询的类型定义了语义。

SEARCH is a safe method; it does not have any significance other than executing a query and returning a query result (see [RFC2616], Section 9.1.1).

搜索是一种安全的方法;除了执行查询并返回查询结果外,它没有任何意义(参见[RFC2616],第9.1.1节)。

2.2. The Request
2.2. 请求

The client invokes the SEARCH method on the resource named by the Request-URI.

客户端调用由请求URI命名的资源上的搜索方法。

2.2.1. The Request-URI
2.2.1. 请求URI

The Request-URI identifies the search arbiter. Any HTTP resource may function as search arbiter. It is not a new type of resource (in the sense of DAV:resourcetype as defined in [RFC4918], Section 15.9), nor does it have to be a WebDAV-compliant resource.

请求URI标识搜索仲裁器。任何HTTP资源都可以用作搜索仲裁器。它不是一种新的资源类型(根据[RFC4918]第15.9节中定义的DAV:resourcetype的意义),也不一定是符合WebDAV的资源。

The SEARCH method defines no relationship between the arbiter and the scope of the search; rather, the particular query grammar used in the query defines the relationship. For example, a query grammar may force the Request-URI to correspond exactly to the search scope.

搜索方法不定义仲裁人和搜索范围之间的关系;相反,查询中使用的特定查询语法定义了关系。例如,查询语法可能会强制请求URI与搜索范围完全对应。

2.2.2. The Request Body
2.2.2. 请求机构

The server MUST process a text/xml or application/xml request body, and MAY process request bodies in other formats. See [RFC3023] for guidance on packaging XML in requests.

服务器必须处理text/xml或application/xml请求体,并且可以处理其他格式的请求体。请参阅[RFC3023]以了解在请求中打包XML的指导。

Marshalling:

编组:

If a request body with content type text/xml or application/xml is included, it MUST be either a DAV:searchrequest or a DAV:query-schema-discovery XML element. Its single child element identifies the query grammar.

如果包含内容类型为text/xml或application/xml的请求正文,则它必须是DAV:searchrequest或DAV:query模式发现xml元素。它的单个子元素标识查询语法。

For DAV:searchrequest, the definition of search criteria, the result record, and any other details needed to perform the search depend on the individual search grammar.

对于DAV:searchrequest,搜索条件的定义、结果记录以及执行搜索所需的任何其他详细信息取决于单个搜索语法。

For DAV:query-schema-discovery, the semantics is defined in Section 4.

对于DAV:查询模式发现,语义在第4节中定义。

Preconditions:

先决条件:

(DAV:search-grammar-discovery-supported): when an XML request body is present and has a DAV:query-schema-discovery document element, the server MUST support the query schema discovery mechanism described in Section 4.

(DAV:search grammar discovery supported):当存在XML请求主体并且具有DAV:query schema discovery文档元素时,服务器必须支持第4节中描述的查询模式发现机制。

(DAV:search-grammar-supported): when an XML request body is present, the search grammar identified by the document element's child element must be a supported search grammar.

(DAV:支持的搜索语法):当存在XML请求主体时,由文档元素的子元素标识的搜索语法必须是受支持的搜索语法。

(DAV:search-multiple-scope-supported): if the SEARCH request specified multiple scopes, the server MUST support this optional feature.

(DAV:支持搜索多个作用域):如果搜索请求指定了多个作用域,则服务器必须支持此可选功能。

(DAV:search-scope-valid): the supplied search scope must be valid. There can be various reasons for a search scope to be invalid, including unsupported URI schemes and communication problems. Servers MAY add [RFC4918] compliant DAV:response elements as content to the condition element indicating the precise reason for the failure.

(DAV:搜索范围有效):提供的搜索范围必须有效。搜索范围无效可能有多种原因,包括不支持的URI方案和通信问题。服务器可以将符合[RFC4918]的DAV:response元素作为内容添加到条件元素中,以指示故障的确切原因。

2.3. The Successful 207 (Multistatus) Response
2.3. 成功的207(多状态)响应

If the server returns 207 (Multistatus), then the search proceeded successfully, and the response MUST use the WebDAV multistatus format ([RFC4918], Section 13). The results of this method SHOULD NOT be cached.

如果服务器返回207(Multistatus),则搜索将成功进行,并且响应必须使用WebDAV Multistatus格式([RFC4918],第13节)。不应缓存此方法的结果。

There MUST be one DAV:response for each resource that matched the search criteria. For each such response, the DAV:href element contains the URI of the resource, and the response MUST include a DAV:propstat element.

与搜索条件匹配的每个资源必须有一个DAV:响应。对于每个这样的响应,DAV:href元素都包含资源的URI,并且响应必须包含DAV:propstat元素。

Note: the WebDAV multistatus format requires at least one DAV: response child element. This specification relaxes that restriction so that empty results can be represented.

注意:WebDAV multistatus格式至少需要一个DAV:response子元素。此规范放宽了该限制,以便可以表示空结果。

Note that for each matching resource found, there may be multiple URIs within the search scope mapped to it. In this case, a server SHOULD report only one of these URIs. Clients can use the live property DAV:resource-id, defined in Section 3.1 of [WEBDAV-BIND] to identify possible duplicates.

请注意,对于找到的每个匹配资源,在映射到它的搜索范围内可能有多个URI。在这种情况下,服务器应该只报告其中一个URI。客户端可以使用[WEBDAV-BIND]第3.1节中定义的live属性DAV:resource id来识别可能的重复项。

2.3.1. Result Set Truncation
2.3.1. 结果集截断

A server MAY limit the number of resources in a reply, for example, to limit the amount of resources expended in processing a query. If

例如,服务器可以限制回复中的资源数量,以限制处理查询所花费的资源量。如果

it does so, the reply MUST use status code 207, return a DAV: multistatus response body, and indicate a status of 507 (Insufficient Storage) for the search arbiter URI. It SHOULD include the partial results.

如果执行此操作,则应答必须使用状态代码207,返回DAV:multistatus响应主体,并为搜索仲裁器URI指示507(存储不足)的状态。它应该包括部分结果。

When a result set is truncated, there may be many more resources that satisfy the search criteria but that were not examined.

当结果集被截断时,可能会有更多的资源满足搜索条件,但未被检查。

If partial results are included and the client requested an ordered result set in the original request, then any partial results that are returned MUST be ordered as the client directed.

如果包含部分结果,并且客户端在原始请求中请求了一个有序的结果集,则返回的任何部分结果都必须按照客户端的指示进行排序。

Note that the partial results returned MAY be any subset of the result set that would have satisfied the original query.

请注意,返回的部分结果可能是满足原始查询的结果集的任何子集。

2.3.2. Extending the PROPFIND Response
2.3.2. 扩展PROPFIND响应

A response MAY include more information than PROPFIND defines, so long as the extra information does not invalidate the PROPFIND response. Query grammars SHOULD define how the response matches the PROPFIND response.

一个响应可能包含比PROPFIND定义的更多的信息,只要额外的信息不会使PROPFIND响应无效。查询语法应该定义响应如何匹配PROPFIND响应。

2.3.3. Example: A Simple Request and Response
2.3.3. 示例:一个简单的请求和响应

This example demonstrates the request and response framework. The following XML document shows a simple (hypothetical) natural language query. The name of the query element is natural-language-query in the XML namespace "http://example.com/foo". The actual query is "Find the locations of good Thai restaurants in Los Angeles". For this hypothetical query, the arbiter returns two properties for each selected resource.

此示例演示了请求和响应框架。下面的XML文档显示了一个简单的(假设的)自然语言查询。查询元素的名称是XML命名空间中的自然语言查询“http://example.com/foo". 实际的查询是“查找洛杉矶好的泰国餐馆的位置”。对于这个假设查询,仲裁器为每个选定的资源返回两个属性。

>> Request:

>>请求:

   SEARCH / HTTP/1.1
   Host: example.org
   Content-Type: application/xml; charset="utf-8"
   Content-Length: 252
        
   SEARCH / HTTP/1.1
   Host: example.org
   Content-Type: application/xml; charset="utf-8"
   Content-Length: 252
        
   <?xml version="1.0" encoding="UTF-8"?>
   <D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo">
     <F:natural-language-query>
       Find the locations of good Thai restaurants in Los Angeles
     </F:natural-language-query>
   </D:searchrequest>
        
   <?xml version="1.0" encoding="UTF-8"?>
   <D:searchrequest xmlns:D="DAV:" xmlns:F="http://example.com/foo">
     <F:natural-language-query>
       Find the locations of good Thai restaurants in Los Angeles
     </F:natural-language-query>
   </D:searchrequest>
        

>> Response:

>>答复:

   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 429
        
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 429
        
   <?xml version="1.0" encoding="UTF-8"?>
   <D:multistatus xmlns:D="DAV:"
      xmlns:R="http://example.org/propschema">
     <D:response>
       <D:href>http://siamiam.example/</D:href>
       <D:propstat>
         <D:prop>
           <R:location>259 W. Hollywood</R:location>
           <R:rating><R:stars>4</R:stars></R:rating>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
   </D:multistatus>
        
   <?xml version="1.0" encoding="UTF-8"?>
   <D:multistatus xmlns:D="DAV:"
      xmlns:R="http://example.org/propschema">
     <D:response>
       <D:href>http://siamiam.example/</D:href>
       <D:propstat>
         <D:prop>
           <R:location>259 W. Hollywood</R:location>
           <R:rating><R:stars>4</R:stars></R:rating>
         </D:prop>
         <D:status>HTTP/1.1 200 OK</D:status>
       </D:propstat>
     </D:response>
   </D:multistatus>
        
2.3.4. Example: Result Set Truncation
2.3.4. 示例:结果集截断

In the example below, the server returns just two results, and then indicates that the result is truncated by adding a DAV:response element for the search arbiter resource with 507 (Insufficient Storage) status.

在下面的示例中,服务器只返回两个结果,然后通过为状态为507(存储不足)的搜索仲裁器资源添加DAV:response元素来指示结果被截断。

>> Request:

>>请求:

   SEARCH / HTTP/1.1
   Host: example.net
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxx
        
   SEARCH / HTTP/1.1
   Host: example.net
   Content-Type: text/xml; charset="utf-8"
   Content-Length: xxx
        

... the query goes here ...

... 这里是查询。。。

>> Response:

>>答复:

   HTTP/1.1 207 Multistatus
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 640
        
   HTTP/1.1 207 Multistatus
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 640
        
   <?xml version="1.0" encoding="utf-8"?>
   <D:multistatus xmlns:D="DAV:">
     <D:response>
       <D:href>http://www.example.net/sounds/unbrokenchain.au</D:href>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:response>
     <D:response>
       <D:href>http://tech.mit.example/arch96/photos/Lesh1.jpg</D:href>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:response>
     <D:response>
       <D:href>http://example.net</D:href>
       <D:status>HTTP/1.1 507 Insufficient Storage</D:status>
       <D:responsedescription xml:lang="en">
          Only first two matching records were returned
       </D:responsedescription>
     </D:response>
   </D:multistatus>
        
   <?xml version="1.0" encoding="utf-8"?>
   <D:multistatus xmlns:D="DAV:">
     <D:response>
       <D:href>http://www.example.net/sounds/unbrokenchain.au</D:href>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:response>
     <D:response>
       <D:href>http://tech.mit.example/arch96/photos/Lesh1.jpg</D:href>
       <D:status>HTTP/1.1 200 OK</D:status>
     </D:response>
     <D:response>
       <D:href>http://example.net</D:href>
       <D:status>HTTP/1.1 507 Insufficient Storage</D:status>
       <D:responsedescription xml:lang="en">
          Only first two matching records were returned
       </D:responsedescription>
     </D:response>
   </D:multistatus>
        
2.4. Unsuccessful Responses
2.4. 不成功的回答

If a SEARCH request could not be executed or the attempt to execute it resulted in an error, the server MUST indicate the failure with an appropriate status code and SHOULD add a response body as defined in Section 1.6 of [RFC3253]. Unless otherwise stated, condition elements are empty; however, specific condition elements MAY include additional child elements that describe the error condition in more detail.

如果无法执行搜索请求或尝试执行该请求导致错误,服务器必须使用适当的状态代码指示故障,并应添加[RFC3253]第1.6节中定义的响应正文。除非另有说明,否则条件元素为空;但是,特定条件元素可能包括更详细地描述错误条件的附加子元素。

2.4.1. Example of an Invalid Scope
2.4.1. 无效作用域的示例

In the example below, a request failed because the scope identifies a HTTP resource that was not found.

在下面的示例中,请求失败,因为作用域标识了未找到的HTTP资源。

>> Response:

>>答复:

   HTTP/1.1 409 Conflict
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 275
        
   HTTP/1.1 409 Conflict
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 275
        
   <?xml version="1.0" encoding="UTF-8"?>
   <d:error xmlns:d="DAV:">
     <d:search-scope-valid>
       <d:response>
         <d:href>http://www.example.com/X</d:href>
         <d:status>HTTP/1.1 404 Object Not Found</d:status>
       </d:response>
     </d:search-scope-valid>
   </d:error>
        
   <?xml version="1.0" encoding="UTF-8"?>
   <d:error xmlns:d="DAV:">
     <d:search-scope-valid>
       <d:response>
         <d:href>http://www.example.com/X</d:href>
         <d:status>HTTP/1.1 404 Object Not Found</d:status>
       </d:response>
     </d:search-scope-valid>
   </d:error>
        
3. Discovery of Supported Query Grammars
3. 发现支持的查询语法

Servers MUST support discovery of the query grammars supported by a search arbiter resource.

服务器必须支持搜索仲裁器资源支持的查询语法的发现。

Clients can determine which query grammars are supported by an arbiter by invoking OPTIONS on the search arbiter. If the resource supports SEARCH, then the DASL response header will appear in the response. The DASL response header lists the supported grammars.

客户端可以通过调用搜索仲裁器上的选项来确定仲裁器支持哪些查询语法。如果资源支持搜索,则DASL响应标头将出现在响应中。DASL响应标头列出了支持的语法。

Servers supporting the WebDAV extensions [RFC3253] and/or [RFC3744] MUST also:

支持WebDAV扩展[RFC3253]和/或[RFC3744]的服务器还必须:

o report SEARCH in the live property DAV:supported-method-set for all search arbiter resources, and

o live属性DAV中的报告搜索:所有搜索仲裁器资源的支持方法集,以及

o support the live property DAV:supported-query-grammar-set as defined in Section 3.3.

o 支持live property DAV:第3.3节中定义的受支持查询语法集。

3.1. The OPTIONS Method
3.1. 期权法

The OPTIONS method allows the client to discover if a resource supports the SEARCH method and to determine the list of search grammars supported for that resource.

OPTIONS方法允许客户端发现资源是否支持搜索方法,并确定该资源支持的搜索语法列表。

The client issues the OPTIONS method against a resource named by the Request-URI. This is a normal invocation of OPTIONS as defined in Section 9.2 of [RFC2616].

客户端针对由请求URI命名的资源发出OPTIONS方法。这是对[RFC2616]第9.2节中定义的选项的正常调用。

If a resource supports the SEARCH method, then the server MUST list SEARCH in the Allow header defined in Section 14.7 of [RFC2616].

如果资源支持搜索方法,则服务器必须在[RFC2616]第14.7节中定义的允许标头中列出搜索。

DASL servers MUST include the DASL header in the OPTIONS response. This header identifies the search grammars supported by that resource.

DASL服务器必须在选项响应中包含DASL标头。此标题标识该资源支持的搜索语法。

3.2. The DASL Response Header
3.2. DASL响应头
   DASLHeader = "DASL" ":" 1#Coded-URL
   Coded-URL  = <defined in Section 10.1 of [RFC4918]>
        
   DASLHeader = "DASL" ":" 1#Coded-URL
   Coded-URL  = <defined in Section 10.1 of [RFC4918]>
        

(This grammar uses the augmented BNF format defined in Section 2.1 of [RFC2616].)

(该语法使用[RFC2616]第2.1节中定义的扩充BNF格式。)

The DASL response header indicates server support for query grammars in the OPTIONS method. The value is a list of URIs that indicate the types of supported grammars. Note that although the URIs can be used to identify each supported search grammar, there is not necessarily a direct relationship between the URI and the XML element name that can be used in XML based SEARCH requests (the element name itself is identified by its namespace name (a URI reference) and the element's local name).

DASL响应标头表示服务器支持OPTIONS方法中的查询语法。该值是一个URI列表,指示受支持语法的类型。请注意,尽管URI可用于标识每个受支持的搜索语法,但URI和XML元素名称之间不一定存在可用于基于XML的搜索请求的直接关系(元素名称本身由其名称空间名称(URI引用)和元素的本地名称标识)。

Note: this header field value is defined as a comma-separated list ([RFC2616], Section 4.2); thus, grammar URIs can appear in multiple header instances, separated by commas, or both.

注:该标题字段值定义为逗号分隔列表([RFC2616],第4.2节);因此,语法URI可以出现在多个头实例中,用逗号分隔,或者两者都出现。

For example:

例如:

   DASL: <http://foobar.example/syntax1>,
         <http://akuma.example/syntax2>, <DAV:basicsearch>
   DASL: <http://example.com/foo/natural-language-query>
        
   DASL: <http://foobar.example/syntax1>,
         <http://akuma.example/syntax2>, <DAV:basicsearch>
   DASL: <http://example.com/foo/natural-language-query>
        
3.3. DAV:supported-query-grammar-set (Protected)
3.3. DAV:支持的查询语法集(受保护)

This WebDAV property is required for any server supporting either [RFC3253] and/or [RFC3744] and identifies the XML-based query grammars that are supported by the search arbiter resource.

任何支持[RFC3253]和/或[RFC3744]的服务器都需要此WebDAV属性,并标识搜索仲裁器资源支持的基于XML的查询语法。

   <!ELEMENT supported-query-grammar-set (supported-query-grammar*)>
   <!ELEMENT supported-query-grammar (grammar)>
   <!ELEMENT grammar ANY>
   <!-- ANY value: a query grammar element type -->
        
   <!ELEMENT supported-query-grammar-set (supported-query-grammar*)>
   <!ELEMENT supported-query-grammar (grammar)>
   <!ELEMENT grammar ANY>
   <!-- ANY value: a query grammar element type -->
        
3.4. Example: Grammar Discovery
3.4. 示例:语法发现

This example shows that the server supports search on the /somefolder resource with the query grammars: DAV:basicsearch, http://foobar.example/syntax1 and http://akuma.example/syntax2. Note that servers supporting WebDAV SEARCH MUST support DAV:basicsearch.

此示例显示服务器支持使用以下查询语法搜索/somefolder资源:DAV:basicsearch,http://foobar.example/syntax1 和http://akuma.example/syntax2. 请注意,支持WebDAV搜索的服务器必须支持DAV:basicsearch。

>> Request:

>>请求:

OPTIONS /somefolder HTTP/1.1 Host: example.org

选项/somefolder HTTP/1.1主机:example.org

>> Response:

>>答复:

   HTTP/1.1 200 OK
   Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
   Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
   DASL: <DAV:basicsearch>
   DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2>
        
   HTTP/1.1 200 OK
   Allow: OPTIONS, GET, HEAD, POST, PUT, DELETE, TRACE, COPY, MOVE
   Allow: MKCOL, PROPFIND, PROPPATCH, LOCK, UNLOCK, SEARCH
   DASL: <DAV:basicsearch>
   DASL: <http://foobar.example/syntax1>, <http://akuma.example/syntax2>
        

This example shows the equivalent taking advantage of a server's support for DAV:supported-method-set and DAV:supported-query-grammar-set.

此示例显示了利用服务器对DAV:supported方法集和DAV:supported查询语法集的支持的等效方法。

>> Request:

>>请求:

   PROPFIND /somefolder HTTP/1.1
   Host: example.org
   Depth: 0
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 165
        
   PROPFIND /somefolder HTTP/1.1
   Host: example.org
   Depth: 0
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 165
        
   <?xml version="1.0" encoding="UTF-8" ?>
   <propfind xmlns="DAV:">
     <prop>
       <supported-query-grammar-set/>
       <supported-method-set/>
     </prop>
   </propfind>
        
   <?xml version="1.0" encoding="UTF-8" ?>
   <propfind xmlns="DAV:">
     <prop>
       <supported-query-grammar-set/>
       <supported-method-set/>
     </prop>
   </propfind>
        

>> Response:

>>答复:

   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 1349
        
   HTTP/1.1 207 Multi-Status
   Content-Type: text/xml; charset="utf-8"
   Content-Length: 1349
        
   <?xml version="1.0" encoding="utf-8" ?>
   <multistatus xmlns="DAV:">
    <response>
     <href>http://example.org/somefolder</href>
     <propstat>
      <prop>
       <supported-query-grammar-set>
        <supported-query-grammar>
         <grammar><basicsearch/></grammar>
        </supported-query-grammar>
        <supported-query-grammar>
         <grammar><syntax1 xmlns="http://foobar.example/"/></grammar>
        </supported-query-grammar>
        <supported-query-grammar>
         <grammar><syntax2 xmlns="http://akuma.example/"/></grammar>
        </supported-query-grammar>
       </supported-query-grammar-set>
       <supported-method-set>
        <supported-method name="COPY" />
        <supported-method name="DELETE" />
        <supported-method name="GET" />
        <supported-method name="HEAD" />
        <supported-method name="LOCK" />
        <supported-method name="MKCOL" />
        <supported-method name="MOVE" />
        <supported-method name="OPTIONS" />
        <supported-method name="POST" />
        <supported-method name="PROPFIND" />
        <supported-method name="PROPPATCH" />
        <supported-method name="PUT" />
        <supported-method name="SEARCH" />
        <supported-method name="TRACE" />
        <supported-method name="UNLOCK" />
       </supported-method-set>
      </prop>
      <status>HTTP/1.1 200 OK</status>
     </propstat>
    </response>
   </multistatus>
        
   <?xml version="1.0" encoding="utf-8" ?>
   <multistatus xmlns="DAV:">
    <response>
     <href>http://example.org/somefolder</href>
     <propstat>
      <prop>
       <supported-query-grammar-set>
        <supported-query-grammar>
         <grammar><basicsearch/></grammar>
        </supported-query-grammar>
        <supported-query-grammar>
         <grammar><syntax1 xmlns="http://foobar.example/"/></grammar>
        </supported-query-grammar>
        <supported-query-grammar>
         <grammar><syntax2 xmlns="http://akuma.example/"/></grammar>
        </supported-query-grammar>
       </supported-query-grammar-set>
       <supported-method-set>
        <supported-method name="COPY" />
        <supported-method name="DELETE" />
        <supported-method name="GET" />
        <supported-method name="HEAD" />
        <supported-method name="LOCK" />
        <supported-method name="MKCOL" />
        <supported-method name="MOVE" />
        <supported-method name="OPTIONS" />
        <supported-method name="POST" />
        <supported-method name="PROPFIND" />
        <supported-method name="PROPPATCH" />
        <supported-method name="PUT" />
        <supported-method name="SEARCH" />
        <supported-method name="TRACE" />
        <supported-method name="UNLOCK" />
       </supported-method-set>
      </prop>
      <status>HTTP/1.1 200 OK</status>
     </propstat>
    </response>
   </multistatus>
        

Note that the query grammar element names marshalled as part of the DAV:supported-query-grammar-set can be directly used as element names in an XML-based query.

请注意,作为DAV:supported查询语法集的一部分编组的查询语法元素名称可以直接用作基于XML的查询中的元素名称。

4. Query Schema Discovery: QSD
4. 查询模式发现:QSD

Servers MAY support the discovery of the schema for a query grammar.

服务器可能支持查询语法模式的发现。

The DASL response header and the DAV:supported-query-grammar-set property provide means for clients to discover the set of query grammars supported by a resource. This alone is not sufficient information for a client to generate a query. For example, the DAV: basicsearch grammar defines a set of queries consisting of a set of operators applied to a set of properties and values, but the grammar itself does not specify which properties may be used in the query. QSD for the DAV:basicsearch grammar allows a client to discover the set of properties that are searchable, selectable, and sortable. Moreover, although the DAV:basicsearch grammar defines a minimal set of operators, it is possible that a resource might support additional operators in a query. For example, a resource might support an optional operator that can be used to express content-based queries in a proprietary syntax. QSD allows a client to discover these operators and their syntax. The set of discoverable quantities will differ from grammar to grammar, but each grammar can define a means for a client to discover what can be discovered.

DASL响应头和DAV:supported查询语法集属性为客户端提供了发现资源支持的查询语法集的方法。仅此一点还不足以让客户机生成查询。例如,DAV:basicsearch语法定义了一组查询,这些查询由应用于一组属性和值的一组运算符组成,但语法本身没有指定查询中可以使用哪些属性。DAV:basicsearch语法的QSD允许客户端发现可搜索、可选择和可排序的属性集。此外,尽管DAV:basicsearch语法定义了一组最小的运算符,但资源可能支持查询中的其他运算符。例如,资源可能支持一个可选的运算符,该运算符可用于以专有语法表示基于内容的查询。QSD允许客户端发现这些运算符及其语法。可发现量的集合因语法而异,但每种语法都可以为客户端定义一种方法来发现可以发现的内容。

In general, the schema for a given query grammar depends on both the resource (the arbiter) and the scope. A given resource might have access to one set of properties for one potential scope, and another set for a different scope. For example, consider a server able to search two distinct collections: one holding cooking recipes, the other design documents for nuclear weapons. While both collections might support properties such as author, title, and date, the first might also define properties such as calories and preparation time, while the second defined properties such as yield and applicable patents. Two distinct arbiters indexing the same collection might also have access to different properties. For example, the recipe collection mentioned above might also be indexed by a value-added server that also stored the names of chefs who had tested the recipe. Note also that the available query schema might also depend on other factors, such as the identity of the principal conducting the search, but these factors are not exposed in this protocol.

通常,给定查询语法的模式取决于资源(仲裁器)和范围。给定的资源可以访问一个潜在作用域的一组属性,以及另一个不同作用域的属性。例如,考虑一个服务器,可以搜索两个不同的集合:一个持有烹饪食谱,其他设计文件的核武器。虽然两个集合都可能支持作者、标题和日期等属性,但第一个集合还可能定义卡路里和制备时间等属性,而第二个集合定义产量和适用专利等属性。索引同一集合的两个不同仲裁器也可以访问不同的属性。例如,上面提到的配方集合也可能由增值服务器编制索引,该服务器还存储了测试配方的厨师的姓名。还请注意,可用的查询模式可能还取决于其他因素,例如执行搜索的主体的身份,但是这些因素在本协议中没有公开。

4.1. Additional SEARCH Semantics
4.1. 附加搜索语义

Each query grammar supported by DASL defines its own syntax for expressing the possible query schema. A client retrieves the schema for a given query grammar on an arbiter resource with a given scope

DASL支持的每个查询语法都定义了自己的语法来表示可能的查询模式。客户机在具有给定范围的仲裁器资源上检索给定查询语法的模式

by invoking the SEARCH method on that arbiter with that grammar and scope and with a root element of DAV:query-schema-discovery rather than DAV:searchrequest.

通过使用该语法和范围以及DAV:query schema discovery而不是DAV:searchrequest的根元素在仲裁器上调用搜索方法。

Marshalling:

编组:

The request body MUST be a DAV:query-schema-discovery element.

请求主体必须是DAV:query架构发现元素。

      <!ELEMENT query-schema-discovery ANY>
      <!-- ANY value: XML element specifying the query grammar
                      and the scope -->
        
      <!ELEMENT query-schema-discovery ANY>
      <!-- ANY value: XML element specifying the query grammar
                      and the scope -->
        

The response body takes the form of a DAV:multistatus element ([RFC4918], Section 13), where DAV:response is extended to hold the returned query grammar inside a DAV:query-schema container element.

响应主体采用DAV:multistatus元素的形式([RFC4918],第13节),其中DAV:response被扩展以将返回的查询语法保存在DAV:query模式容器元素中。

      <!ELEMENT response (href, status, query-schema?,
        responsedescription?) >
      <!ELEMENT query-schema ANY>
        
      <!ELEMENT response (href, status, query-schema?,
        responsedescription?) >
      <!ELEMENT query-schema ANY>
        

The content of this container is an XML element whose name and syntax depend upon the grammar, and whose value may (and likely will) vary depending upon the grammar, arbiter, and scope.

此容器的内容是一个XML元素,其名称和语法取决于语法,其值可能(也可能会)因语法、仲裁器和范围而异。

4.1.1. Example of Query Schema Discovery
4.1.1. 查询模式发现示例

In this example, the arbiter is recipes.example, the grammar is DAV: basicsearch, the scope is also recipes.example.

在本例中,仲裁人是recipes.example,语法是DAV:basicsearch,范围也是recipes.example。

>> Request:

>>请求:

   SEARCH / HTTP/1.1
   Host: recipes.example
   Content-Type: application/xml; charset="utf-8"
   Content-Length: 258
        
   SEARCH / HTTP/1.1
   Host: recipes.example
   Content-Type: application/xml; charset="utf-8"
   Content-Length: 258
        
   <?xml version="1.0"?>
   <query-schema-discovery xmlns="DAV:">
     <basicsearch>
       <from>
         <scope>
           <href>http://recipes.example</href>
           <depth>infinity</depth>
         </scope>
       </from>
     </basicsearch>
   </query-schema-discovery>
        
   <?xml version="1.0"?>
   <query-schema-discovery xmlns="DAV:">
     <basicsearch>
       <from>
         <scope>
           <href>http://recipes.example</href>
           <depth>infinity</depth>
         </scope>
       </from>
     </basicsearch>
   </query-schema-discovery>
        

>> Response:

>>答复:

   HTTP/1.1 207 Multistatus
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxx
        
   HTTP/1.1 207 Multistatus
   Content-Type: application/xml; charset="utf-8"
   Content-Length: xxx
        
   <?xml version="1.0"?>
   <multistatus xmlns="DAV:">
     <response>
       <href>http://recipes.example</href>
       <status>HTTP/1.1 200 OK</status>
       <query-schema>
         <basicsearchschema>
           <!-- (See Section 5.19 for
           the actual contents) -->
         </basicsearchschema>
       </query-schema>
     </response>
   </multistatus>
        
   <?xml version="1.0"?>
   <multistatus xmlns="DAV:">
     <response>
       <href>http://recipes.example</href>
       <status>HTTP/1.1 200 OK</status>
       <query-schema>
         <basicsearchschema>
           <!-- (See Section 5.19 for
           the actual contents) -->
         </basicsearchschema>
       </query-schema>
     </response>
   </multistatus>
        

The query schema for DAV:basicsearch is defined in Section 5.19.

DAV:basicsearch的查询模式在第5.19节中定义。

5. The DAV:basicsearch Grammar
5. DAV:基本研究语法
5.1. Introduction
5.1. 介绍

DAV:basicsearch uses an extensible XML syntax that allows clients to express search requests that are generally useful for WebDAV scenarios. DASL-extended servers MUST accept this grammar, and MAY accept other grammars.

DAV:basicsearch使用可扩展的XML语法,允许客户端表达搜索请求,这些请求通常对WebDAV场景有用。DASL扩展服务器必须接受此语法,并且可以接受其他语法。

DAV:basicsearch has several components:

DAV:basicsearch有几个组件:

o DAV:select provides the result record definition.

o DAV:select提供结果记录定义。

o DAV:from defines the scope.

o DAV:from定义范围。

o DAV:where defines the criteria.

o DAV:其中定义了标准。

o DAV:orderby defines the sort order of the result set.

o DAV:orderby定义结果集的排序顺序。

o DAV:limit provides constraints on the query as a whole.

o DAV:limit提供了对整个查询的约束。

5.2. The DAV:basicsearch DTD
5.2. DAV:基本研究DTD
   <!-- "basicsearch" element -->
        
   <!-- "basicsearch" element -->
        
   <!ELEMENT basicsearch   (select, from, where?, orderby?, limit?) >
        
   <!ELEMENT basicsearch   (select, from, where?, orderby?, limit?) >
        
   <!-- "select" element -->
        
   <!-- "select" element -->
        
   <!ELEMENT select        (allprop | prop) >
        
   <!ELEMENT select        (allprop | prop) >
        
   <!-- "from" element -->
        
   <!-- "from" element -->
        
   <!ELEMENT from          (scope+) >
   <!ELEMENT scope         (href, depth, include-versions?) >
   <!ELEMENT include-versions EMPTY >
        
   <!ELEMENT from          (scope+) >
   <!ELEMENT scope         (href, depth, include-versions?) >
   <!ELEMENT include-versions EMPTY >
        
   <!-- "where" element -->
        
   <!-- "where" element -->
        
   <!ENTITY % comp_ops     "eq | lt | gt| lte | gte">
   <!ENTITY % log_ops      "and | or | not">
   <!ENTITY % special_ops  "is-collection | is-defined |
                            language-defined | language-matches">
   <!ENTITY % string_ops   "like">
   <!ENTITY % content_ops  "contains">
        
   <!ENTITY % comp_ops     "eq | lt | gt| lte | gte">
   <!ENTITY % log_ops      "and | or | not">
   <!ENTITY % special_ops  "is-collection | is-defined |
                            language-defined | language-matches">
   <!ENTITY % string_ops   "like">
   <!ENTITY % content_ops  "contains">
        
   <!ENTITY % all_ops      "%comp_ops; | %log_ops; | %special_ops; |
                            %string_ops; | %content_ops;">
        
   <!ENTITY % all_ops      "%comp_ops; | %log_ops; | %special_ops; |
                            %string_ops; | %content_ops;">
        
   <!ELEMENT where         ( %all_ops; ) >
        
   <!ELEMENT where         ( %all_ops; ) >
        
   <!ELEMENT and           ( %all_ops; )+ >
        
   <!ELEMENT and           ( %all_ops; )+ >
        
   <!ELEMENT or            ( %all_ops; )+ >
        
   <!ELEMENT or            ( %all_ops; )+ >
        
   <!ELEMENT not           ( %all_ops; ) >
        
   <!ELEMENT not           ( %all_ops; ) >
        
   <!ELEMENT lt            (prop, (literal|typed-literal)) >
   <!ATTLIST lt            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT lt            (prop, (literal|typed-literal)) >
   <!ATTLIST lt            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT lte           (prop, (literal|typed-literal)) >
   <!ATTLIST lte           caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT lte           (prop, (literal|typed-literal)) >
   <!ATTLIST lte           caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT gt            (prop, (literal|typed-literal)) >
   <!ATTLIST gt            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT gt            (prop, (literal|typed-literal)) >
   <!ATTLIST gt            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT gte           (prop, (literal|typed-literal)) >
   <!ATTLIST gte           caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT gte           (prop, (literal|typed-literal)) >
   <!ATTLIST gte           caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT eq            (prop, (literal|typed-literal)) >
   <!ATTLIST eq            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT eq            (prop, (literal|typed-literal)) >
   <!ATTLIST eq            caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT literal       (#PCDATA)>
   <!ELEMENT typed-literal (#PCDATA)>
   <!ATTLIST typed-literal xsi:type CDATA #IMPLIED>
        
   <!ELEMENT literal       (#PCDATA)>
   <!ELEMENT typed-literal (#PCDATA)>
   <!ATTLIST typed-literal xsi:type CDATA #IMPLIED>
        
   <!ELEMENT is-collection EMPTY >
   <!ELEMENT is-defined    (prop) >
        
   <!ELEMENT is-collection EMPTY >
   <!ELEMENT is-defined    (prop) >
        
   <!ELEMENT language-defined    (prop) >
   <!ELEMENT language-matches    (prop, literal) >
        
   <!ELEMENT language-defined    (prop) >
   <!ELEMENT language-matches    (prop, literal) >
        
   <!ELEMENT like          (prop, literal) >
   <!ATTLIST like          caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT like          (prop, literal) >
   <!ATTLIST like          caseless   (yes|no) #IMPLIED>
        
   <!ELEMENT contains      (#PCDATA)>
        
   <!ELEMENT contains      (#PCDATA)>
        
   <!-- "orderby" element -->
        
   <!-- "orderby" element -->
        
   <!ELEMENT orderby       (order+) >
   <!ELEMENT order         ((prop | score), (ascending | descending)?)>
   <!ATTLIST order         caseless   (yes|no) #IMPLIED>
   <!ELEMENT ascending     EMPTY>
   <!ELEMENT descending    EMPTY>
        
   <!ELEMENT orderby       (order+) >
   <!ELEMENT order         ((prop | score), (ascending | descending)?)>
   <!ATTLIST order         caseless   (yes|no) #IMPLIED>
   <!ELEMENT ascending     EMPTY>
   <!ELEMENT descending    EMPTY>
        
   <!-- "limit" element -->
        
   <!-- "limit" element -->
        
   <!ELEMENT limit         (nresults) >
   <!ELEMENT nresults      (#PCDATA) >
        
   <!ELEMENT limit         (nresults) >
   <!ELEMENT nresults      (#PCDATA) >
        
5.2.1. Example Query
5.2.1. 示例查询

This query retrieves the content length values for all resources located under the server's "/container1/" URI namespace whose length exceeds 10000 sorted ascending by size.

此查询检索位于服务器“/container1/”URI命名空间下的所有资源的内容长度值,该命名空间的长度超过10000,按大小升序排序。

   <d:searchrequest xmlns:d="DAV:">
     <d:basicsearch>
       <d:select>
         <d:prop><d:getcontentlength/></d:prop>
       </d:select>
       <d:from>
         <d:scope>
           <d:href>/container1/</d:href>
           <d:depth>infinity</d:depth>
         </d:scope>
       </d:from>
       <d:where>
         <d:gt>
           <d:prop><d:getcontentlength/></d:prop>
           <d:literal>10000</d:literal>
         </d:gt>
       </d:where>
       <d:orderby>
         <d:order>
           <d:prop><d:getcontentlength/></d:prop>
           <d:ascending/>
         </d:order>
       </d:orderby>
     </d:basicsearch>
   </d:searchrequest>
        
   <d:searchrequest xmlns:d="DAV:">
     <d:basicsearch>
       <d:select>
         <d:prop><d:getcontentlength/></d:prop>
       </d:select>
       <d:from>
         <d:scope>
           <d:href>/container1/</d:href>
           <d:depth>infinity</d:depth>
         </d:scope>
       </d:from>
       <d:where>
         <d:gt>
           <d:prop><d:getcontentlength/></d:prop>
           <d:literal>10000</d:literal>
         </d:gt>
       </d:where>
       <d:orderby>
         <d:order>
           <d:prop><d:getcontentlength/></d:prop>
           <d:ascending/>
         </d:order>
       </d:orderby>
     </d:basicsearch>
   </d:searchrequest>
        
5.3. DAV:select
5.3. DAV:选择

DAV:select defines the result record, which is a set of properties and values. This document defines two possible values: DAV:allprop and DAV:prop, both defined in Section 14 of [RFC4918].

DAV:select定义结果记录,它是一组属性和值。本文件定义了两个可能的值:DAV:allprop和DAV:prop,两者均在[RFC4918]第14节中定义。

5.4. DAV:from
5.4. 大卫:从
   <!ELEMENT scope            (href, depth, include-versions?) >
   <!ELEMENT include-versions EMPTY >
        
   <!ELEMENT scope            (href, depth, include-versions?) >
   <!ELEMENT include-versions EMPTY >
        

DAV:from defines the query scope. This contains one or more DAV: scope elements. Support for multiple scope elements is optional, however servers MUST fail a request specifying multiple DAV:scope elements if they can't support it (see Section 2.2.2, precondition DAV:search-multiple-scope-supported). The scope element contains mandatory DAV:href and DAV:depth elements.

DAV:from定义查询范围。它包含一个或多个DAV:scope元素。支持多个作用域元素是可选的,但是如果服务器无法支持指定多个DAV:scope元素的请求,则服务器必须失败(请参阅第2.2.2节,前提条件DAV:search multiple scope supported)。scope元素包含必需的DAV:href和DAV:depth元素。

DAV:href indicates the URI reference ([RFC3986], Section 4.1) to use as a scope.

DAV:href表示要用作作用域的URI引用([RFC3986],第4.1节)。

When the scope is a collection, if DAV:depth is "0", the search includes only the collection. When it is "1", the search includes the collection and its immediate children. When it is "infinity", it includes the collection and all its progeny.

当作用域为集合时,如果DAV:depth为“0”,则搜索仅包括集合。当它为“1”时,搜索包括集合及其直接子项。当它是“无限”时,它包括集合及其所有后代。

When the scope is not a collection, the depth is ignored and the search applies just to the resource itself.

当范围不是集合时,深度将被忽略,搜索仅应用于资源本身。

If the server supports WebDAV Redirect Reference Resources ([RFC4437]) and the search scope contains a redirect reference resource, then it applies only to that resource, not to its target.

如果服务器支持WebDAV重定向引用资源([RFC4437]),并且搜索范围包含重定向引用资源,则它仅适用于该资源,而不适用于其目标。

When the child element DAV:include-versions is present, the search scope will include all versions (see [RFC3253], Section 2.2.1) of all version-controlled resources in scope. Servers that do support versioning but do not support the DAV:include-versions feature MUST signal an error if it is used in a query (see Section 2.2.2, precondition DAV:search-scope-valid).

当存在子元素DAV:include versions时,搜索范围将包括范围内所有版本受控资源的所有版本(请参见[RFC3253],第2.2.1节)。支持版本控制但不支持DAV:include versions功能的服务器如果在查询中使用,则必须发出错误信号(请参阅第2.2.2节,前提条件DAV:search scope valid)。

5.4.1. Relationship to the Request-URI
5.4.1. 与请求URI的关系

If the DAV:scope element is a URI ([RFC3986], Section 3), the scope is exactly that URI.

如果DAV:scope元素是一个URI([RFC3986],第3节),那么作用域就是这个URI。

If the DAV:scope element is a relative reference ([RFC3986], Section 4.2), the scope is taken to be relative to the Request-URI.

如果DAV:scope元素是一个相对引用([RFC3986],第4.2节),则该范围被视为相对于请求URI。

5.4.2. Scope
5.4.2. 范围

A Scope can be an arbitrary URI reference.

作用域可以是任意URI引用。

Servers, of course, may support only particular scopes. This may include limitations for particular schemes such as "http:" or "ftp:" or certain URI namespaces. However, WebDAV-compliant search arbiters minimally SHOULD support scopes that match their own URI.

当然,服务器可能只支持特定的作用域。这可能包括对特定方案的限制,例如“http:”或“ftp:”或某些URI名称空间。但是,符合WebDAV的搜索仲裁器至少应该支持与其自己的URI匹配的作用域。

5.5. DAV:where
5.5. 大卫:在哪里

The DAV:where element defines the search condition for inclusion of resources in the result set. The value of this element is an XML element that defines a search operator that evaluates to one of the Boolean truth values TRUE, FALSE, or UNKNOWN. The search operator contained by DAV:where may itself contain and evaluate additional search operators as operands, which in turn may contain and evaluate additional search operators as operands, etc., recursively.

DAV:where元素定义了在结果集中包含资源的搜索条件。此元素的值是一个XML元素,它定义了一个搜索运算符,该运算符的计算结果为布尔真值TRUE、FALSE或UNKNOWN之一。DAV包含的搜索运算符:其中本身可能包含并计算作为操作数的其他搜索运算符,而操作数又可能递归地包含并计算作为操作数的其他搜索运算符等。

5.5.1. Use of Three-Valued Logic in Queries
5.5.1. 三值逻辑在查询中的使用

Each operator defined for use in the where clause that returns a Boolean value MUST evaluate to TRUE, FALSE, or UNKNOWN. The resource under scan is included as a member of the result set if and only if the search condition evaluates to TRUE.

在where子句中定义用于返回布尔值的每个运算符的计算结果必须为TRUE、FALSE或UNKNOWN。当且仅当搜索条件的计算结果为TRUE时,扫描下的资源才会作为结果集的成员包含。

Consult Appendix A for details on the application of three-valued logic in query expressions.

有关在查询表达式中应用三值逻辑的详细信息,请参阅附录A。

5.5.2. Handling Optional Operators
5.5.2. 处理可选运算符

If a query contains an operator that is not supported by the server, then the server MUST respond with a 422 (Unprocessable Entity) status code.

如果查询包含服务器不支持的运算符,则服务器必须使用422(不可处理实体)状态代码进行响应。

5.5.3. Treatment of NULL Values
5.5.3. 空值的处理

If a PROPFIND for a property value would yield a non-2xx (see Section 10.2 of [RFC2616]) response for that property, then that property is considered NULL.

如果属性值的PROPFIND将产生该属性的非2xx(见[RFC2616]第10.2节)响应,则该属性被视为空。

NULL values are "less than" all other values in comparisons.

空值在比较中“小于”所有其他值。

Empty strings (zero length strings) are not NULL values. An empty string is "less than" a string with length greater than zero.

空字符串(零长度字符串)不是空值。空字符串是“小于”长度大于零的字符串。

The DAV:is-defined operator is defined to test if the value of a property is not NULL.

定义DAV:is运算符是为了测试属性的值是否不为NULL。

5.5.4. Treatment of Properties with Mixed/Element Content
5.5.4. 混合/元素含量特性的处理

Comparisons of properties that do not have simple types (text-only content) is out of scope for the standard operators defined for DAV: basicsearch and therefore is defined to be UNKNOWN (as per Appendix A). For querying the DAV:resourcetype property, see Section 5.13.

对于为DAV:basicsearch定义的标准运算符,没有简单类型(纯文本内容)的属性的比较超出范围,因此定义为未知(根据附录A)。有关DAV:resourcetype属性的查询,请参见第5.13节。

5.5.5. Example: Testing for Equality
5.5.5. 示例:平等性测试

The example shows a single operator (DAV:eq) applied in the criteria.

该示例显示了标准中应用的单个运算符(DAV:eq)。

   <d:where xmlns:d='DAV:'>
     <d:eq>
       <d:prop>
         <d:getcontentlength/>
       </d:prop>
       <d:literal>100</d:literal>
     </d:eq>
   </d:where>
        
   <d:where xmlns:d='DAV:'>
     <d:eq>
       <d:prop>
         <d:getcontentlength/>
       </d:prop>
       <d:literal>100</d:literal>
     </d:eq>
   </d:where>
        
5.5.6. Example: Relative Comparisons
5.5.6. 示例:相对比较

The example shows a more complex operation involving several operators (DAV:and, DAV:eq, DAV:gt) applied in the criteria. This DAV:where expression matches those resources of type "image/gif" over 4K in size.

该示例显示了一个更复杂的操作,涉及应用于条件中的多个运算符(DAV:and、DAV:eq、DAV:gt)。此DAV:where表达式匹配大小超过4K的“image/gif”类型的资源。

   <D:where xmlns:D='DAV:'>
     <D:and>
       <D:eq>
         <D:prop>
           <D:getcontenttype/>
         </D:prop>
         <D:literal>image/gif</D:literal>
       </D:eq>
       <D:gt>
         <D:prop>
           <D:getcontentlength/>
         </D:prop>
         <D:literal>4096</D:literal>
       </D:gt>
     </D:and>
   </D:where>
        
   <D:where xmlns:D='DAV:'>
     <D:and>
       <D:eq>
         <D:prop>
           <D:getcontenttype/>
         </D:prop>
         <D:literal>image/gif</D:literal>
       </D:eq>
       <D:gt>
         <D:prop>
           <D:getcontentlength/>
         </D:prop>
         <D:literal>4096</D:literal>
       </D:gt>
     </D:and>
   </D:where>
        
5.6. DAV:orderby
5.6. 大卫:订货人

The DAV:orderby element specifies the ordering of the result set. It contains one or more DAV:order elements, each of which specifies a comparison between two items in the result set. Informally, a comparison specifies a test that determines whether one resource appears before another in the result set. Comparisons are applied in the order they occur in the DAV:orderby element, earlier comparisons being more significant.

orderby元素指定结果集的顺序。它包含一个或多个DAV:order元素,每个元素指定结果集中两个项目之间的比较。非正式地说,比较指定了一个测试,确定一个资源是否在结果集中出现在另一个资源之前。比较是按照它们在DAV:orderby元素中出现的顺序应用的,较早的比较更重要。

The comparisons defined here use only a single property from each resource, compared using the same ordering as the DAV:lt operator (ascending) or DAV:gt operator (descending). If neither direction is specified, the default is DAV:ascending.

此处定义的比较仅使用每个资源中的单个属性,使用与DAV:lt运算符(升序)或DAV:gt运算符(降序)相同的顺序进行比较。如果两个方向都未指定,则默认为DAV:升序。

In the context of the DAV:orderby element, null values are considered to collate before any actual (i.e., non-null) value, including strings of zero length (this is compatible with [SQL99]).

在DAV:orderby元素的上下文中,空值被认为是在任何实际(即非空)值之前进行排序的,包括长度为零的字符串(这与[SQL99]兼容)。

The "caseless" attribute may be used to indicate case-sensitivity for comparisons (Section 5.18).

“无案例”属性可用于表示比较的案例敏感性(第5.18节)。

5.6.1. Example of Sorting
5.6.1. 排序示例

This sort orders first by last name of the author and then by size, in descending order, so that for each author, the largest works appear first.

这种排序先按作者的姓氏排序,然后按大小降序排列,这样每个作者的最大作品都会首先出现。

   <d:orderby xmlns:d='DAV:' xmlns:r='http://example.com/ns'>
     <d:order>
       <d:prop><r:lastname/></d:prop>
       <d:ascending/>
     </d:order>
     <d:order>
       <d:prop><d:getcontentlength/></d:prop>
       <d:descending/>
     </d:order>
   </d:orderby>
        
   <d:orderby xmlns:d='DAV:' xmlns:r='http://example.com/ns'>
     <d:order>
       <d:prop><r:lastname/></d:prop>
       <d:ascending/>
     </d:order>
     <d:order>
       <d:prop><d:getcontentlength/></d:prop>
       <d:descending/>
     </d:order>
   </d:orderby>
        
5.7. Boolean Operators: DAV:and, DAV:or, and DAV:not
5.7. 布尔运算符:DAV:and、DAV:or和DAV:not

The DAV:and operator performs a logical AND operation on the expressions it contains.

and运算符对其包含的表达式执行逻辑and运算。

The DAV:or operator performs a logical OR operation on the values it contains.

DAV:or运算符对其包含的值执行逻辑或运算。

The DAV:not operator performs a logical NOT operation on the values it contains.

DAV:not运算符对其包含的值执行逻辑not操作。

5.8. DAV:eq
5.8. DAV:eq

The DAV:eq operator provides simple equality matching on property values.

DAV:eq运算符提供属性值的简单相等匹配。

The "caseless" attribute may be used with this element (Section 5.18).

“无案例”属性可与此元素一起使用(第5.18节)。

5.9. DAV:lt, DAV:lte, DAV:gt, DAV:gte
5.9. DAV:lt,DAV:lte,DAV:gt,DAV:gte

The DAV:lt, DAV:lte, DAV:gt, and DAV:gte operators provide comparisons on property values, using less-than, less-than or equal, greater-than, and greater-than or equal, respectively. The "caseless" attribute may be used with these elements (Section 5.18).

DAV:lt、DAV:lte、DAV:gt和DAV:gte运算符分别使用小于、小于或等于、大于和大于或等于来提供属性值的比较。“无案例”属性可与这些元素一起使用(第5.18节)。

5.10. DAV:literal
5.10. DAV:文字

DAV:literal allows literal values to be placed in an expression.

DAV:literal允许在表达式中放置文字值。

White space in literal values is significant in comparisons. For consistency with [RFC4918], clients SHOULD NOT specify the attribute "xml:space" (Section 2.10 of [XML]) to override this behavior.

文字值中的空白在比较中很重要。为了与[RFC4918]保持一致,客户端不应指定属性“xml:space”([xml]第2.10节)来覆盖此行为。

In comparisons, the contents of DAV:literal SHOULD be treated as string, with the following exceptions:

在比较中,DAV:literal的内容应视为字符串,但以下情况除外:

o when operand for a comparison with a DAV:getcontentlength property, it SHOULD be treated as an unsigned integer value (the behavior for values not in this format is undefined),

o 当操作数与DAV:getcontentlength属性进行比较时,应将其视为无符号整数值(非此格式的值的行为未定义),

o when operand for a comparison with a DAV:creationdate or DAV: getlastmodified property, it SHOULD be treated as a date value in the ISO-8601 subset defined for the DAV:creationdate property (see Section 15.1 of [RFC4918]; the behavior of values not in this format is undefined),

o 当操作数与DAV:creationdate或DAV:getlastmodified属性进行比较时,应将其视为为为DAV:creationdate属性定义的ISO-8601子集中的日期值(请参见[RFC4918]第15.1节;未定义此格式的值的行为),

o when operand for a comparison with a property for which the type is known and when compatible with that type, it MAY be treated according to this type.

o 当用于与已知类型的属性进行比较的操作数与该类型兼容时,可以根据此类型对其进行处理。

5.11. DAV:typed-literal (Optional)
5.11. DAV:类型化文字(可选)

There are situations in which a client may want to force a comparison not to be string-based (as defined for DAV:literal). In these cases, a typed comparison can be enforced by using DAV:typed-literal instead.

在某些情况下,客户机可能希望强制比较不基于字符串(定义为DAV:literal)。在这些情况下,可以使用DAV:typed literal来强制执行类型化比较。

   <!ELEMENT typed-literal (#PCDATA)>
        
   <!ELEMENT typed-literal (#PCDATA)>
        

The data type is specified using the xsi:type attribute defined in Section 2.6.1 of [XS1]. If the type is not specified, it defaults to "xs:string".

使用[XS1]第2.6.1节中定义的xsi:type属性指定数据类型。如果未指定类型,则默认为“xs:string”。

A server MUST reject a request using an unknown type with a status of 422 (Unprocessable Entity). It SHOULD reject a request if the value provided in DAV:typed-literal cannot be cast to the specified type.

服务器必须拒绝使用状态为422(不可处理实体)的未知类型的请求。如果无法将DAV:typed literal中提供的值转换为指定的类型,则应拒绝请求。

The comparison evaluates to UNKNOWN if the property value cannot be cast to the specified datatype (see [XPATHFUNC], Section 17).

如果无法将属性值强制转换为指定的数据类型,则比较结果为未知(请参阅[XPATHFUNC],第17节)。

5.11.1. Example for Typed Numerical Comparison
5.11.1. 类型化数值比较示例

Consider a set of resources with the dead property "edits" in the namespace "http://ns.example.org":

考虑在命名空间中具有死区属性“编辑”的一组资源http://ns.example.org":

                         +-----+----------------+
                         | URI | property value |
                         +-----+----------------+
                         | /a  | "-1"           |
                         | /b  | "01"           |
                         | /c  | "3"            |
                         | /d  | "test"         |
                         | /e  | (undefined)    |
                         +-----+----------------+
        
                         +-----+----------------+
                         | URI | property value |
                         +-----+----------------+
                         | /a  | "-1"           |
                         | /b  | "01"           |
                         | /c  | "3"            |
                         | /d  | "test"         |
                         | /e  | (undefined)    |
                         +-----+----------------+
        

The expression

表情

   <lt xmlns="DAV:"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <prop><edits xmlns="http://ns.example.org"/></prop>
     <typed-literal xsi:type="xs:integer">3</typed-literal>
   </lt>
        
   <lt xmlns="DAV:"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <prop><edits xmlns="http://ns.example.org"/></prop>
     <typed-literal xsi:type="xs:integer">3</typed-literal>
   </lt>
        

will evaluate to TRUE for the resources "/a" and "/b" (their property values can be parsed as type xs:integer, and the numerical comparison evaluates to true), to FALSE for "/c" (property value is compatible, but numerical comparison evaluates to false), and UNKNOWN for "/d"

对于资源“/a”和“/b”(它们的属性值可以解析为xs:integer类型,数值比较结果为TRUE),对于“/c”将计算为FALSE(属性值兼容,但数值比较结果为FALSE),对于“/d”将计算为未知

and "/e" (the property either is undefined, or its value cannot be parsed as xs:integer).

和“/e”(属性未定义,或其值无法解析为xs:integer)。

5.12. Support for Matching xml:lang Attributes on Properties
5.12. 支持在属性上匹配xml:lang属性

The following two optional operators can be used to express conditions on the language of a property value (as expressed using the xml:lang attribute).

以下两个可选运算符可用于表示属性值语言的条件(使用xml:lang属性表示)。

5.12.1. DAV:language-defined (Optional)
5.12.1. DAV:语言定义(可选)
   <!ELEMENT language-defined (prop)>
        
   <!ELEMENT language-defined (prop)>
        

This operator evaluates to TRUE if the language for the value of the given property is known, FALSE if it isn't, and UNKNOWN if the property itself is not defined.

如果给定属性值的语言已知,则该运算符的计算结果为TRUE;如果不知道,则为FALSE;如果未定义属性本身,则该运算符的计算结果为UNKNOWN。

5.12.2. DAV:language-matches (Optional)
5.12.2. DAV:语言匹配(可选)
   <!ELEMENT language-matches (prop, literal)>
        
   <!ELEMENT language-matches (prop, literal)>
        

This operator evaluates to TRUE if the language for the value of the given property is known and matches the language name given in the <literal> element, FALSE if it doesn't match, and UNKNOWN if the property itself is not defined.

如果给定属性值的语言已知且与<literal>元素中给定的语言名称匹配,则此运算符的计算结果为TRUE;如果不匹配,则为FALSE;如果未定义属性本身,则此运算符的计算结果为UNKNOWN。

Languages are considered to match if they are the same, or if the language of the property value is a sublanguage of the language specified in the <literal> element (see Section 4.3 of [XPATH], "lang function").

如果语言相同,或者属性值的语言是<literal>元素中指定的语言的子语言(请参见[XPATH],“lang函数”的第4.3节),则认为语言匹配。

5.12.3. Example of Language-Aware Matching
5.12.3. 语言感知匹配示例

The expression below will evaluate to TRUE if the property "foobar" exists and its language is either unknown, English, or a sublanguage of English.

如果属性“foobar”存在且其语言为未知语言、英语或英语的子语言,则下面的表达式将计算为TRUE。

   <or xmlns="DAV:">
     <not>
       <language-defined>
         <prop><foobar/></prop>
       </language-defined>
     </not>
     <language-matches>
       <prop><foobar/></prop>
       <literal>en</literal>
     </language-matches>
   </or>
        
   <or xmlns="DAV:">
     <not>
       <language-defined>
         <prop><foobar/></prop>
       </language-defined>
     </not>
     <language-matches>
       <prop><foobar/></prop>
       <literal>en</literal>
     </language-matches>
   </or>
        
5.13. DAV:is-collection
5.13. 大卫:这是收藏吗

The DAV:is-collection operator allows clients to determine whether a resource is a collection (that is, whether its DAV:resourcetype element contains the element DAV:collection).

DAV:is collection操作符允许客户端确定资源是否为集合(即,其DAV:resourcetype元素是否包含元素DAV:collection)。

Rationale: This operator is provided in lieu of defining generic structure queries, which would suffice for this and for many more powerful queries, but seems inappropriate to standardize at this time.

理由:提供此运算符以代替定义通用结构查询,这将足以满足此查询和许多更强大的查询,但目前似乎不适合标准化。

5.13.1. Example of DAV:is-collection
5.13.1. DAV示例:is集合

This example shows a search criterion that picks out all, and only, the resources in the scope that are collections.

此示例显示了一个搜索条件,该搜索条件会挑出范围中属于集合的所有资源,并且只挑出这些资源。

   <where xmlns="DAV:">
     <is-collection/>
   </where>
        
   <where xmlns="DAV:">
     <is-collection/>
   </where>
        
5.14. DAV:is-defined
5.14. DAV:定义为

The DAV:is-defined operator allows clients to determine whether a property is defined on a resource. The meaning of "defined on a resource" is found in Section 5.5.3.

DAV:is defined运算符允许客户端确定是否在资源上定义了属性。“资源定义”的含义见第5.5.3节。

Example:

例子:

   <d:is-defined xmlns:d='DAV:' xmlns:x='http://example.com/ns'>
     <d:prop><x:someprop/></d:prop>
   </d:is-defined>
        
   <d:is-defined xmlns:d='DAV:' xmlns:x='http://example.com/ns'>
     <d:prop><x:someprop/></d:prop>
   </d:is-defined>
        
5.15. DAV:like
5.15. 大卫:就像

The DAV:like is an optional operator intended to give simple wildcard-based pattern matching ability to clients.

like是一个可选操作符,旨在为客户端提供简单的基于通配符的模式匹配功能。

The operator takes two arguments.

运算符接受两个参数。

The first argument is a DAV:prop element identifying a single property to evaluate.

第一个参数是一个DAV:prop元素,用于标识要计算的单个属性。

The second argument is a DAV:literal element that gives the pattern matching string.

第二个参数是一个DAV:literal元素,它提供模式匹配字符串。

5.15.1. Syntax for the Literal Pattern
5.15.1. 文本模式的语法
   pattern       = [wildcard] 0*( text [wildcard] )
        
   pattern       = [wildcard] 0*( text [wildcard] )
        
   wildcard      = exactlyone / zeroormore
   text          = 1*( character / escapeseq )
        
   wildcard      = exactlyone / zeroormore
   text          = 1*( character / escapeseq )
        
   exactlyone    = "_"
   zeroormore    = "%"
   escapechar    = "\"
   escapeseq     = escapechar ( exactlyone / zeroormore / escapechar )
        
   exactlyone    = "_"
   zeroormore    = "%"
   escapechar    = "\"
   escapeseq     = escapechar ( exactlyone / zeroormore / escapechar )
        
   ; character: see [XML], Section 2.2, minus wildcard / escapechar
   character     = HTAB / LF / CR ; whitespace
   character     =/ %x20-24 / %x26-5B / %x5D-5E / %x60-D7FF
   character     =/ %xE000-FFFD / %x10000-10FFFF
        
   ; character: see [XML], Section 2.2, minus wildcard / escapechar
   character     = HTAB / LF / CR ; whitespace
   character     =/ %x20-24 / %x26-5B / %x5D-5E / %x60-D7FF
   character     =/ %xE000-FFFD / %x10000-10FFFF
        

(Note that the ABNF above is defined in terms of Unicode code points ([UNICODE5]); when a query is transmitted as an XML document over WebDAV, these characters are typically encoded in UTF-8 or UTF-16.)

(请注意,上面的ABNF是根据Unicode代码点([UNICODE5])定义的;当查询通过WebDAV作为XML文档传输时,这些字符通常以UTF-8或UTF-16编码。)

The value for the literal is composed of wildcards separated by segments of text. Wildcards may begin or end the literal.

文本的值由文本段分隔的通配符组成。通配符可以开始或结束文字。

The "_" wildcard matches exactly one character.

“u”通配符正好匹配一个字符。

The "%" wildcard matches zero or more characters.

“%”通配符与零个或多个字符匹配。

The "\" character is an escape sequence so that the literal can include "_" and "%". To include the "\" character in the pattern, the escape sequence "\\" is used.

“\”字符是转义序列,因此文字可以包括“\”和“%”。要在模式中包含“\”字符,使用转义序列“\”。

5.15.2. Example of DAV:like
5.15.2. DAV的例子:like

This example shows how a client might use DAV:like to identify those resources whose content type was a subtype of image.

此示例显示了客户端如何使用DAV:like来标识其内容类型为图像子类型的资源。

   <D:where xmlns:D='DAV:'>
     <D:like caseless="yes">
       <D:prop><D:getcontenttype/></D:prop>
       <D:literal>image/%</D:literal>
     </D:like>
   </D:where>
        
   <D:where xmlns:D='DAV:'>
     <D:like caseless="yes">
       <D:prop><D:getcontenttype/></D:prop>
       <D:literal>image/%</D:literal>
     </D:like>
   </D:where>
        
5.16. DAV:contains
5.16. DAV:包含

The DAV:contains operator is an optional operator that provides content-based search capability. This operator implicitly searches

DAV:contains操作符是提供基于内容的搜索功能的可选操作符。此运算符隐式搜索

against the text content of a resource, not against the content of properties. The DAV:contains operator is intentionally not overly constrained, in order to allow the server to do the best job it can in performing the search.

针对资源的文本内容,而不是针对属性的内容。DAV:contains操作符故意不受过度约束,以便允许服务器在执行搜索时尽可能地做好工作。

The DAV:contains operator evaluates to a Boolean value. It evaluates to TRUE if the content of the resource satisfies the search. Otherwise, it evaluates to FALSE.

DAV:contains运算符的计算结果为布尔值。如果资源的内容满足搜索,则其计算结果为TRUE。否则,其计算结果为FALSE。

Within the DAV:contains XML element, the client provides a phrase: a single word or whitespace delimited sequence of words. Servers MAY ignore punctuation in a phrase. Case-sensitivity is at the discretion of the server implementation.

在DAV:contains XML元素中,客户机提供了一个短语:单个单词或以空格分隔的单词序列。服务器可能会忽略短语中的标点符号。区分大小写取决于服务器实现。

The following non-exhaustive list enumerates things that may or may not be done as part of the search: Phonetic methods such as "soundex" may or may not be used. Word stemming may or may not be performed. Thesaurus expansion of words may or may not be done. Right or left truncation may or may not be performed. The search may be case insensitive or case sensitive. The word or words may or may not be interpreted as names. Multiple words may or may not be required to be adjacent or "near" each other. Multiple words may or may not be required to occur in the same order. Multiple words may or may not be treated as a phrase. The search may or may not be interpreted as a request to find documents "similar" to the string operand. Character canonicalization such as that done by the Unicode collation algorithm may or may not be applied.

以下非详尽列表列举了搜索过程中可能会或可能不会执行的操作:可能会或可能不会使用语音方法,如“soundex”。可以执行单词词干分析,也可以不执行。词库的词义扩展可以进行,也可以不进行。可以执行也可以不执行右截断或左截断。搜索可能不区分大小写或区分大小写。一个或多个单词可能被解释为名称,也可能不被解释为名称。多个单词可能需要也可能不需要彼此相邻或“接近”。多个单词可能需要也可能不需要以相同的顺序出现。多个单词可能被视为一个短语,也可能不被视为一个短语。搜索可能会也可能不会被解释为查找与字符串操作数“类似”的文档的请求。可以应用,也可以不应用Unicode排序算法完成的字符规范化。

5.16.1. Result Scoring (DAV:score Element)
5.16.1. 结果评分(DAV:评分要素)

Servers SHOULD indicate scores for the DAV:contains condition by adding a DAV:score XML element to the DAV:response element. Its value is defined only in the context of a particular query result. The value is a string representing the score, an integer from zero to 10000 inclusive, where a higher value indicates a higher score (e.g., more relevant).

服务器应该通过向DAV:response元素添加一个DAV:score XML元素来指示DAV:contains条件的分数。其值仅在特定查询结果的上下文中定义。该值是表示分数的字符串,是从零到10000(含)的整数,其中值越高表示分数越高(例如,相关性越高)。

Modified DTD fragment for DAV:propstat:

修改DAV:propstat的DTD片段:

   <!ELEMENT response (href, ((href*, status)|(propstat+)),
                       responsedescription?, score?) >
   <!ELEMENT score    (#PCDATA) >
        
   <!ELEMENT response (href, ((href*, status)|(propstat+)),
                       responsedescription?, score?) >
   <!ELEMENT score    (#PCDATA) >
        

Clients should note that, in general, it is not meaningful to compare the numeric values of scores from two different query results unless both were executed by the same underlying search system on the same collection of resources.

客户应该注意,一般来说,比较来自两个不同查询结果的分数的数值是没有意义的,除非这两个结果都是由相同的底层搜索系统在相同的资源集合上执行的。

5.16.2. Ordering by Score
5.16.2. 按分数排序

To order search results by their score, the DAV:score element may be added as child to the DAV:orderby element (in place of a DAV:prop element).

要按分数对搜索结果排序,可以将DAV:score元素作为子元素添加到DAV:orderby元素(代替DAV:prop元素)。

5.16.3. Examples
5.16.3. 例子

The example below shows a search for the phrase "Peter Forsberg".

下面的示例显示了对短语“Peter Forsberg”的搜索。

Depending on its support for content-based searching, a server MAY treat this as a search for documents that contain the words "Peter" and "Forsberg".

根据其对基于内容的搜索的支持,服务器可能会将此视为对包含单词“Peter”和“Forsberg”的文档的搜索。

   <D:where xmlns:D='DAV:'>
     <D:contains>Peter Forsberg</D:contains>
   </D:where>
        
   <D:where xmlns:D='DAV:'>
     <D:contains>Peter Forsberg</D:contains>
   </D:where>
        

The example below shows a search for resources that contain "Peter" and "Forsberg".

下面的示例显示了对包含“Peter”和“Forsberg”的资源的搜索。

   <D:where xmlns:D='DAV:'>
     <D:and>
       <D:contains>Peter</D:contains>
       <D:contains>Forsberg</D:contains>
     </D:and>
   </D:where>
        
   <D:where xmlns:D='DAV:'>
     <D:and>
       <D:contains>Peter</D:contains>
       <D:contains>Forsberg</D:contains>
     </D:and>
   </D:where>
        
5.17. Limiting the Result Set
5.17. 限制结果集
   <!ELEMENT limit (nresults) >
   <!ELEMENT nresults (#PCDATA)> <!-- only digits -->
        
   <!ELEMENT limit (nresults) >
   <!ELEMENT nresults (#PCDATA)> <!-- only digits -->
        

The DAV:limit XML element contains requested limits from the client to limit the size of the reply or amount of effort expended by the server. The DAV:nresults XML element contains a requested maximum number of DAV:response elements to be returned in the response body. The server MAY disregard this limit. The value of this element is an unsigned integer.

limitxml元素包含客户端请求的限制,以限制回复的大小或服务器花费的工作量。DAV:nresults XML元素包含请求的在响应体中返回的最大数量的DAV:response元素。服务器可以忽略此限制。此元素的值是无符号整数。

5.17.1. Relationship to Result Ordering
5.17.1. 与结果排序的关系

If the result set is both limited by DAV:limit and ordered according to DAV:orderby, the results that are included in the response document SHOULD be those that order highest.

如果结果集既受DAV:limit限制,又根据DAV:orderby排序,则响应文档中包含的结果应该是顺序最高的结果。

5.18. The 'caseless' XML Attribute
5.18. “无caseless”XML属性

The "caseless" attribute allows clients to specify caseless matching behavior instead of character-by-character matching for DAV: basicsearch operators.

“caseless”属性允许客户端为DAV:basicsearch运算符指定无caseless匹配行为,而不是逐字符匹配。

The possible values for "caseless" are "yes" or "no". The default value is server-specified. Caseless matching SHOULD be implemented as defined in Section 5.18 of the Unicode Standard ([UNICODE5]).

“无案例”的可能值为“是”或“否”。默认值是服务器指定的。应按照Unicode标准([UNICODE5])第5.18节中的定义实施无大小写匹配。

Support for the "caseless" attribute is optional. A server should respond with a status of 422 if it is used but cannot be supported.

支持“无案例”属性是可选的。如果服务器已使用但不受支持,则应以422状态响应。

5.19. Query Schema for DAV:basicsearch
5.19. DAV的查询模式:basicsearch

The DAV:basicsearch grammar defines a search criteria that is a Boolean-valued expression, and allows for an arbitrary set of properties to be included in the result record. The result set may be sorted on a set of property values. Accordingly, the DTD for schema discovery for this grammar allows the server to express:

DAV:basicsearch语法定义了一个作为布尔值表达式的搜索条件,并允许在结果记录中包含任意一组属性。结果集可以根据一组属性值进行排序。因此,此语法的模式发现DTD允许服务器表示:

1. the set of properties that may be either searched, returned, or used to sort, and a hint about the data type of such properties.

1. 可以搜索、返回或用于排序的属性集,以及关于此类属性的数据类型的提示。

2. the set of optional operators defined by the resource.

2. 由资源定义的可选运算符集。

5.19.1. DTD for DAV:basicsearch QSD
5.19.1. DAV的DTD:基本研究QSD
   <!ELEMENT basicsearchschema  (properties, operators)>
   <!ELEMENT any-other-property EMPTY>
   <!ELEMENT properties         (propdesc*)>
   <!ELEMENT propdesc           ((prop|any-other-property), datatype?,
                                 searchable?, selectable?, sortable?,
                                 caseless?)>
   <!ELEMENT operators          (opdesc*)>
   <!ELEMENT opdesc             ANY>
   <!ATTLIST opdesc             allow-pcdata (yes|no) #IMPLIED>
   <!ELEMENT operand-literal    EMPTY>
   <!ELEMENT operand-typed-literal EMPTY>
   <!ELEMENT operand-property   EMPTY>
        
   <!ELEMENT basicsearchschema  (properties, operators)>
   <!ELEMENT any-other-property EMPTY>
   <!ELEMENT properties         (propdesc*)>
   <!ELEMENT propdesc           ((prop|any-other-property), datatype?,
                                 searchable?, selectable?, sortable?,
                                 caseless?)>
   <!ELEMENT operators          (opdesc*)>
   <!ELEMENT opdesc             ANY>
   <!ATTLIST opdesc             allow-pcdata (yes|no) #IMPLIED>
   <!ELEMENT operand-literal    EMPTY>
   <!ELEMENT operand-typed-literal EMPTY>
   <!ELEMENT operand-property   EMPTY>
        

The DAV:properties element holds a list of descriptions of properties.

properties元素包含属性描述的列表。

The DAV:operators element describes the optional operators that may be used in a DAV:where element.

DAV:operators元素描述可在DAV:where元素中使用的可选运算符。

5.19.2. DAV:propdesc Element
5.19.2. DAV:propdesc元素

Each instance of a DAV:propdesc element describes the property or properties in the DAV:prop element it contains. All subsequent elements are descriptions that apply to those properties. All descriptions are optional and may appear in any order. Servers SHOULD support all the descriptions defined here, and MAY define others.

DAV:propdesc元素的每个实例都描述它所包含的DAV:prop元素中的一个或多个属性。所有后续元素都是应用于这些属性的描述。所有描述都是可选的,可以以任何顺序出现。服务器应该支持这里定义的所有描述,并且可以定义其他描述。

DASL defines five descriptions. The first, DAV:datatype, provides a hint about the type of the property value, and may be useful to a user interface prompting for a value. The remaining four (DAV: searchable, DAV:selectable, DAV:sortable, and DAV:caseless) identify portions of the query (DAV:where, DAV:select, and DAV:orderby, respectively). If a property has a description for a section, then the server MUST allow the property to be used in that section. These descriptions are optional. If a property does not have such a description, or is not described at all, then the server MAY still allow the property to be used in the corresponding section.

DASL定义了五种描述。第一个是DAV:datatype,它提供了关于属性值类型的提示,对于提示输入值的用户界面可能很有用。其余四个(DAV:searchable、DAV:selective、DAV:sortable和DAV:caseless)分别标识查询的各个部分(DAV:where、DAV:select和DAV:orderby)。如果属性具有节的描述,则服务器必须允许在该节中使用该属性。这些描述是可选的。如果属性没有这样的描述,或者根本没有描述,那么服务器仍然可以允许在相应的部分中使用该属性。

5.19.2.1. DAV:any-other-property
5.19.2.1. 戴夫:还有其他财产吗

This element can be used in place of DAV:prop to describe properties of WebDAV properties not mentioned in any other DAV:prop element. For instance, this can be used to indicate that all other properties are searchable and selectable without giving details about their types (a typical scenario for dead properties).

此元素可以代替DAV:prop来描述任何其他DAV:prop元素中未提及的WebDAV属性的属性。例如,这可以用来表示所有其他属性都是可搜索和可选择的,而不提供其类型的详细信息(这是死属性的典型情况)。

5.19.3. The DAV:datatype Property Description
5.19.3. DAV:数据类型属性描述

The DAV:datatype element contains a single XML element that provides a hint about the domain of the property, which may be useful to a user interface prompting for a value to be used in a query. Data types are identified by an element name. Where appropriate, a server SHOULD use the simple data types defined in [XS2].

DAV:datatype元素包含一个XML元素,该元素提供有关属性域的提示,这对于提示在查询中使用值的用户界面可能很有用。数据类型由元素名称标识。在适当的情况下,服务器应该使用[XS2]中定义的简单数据类型。

   <!ELEMENT datatype ANY >
        
   <!ELEMENT datatype ANY >
        

Examples from [XS2], Section 3:

[XS2]第3节中的示例:

                 +----------------+---------------------+
                 | Qualified name | Example             |
                 +----------------+---------------------+
                 | xs:boolean     | true, false, 1, 0   |
                 | xs:string      | Foobar              |
                 | xs:dateTime    | 1994-11-05T08:15:5Z |
                 | xs:float       | .314159265358979E+1 |
                 | xs:integer     | -259, 23            |
                 +----------------+---------------------+
        
                 +----------------+---------------------+
                 | Qualified name | Example             |
                 +----------------+---------------------+
                 | xs:boolean     | true, false, 1, 0   |
                 | xs:string      | Foobar              |
                 | xs:dateTime    | 1994-11-05T08:15:5Z |
                 | xs:float       | .314159265358979E+1 |
                 | xs:integer     | -259, 23            |
                 +----------------+---------------------+
        

If the data type of a property is not given, then the data type defaults to xs:string.

如果未指定属性的数据类型,则数据类型默认为xs:string。

5.19.4. The DAV:searchable Property Description
5.19.4. DAV:可搜索属性描述
   <!ELEMENT searchable EMPTY>
        
   <!ELEMENT searchable EMPTY>
        

If this element is present, then the server MUST allow this property to appear within a DAV:where element where an operator allows a property. Allowing a search does not mean that the property is guaranteed to be defined on every resource in the scope, it only indicates the server's willingness to check.

如果存在此元素,则服务器必须允许此属性出现在操作员允许属性的DAV:where元素中。允许搜索并不意味着保证在作用域中的每个资源上定义属性,它只表示服务器愿意进行检查。

5.19.5. The DAV:selectable Property Description
5.19.5. DAV:可选属性描述
   <!ELEMENT selectable EMPTY>
        
   <!ELEMENT selectable EMPTY>
        

This element indicates that the property may appear in the DAV:select element.

此元素表示属性可能出现在DAV:select元素中。

5.19.6. The DAV:sortable Property Description
5.19.6. DAV:可排序属性描述

This element indicates that the property may appear in the DAV: orderby element.

此元素表示属性可能出现在DAV:orderby元素中。

   <!ELEMENT sortable EMPTY>
        
   <!ELEMENT sortable EMPTY>
        
5.19.7. The DAV:caseless Property Description
5.19.7. DAV:无案例属性描述

This element only applies to properties whose data type is "xs: string" and derived data types as per the DAV:datatype property description. Its presence indicates that comparisons performed for searches, and the comparisons for ordering results on the string property will be caseless (the default is character by character).

此元素仅适用于数据类型为“xs:string”的属性,以及符合DAV:datatype属性描述的派生数据类型。它的存在表示对搜索执行的比较,以及对字符串属性上的排序结果进行的比较将是无大小写的(默认为逐字符)。

   <!ELEMENT caseless EMPTY>
        
   <!ELEMENT caseless EMPTY>
        
5.19.8. The DAV:operators XML Element
5.19.8. DAV:operators XML元素

The DAV:operators element describes every optional operator supported in a query. (Mandatory operators are not listed since they are mandatory and permit no variation in syntax.) All optional operators that are supported MUST be listed in the DAV:operators element.

DAV:operators元素描述查询中支持的每个可选运算符。(由于强制运算符是强制的且不允许语法变化,因此未列出强制运算符。)所有受支持的可选运算符必须在DAV:operators元素中列出。

The listing for an operator, contained in an DAV:opdesc element, consists of the operator (as an empty element), followed by one element for each operand. The operand MUST be either DAV:operand-property, DAV:operand-literal, or DAV:operand-typed-literal, which indicate that the operand in the corresponding position is a property, a literal value, or a typed literal value, respectively. If an operator is polymorphic (allows more than one operand syntax) then each permitted syntax MUST be listed separately.

包含在DAV:opdesc元素中的运算符列表由运算符(作为空元素)组成,每个操作数后跟一个元素。操作数必须是DAV:operand属性、DAV:operand literal或DAV:operand-typed literal,这分别表示对应位置的操作数是属性、文字值或类型化文字值。如果运算符是多态的(允许多个操作数语法),则必须单独列出每个允许的语法。

The DAV:opdesc element MAY have a "allow-pcdata" attribute (defaulting to "no"). A value of "yes" indicates that the operator can contain character data, as it is the case with DAV:contains (see Section 5.16). Definition of additional operators using this format is NOT RECOMMENDED.

DAV:opdesc元素可能有一个“allow pcdata”属性(默认为“no”)。值“是”表示运算符可以包含字符数据,与DAV:contains的情况相同(参见第5.16节)。不建议使用此格式定义其他运算符。

   <operators xmlns='DAV:'>
     <opdesc>
       <like/><operand-property/><operand-literal/>
     </opdesc>
   </operators>
        
   <operators xmlns='DAV:'>
     <opdesc>
       <like/><operand-property/><operand-literal/>
     </opdesc>
   </operators>
        
5.19.9. Example of Query Schema for DAV:basicsearch
5.19.9. DAV的查询模式示例:basicsearch
   <D:basicsearchschema xmlns:D="DAV:"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <D:properties>
       <D:propdesc>
         <D:prop><D:getcontentlength/></D:prop>
         <D:datatype><xs:nonNegativeInteger/></D:datatype>
         <D:searchable/><D:selectable/><D:sortable/>
       </D:propdesc>
       <D:propdesc>
         <D:prop><D:getcontenttype/><D:displayname/></D:prop>
         <D:searchable/><D:selectable/><D:sortable/>
       </D:propdesc>
       <D:propdesc>
         <D:prop><fstop xmlns="http://ns.example.org"/></D:prop>
         <D:selectable/>
       </D:propdesc>
       <D:propdesc>
         <D:any-other-property/>
         <D:searchable/><D:selectable/>
       </D:propdesc>
     </D:properties>
     <D:operators>
       <D:opdesc>
         <D:like/><D:operand-property/><D:operand-literal/>
       </D:opdesc>
       <D:opdesc allow-pcdata="yes">
         <D:contains/>
       </D:opdesc>
     </D:operators>
   </D:basicsearchschema>
        
   <D:basicsearchschema xmlns:D="DAV:"
     xmlns:xs="http://www.w3.org/2001/XMLSchema">
     <D:properties>
       <D:propdesc>
         <D:prop><D:getcontentlength/></D:prop>
         <D:datatype><xs:nonNegativeInteger/></D:datatype>
         <D:searchable/><D:selectable/><D:sortable/>
       </D:propdesc>
       <D:propdesc>
         <D:prop><D:getcontenttype/><D:displayname/></D:prop>
         <D:searchable/><D:selectable/><D:sortable/>
       </D:propdesc>
       <D:propdesc>
         <D:prop><fstop xmlns="http://ns.example.org"/></D:prop>
         <D:selectable/>
       </D:propdesc>
       <D:propdesc>
         <D:any-other-property/>
         <D:searchable/><D:selectable/>
       </D:propdesc>
     </D:properties>
     <D:operators>
       <D:opdesc>
         <D:like/><D:operand-property/><D:operand-literal/>
       </D:opdesc>
       <D:opdesc allow-pcdata="yes">
         <D:contains/>
       </D:opdesc>
     </D:operators>
   </D:basicsearchschema>
        

This response lists four properties. The data type of the last three properties is not given, so it defaults to xs:string. All are selectable, and the first three may be searched. All but the last may be used in a sort. Of the optional DAV operators, DAV:contains and DAV:like are supported.

此响应列出了四个属性。最后三个属性的数据类型没有给出,因此它默认为xs:string。所有都是可选的,可以搜索前三个。除了最后一个以外,所有的都可以在某种程度上使用。在可选的DAV运算符中,支持DAV:contains和DAV:like。

Note: The schema discovery defined here does not provide for discovery of supported values of the "caseless" attribute. This may require that the reply also list the mandatory operators.

注意:此处定义的模式发现不提供对“caseless”属性的支持值的发现。这可能要求回复中还列出强制运营商。

6. Internationalization Considerations
6. 国际化考虑

Properties may be language-tagged using the xml:lang attribute (see [RFC4918], Section 4.3). The optional operators DAV:language-defined (Section 5.12.1) and DAV:language-matches (Section 5.12.2) allow the expression of conditions on the language tagging information.

属性可以使用xml:lang属性进行语言标记(请参见[RFC4918],第4.3节)。可选运算符DAV:language defined(第5.12.1节)和DAV:language matches(第5.12.2节)允许在语言标记信息上表达条件。

7. Security Considerations
7. 安全考虑

This section is provided to detail issues concerning security implications of which DASL applications need to be aware. All of the security considerations of HTTP/1.1 ([RFC2616] and WebDAV ([RFC4918]) also apply to DASL. In addition, this section will include security risks inherent in the search and retrieval of resource properties and content.

本节详细介绍了DASL应用程序需要注意的安全性问题。HTTP/1.1([RFC2616]和WebDAV([RFC4918])的所有安全注意事项也适用于DASL。此外,本节将包括搜索和检索资源属性和内容时固有的安全风险。

A query MUST NOT allow clients to retrieve information that wouldn't have been available through the GET or PROPFIND methods in the first place. In particular:

查询不能允许客户端检索通过GET或PROPFIND方法首先不可用的信息。特别地:

o Query constraints on WebDAV properties for which the client does not have read access need to be evaluated as if the property did not exist (see Section 5.5.3).

o 客户端没有读取权限的WebDAV属性的查询约束需要像属性不存在一样进行评估(参见第5.5.3节)。

o Query constraints on content (as with DAV:contains, defined in Section 5.16) for which the client does not have read access need to be evaluated as if a GET would return a 4xx status code.

o 对于客户端没有读取权限的内容(如第5.16节中定义的DAV:contains),需要对其查询约束进行评估,就像GET将返回4xx状态代码一样。

A server should prepare for denial-of-service attacks. For example a client may issue a query for which the result set is expensive to calculate or transmit because many resources match or must be evaluated.

服务器应为拒绝服务攻击做好准备。例如,客户机可能会发出一个查询,其结果集的计算或传输成本很高,因为许多资源匹配或必须进行计算。

7.1. Implications of XML External Entities
7.1. XML外部实体的含义

XML supports a facility known as "external entities", defined in Section 4.2.2 of [XML], which instruct an XML processor to retrieve and perform an inline include of XML located at a particular URI. An external XML entity can be used to append or modify the document type declaration (DTD) associated with an XML document. An external XML entity can also be used to include XML within the content of an XML document. For non-validating XML, such as the XML used in this specification, including an external XML entity is not required by [XML]. However, [XML] does state that an XML processor may, at its discretion, include the external XML entity.

XML支持一种称为“外部实体”的功能,该功能在[XML]的第4.2.2节中定义,它指示XML处理器检索并执行位于特定URI的XML的内联包含。外部XML实体可用于附加或修改与XML文档关联的文档类型声明(DTD)。外部XML实体还可用于在XML文档的内容中包含XML。对于非验证性XML,例如本规范中使用的XML,[XML]不要求包含外部XML实体。但是,[XML]确实声明XML处理器可以自行决定是否包含外部XML实体。

External XML entities have no inherent trustworthiness and are subject to all the attacks that are endemic to any HTTP GET request.

外部XML实体没有固有的可信度,并且会受到任何HTTP GET请求特有的所有攻击。

Furthermore, it is possible for an external XML entity to modify the DTD, and hence affect the final form of an XML document, in the worst case significantly modifying its semantics, or exposing the XML processor to the security risks discussed in [RFC3023]. Therefore, implementers must be aware that external XML entities should be treated as untrustworthy.

此外,外部XML实体可能修改DTD,从而影响XML文档的最终形式,最坏的情况是显著修改其语义,或使XML处理器暴露于[RFC3023]中讨论的安全风险。因此,实现者必须意识到外部XML实体应该被视为不可信的。

There is also the scalability risk that would accompany a widely deployed application that made use of external XML entities. In this situation, it is possible that there would be significant numbers of requests for one external XML entity, potentially overloading any server that fields requests for the resource containing the external XML entity.

使用外部XML实体的广泛部署的应用程序还存在可伸缩性风险。在这种情况下,对于一个外部XML实体可能会有大量的请求,这可能会使任何对包含该外部XML实体的资源进行请求的服务器过载。

8. Scalability
8. 可伸缩性

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://").

查询语法由URI标识。应用程序不应尝试检索这些URI,即使它们看起来是可检索的(例如,以“http://”开头的URI)。

9. IANA Considerations
9. IANA考虑

This document uses the namespace defined in Section 21 of [RFC4918] for XML elements.

本文档使用[RFC4918]第21节中为XML元素定义的名称空间。

9.1. HTTP Headers
9.1. HTTP头处理模块

This document specifies the HTTP header listed below, which has been added to the permanent HTTP header registry defined in [RFC3864].

本文档指定了下面列出的HTTP标头,该标头已添加到[RFC3864]中定义的永久HTTP标头注册表中。

9.1.1. DASL
9.1.1. 达斯尔

Header field name: DASL

标题字段名称:DASL

Applicable protocol: http

适用协议:http

Status: standard

状态:标准

Author/Change controller: IETF

作者/变更控制员:IETF

Specification document: this specification (Section 3.2)

规范文件:本规范(第3.2节)

10. Contributors
10. 贡献者

This document is based on prior work on the DASL protocol done by the WebDAV DASL working group until the year 2000 -- namely by Alan Babich, Jim Davis, Rick Henderson, Dale Lowry, Saveen Reddy, Surendra Reddy, and Judith Slein (see <http://www.webdav.org/dasl/> for the working group's web site, <http://purl.org/NET/webdav/dasl-references/reqs> for a requirements document, and <http://purl.org/NET/webdav/dasl-references/dasl-protocol-00> for an early version of the specification).

本文件基于WebDAV DASL工作组在2000年之前就DASL协议所做的工作,即Alan Babich、Jim Davis、Rick Henderson、Dale Lowry、Saveen Reddy、Surendra Reddy和Judith Slein(见<http://www.webdav.org/dasl/>对于工作组的网站<http://purl.org/NET/webdav/dasl-references/reqs>对于需求文档,以及<http://purl.org/NET/webdav/dasl-references/dasl-protocol-00>对于规范的早期版本)。

11. Acknowledgements
11. 致谢

This document has benefited from thoughtful discussion by Lisa Dusseault, Javier Godoy, Sung Kim, Chris Newman, Elias Sinderson, Martin Wallmer, Keith Wannamaker, Jim Whitehead, and Kevin Wiggen.

本文件得益于Lisa Dusseault、Javier Godoy、Sung Kim、Chris Newman、Elias Sinderson、Martin Wallmer、Keith Wannamaker、Jim Whitehead和Kevin Wiggen的深思熟虑的讨论。

12. References
12. 工具书类
12.1. Normative References
12.1. 规范性引用文件

[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997.

[RFC2119]Bradner,S.,“RFC中用于表示需求水平的关键词”,BCP 14,RFC 2119,1997年3月。

[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.

[RFC2616]菲尔丁,R.,盖蒂斯,J.,莫卧儿,J.,弗莱斯蒂克,H.,马斯特,L.,利奇,P.,和T.伯纳斯李,“超文本传输协议——HTTP/1.1”,RFC 2616,1999年6月。

[RFC3023] Murata, M., St. Laurent, S., and D. Kohn, "XML Media Types", RFC 3023, January 2001.

[RFC3023]Murata,M.,St.Laurent,S.,和D.Kohn,“XML媒体类型”,RFC 3023,2001年1月。

[RFC3253] Clemm, G., Amsden, J., Ellison, T., Kaler, C., and J. Whitehead, "Versioning Extensions to WebDAV (Web Distributed Authoring and Versioning)", RFC 3253, March 2002.

[RFC3253]Clemm,G.,Amsden,J.,Ellison,T.,Kaler,C.,和J.Whitehead,“WebDAV的版本控制扩展(Web分布式创作和版本控制)”,RFC 3253,2002年3月。

[RFC3744] Clemm, G., Reschke, J., Sedlar, E., and J. Whitehead, "Web Distributed Authoring and Versioning (WebDAV) Access Control Protocol", RFC 3744, May 2004.

[RFC3744]Clemm,G.,Reschke,J.,Sedlar,E.,和J.Whitehead,“Web分布式创作和版本控制(WebDAV)访问控制协议”,RFC 3744,2004年5月。

[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, January 2005.

[RFC3986]Berners Lee,T.,Fielding,R.,和L.Masinter,“统一资源标识符(URI):通用语法”,STD 66,RFC 3986,2005年1月。

[RFC4918] Dusseault, L., Ed., "HTTP Extensions for Web Distributed Authoring and Versioning (WebDAV)", RFC 4918, June 2007.

[RFC4918]Dusseault,L.,Ed.“Web分布式创作和版本控制(WebDAV)的HTTP扩展”,RFC4918,2007年6月。

[RFC5234] Crocker, D., Ed. and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", STD 68, RFC 5234, January 2008.

[RFC5234]Crocker,D.,Ed.和P.Overell,“语法规范的扩充BNF:ABNF”,STD 68,RFC 5234,2008年1月。

[XML] Bray, T., Paoli, J., Sperberg-McQueen, C., Maler, E., and F. Yergeau, "Extensible Markup Language (XML) 1.0 (Fourth Edition)", W3C REC-xml-20060816, August 2006, <http://www.w3.org/TR/2006/REC-xml-20060816>.

[XML]Bray,T.,Paoli,J.,Sperberg McQueen,C.,Maler,E.,和F.Yergeau,“可扩展标记语言(XML)1.0(第四版)”,W3C REC-XML-20060816,2006年8月<http://www.w3.org/TR/2006/REC-xml-20060816>.

[XPATH] Clark, J. and S. DeRose, "XML Path Language (XPath) Version 1.0", W3C REC-xpath-19991116, November 1999, <http://www.w3.org/TR/1999/REC-xpath-19991116>.

[XPATH]Clark,J.和S.DeRose,“XML路径语言(XPATH)1.0版”,W3C REC-XPATH-19991116,1999年11月<http://www.w3.org/TR/1999/REC-xpath-19991116>.

[XPATHFUNC] Malhotra, A., Melton, J., and N. Walsh, "XQuery 1.0 and XPath 2.0 Functions and Operators", W3C REC-xpath-functions-20070123, January 2007, <http://www.w3.org/ TR/2007/REC-xpath-functions-20070123/>.

[XPATHFUNC]Malhotra,A.,Melton,J.,和N.Walsh,“XQuery 1.0和XPath 2.0函数和运算符”,W3C REC-XPath-Functions-20070123,2007年1月<http://www.w3.org/ TR/2007/REC-xpath-functions-20070123/>。

[XS1] Thompson, H., Beech, D., Maloney, M., Mendelsohn, N., and World Wide Web Consortium, "XML Schema Part 1: Structures", W3C REC-xmlschema-1-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>.

[XS1]Thompson,H.,Beech,D.,Maloney,M.,Mendelsohn,N.,和万维网联盟,“XML模式第1部分:结构”,W3C REC-xmlschema-1-20041028,2004年10月<http://www.w3.org/TR/2004/REC-xmlschema-1-20041028/>.

[XS2] Biron, P., Malhotra, A., and World Wide Web Consortium, "XML Schema Part 2: Datatypes Second Edition", W3C REC-xmlschema-2-20041028, October 2004, <http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.

[XS2]Biron,P.,Malhotra,A.,和万维网联盟,“XML模式第2部分:数据类型第二版”,W3C REC-xmlschema-2-20041028,2004年10月<http://www.w3.org/TR/2004/REC-xmlschema-2-20041028/>.

12.2. Informative References
12.2. 资料性引用

[BCP47] Phillips, A. and M. Davis, "Matching of Language Tags", BCP 47, RFC 4647, September 2006.

[BCP47]Phillips,A.和M.Davis,“语言标记的匹配”,BCP 47,RFC 4647,2006年9月。

[RFC3864] Klyne, G., Nottingham, M., and J. Mogul, "Registration Procedures for Message Header Fields", BCP 90, RFC 3864, September 2004.

[RFC3864]Klyne,G.,Nottingham,M.和J.Mogul,“消息头字段的注册程序”,BCP 90,RFC 3864,2004年9月。

[RFC4437] Whitehead, J., Clemm, G., and J. Reschke, Ed., "Web Distributed Authoring and Versioning (WebDAV) Redirect Reference Resources", RFC 4437, March 2006.

[RFC4437]Whitehead,J.,Clemm,G.,和J.Reschke,Ed.,“Web分布式创作和版本控制(WebDAV)重定向参考资源”,RFC 4437,2006年3月。

[RFC4790] Newman, C., Duerst, M., and A. Gulbrandsen, "Internet Application Protocol Collation Registry", RFC 4790, March 2007.

[RFC4790]Newman,C.,Duerst,M.,和A.Gulbrandsen,“互联网应用协议整理注册表”,RFC 47902007年3月。

[SQL99] Milton, J., "Database Language SQL Part 2: Foundation (SQL/Foundation)", ISO ISO/IEC 9075-2:1999 (E), July 1999.

[SQL99 ]密尔顿,J.,“数据库语言SQL部分2:基金会(SQL/Foundation)”,ISO ISO/IEC 9075-1999(E),1999年7月。

[UNICODE5] The Unicode Consortium, "The Unicode Standard - Version 5.0", Addison-Wesley , November 2006, <http://www.unicode.org/versions/Unicode5.0.0/>.

[Unicode 5]Unicode联盟,“Unicode标准-5.0版”,Addison Wesley,2006年11月<http://www.unicode.org/versions/Unicode5.0.0/>.

ISBN 0321480910 [1]

ISBN 0321480910[1]

[WEBDAV-BIND] Clemm, G., Crawford, J., Reschke, J., Ed., and J. Whitehead, "Binding Extensions to Web Distributed Authoring and Versioning (WebDAV)", October 2008.

[WEBDAV-BIND]Clemm,G.,Crawford,J.,Reschke,J.,Ed.,和J.Whitehead,“将扩展绑定到Web分布式创作和版本控制(WEBDAV)”,2008年10月。

URIs

URI

   [1]  <urn:isbn:0321480910>
        
   [1]  <urn:isbn:0321480910>
        

Appendix A. Three-Valued Logic in DAV:basicsearch

附录A.DAV中的三值逻辑:基础研究

ANSI standard three-valued logic is used when evaluating the search condition (as defined in the ANSI standard SQL specifications, for example, in ANSI X3.135-1992, Section 8.12, pp. 188-189, Section 8.2, p. 169, General Rule 1)a), etc.).

在评估搜索条件时使用ANSI标准三值逻辑(如ANSI标准SQL规范中的定义,例如ANSI X3.135-1992第8.12节,第188-189页,第8.2节,第169页,一般规则1)a)等)。

ANSI standard three-valued logic is undoubtedly the most widely practiced method of dealing with the issues of properties in the search condition not having a value (e.g., being null or not defined) for the resource under scan, and with undefined expressions in the search condition (e.g., division by zero, etc.). Three valued logic works as follows.

ANSI标准三值逻辑无疑是处理搜索条件下的属性问题的最广泛实践的方法,该搜索条件下的资源没有值(例如,为空或未定义),并且搜索条件中有未定义的表达式(例如,除零等)。三值逻辑的工作原理如下。

Undefined expressions are expressions for which the value of the expression is not defined. Undefined expressions are a completely separate concept from the truth value UNKNOWN, which is, in fact, well defined. Property names and literal constants are considered expressions for purposes of this section. If a property in the current resource under scan has not been set to a value, then the value of that property is undefined for the resource under scan. DASL 1.0 has no arithmetic division operator, but if it did, division by zero would be an undefined arithmetic expression.

未定义表达式是未定义表达式值的表达式。未定义表达式是一个与未知真值完全不同的概念,而未知真值实际上是定义良好的。在本节中,属性名和文字常量被视为表达式。如果扫描下的当前资源中的某个属性尚未设置为值,则该属性的值对于扫描下的资源是未定义的。DASL 1.0没有算术除法运算符,但如果有,则被零除法将是一个未定义的算术表达式。

If any subpart of an arithmetic, string, or datetime subexpression is undefined, the whole arithmetic, string, or datetime subexpression is undefined.

如果算术、字符串或日期时间子表达式的任何子部分未定义,则整个算术、字符串或日期时间子表达式未定义。

There are no manifest constants to explicitly represent undefined number, string, or datetime values.

没有显式表示未定义的数字、字符串或日期时间值的清单常量。

Since a Boolean value is ultimately returned by the search condition, arithmetic, string, and datetime expressions are always arguments to other operators. Examples of operators that convert arithmetic, string, and datetime expressions to Boolean values are the six relational operators ("greater than", "less than", "equals", etc.). If either or both operands of a relational operator have undefined values, then the relational operator evaluates to UNKNOWN. Otherwise, the relational operator evaluates to TRUE or FALSE, depending upon the outcome of the comparison.

由于布尔值最终由搜索条件返回,算术、字符串和日期时间表达式始终是其他运算符的参数。将算术、字符串和日期时间表达式转换为布尔值的运算符示例有六个关系运算符(“大于”、“小于”、“等于”等)。如果关系运算符的一个或两个操作数都有未定义的值,则关系运算符的计算结果为未知。否则,关系运算符将根据比较结果计算为TRUE或FALSE。

The Boolean operators DAV:and, DAV:or, and DAV:not are evaluated according to the following rules:

布尔运算符DAV:and、DAV:or和DAV:not将根据以下规则进行求值:

not UNKNOWN = UNKNOWN

不未知=未知

UNKNOWN and TRUE = UNKNOWN

未知和真=未知

UNKNOWN and FALSE = FALSE

未知和错误=错误

UNKNOWN and UNKNOWN = UNKNOWN

未知和未知=未知

UNKNOWN or TRUE = TRUE

未知或真=真

UNKNOWN or FALSE = UNKNOWN

未知或错误=未知

UNKNOWN or UNKNOWN = UNKNOWN

未知或未知=未知

Appendix B. Candidates for Future Protocol Extensions
附录B.未来协议扩展的候选协议

This section summarizes issues that have been raised during the development of this specification, but for which no resolution could be found with the constraints in place. Future revisions of this specification should revisit these issues, though.

本节总结了在制定本规范过程中提出的问题,但由于存在约束,无法找到解决方案。不过,本规范的未来版本应重新讨论这些问题。

B.1. Collation Support
B.1. 排序支持

Matching and sorting of textual data relies on collations. With respect to WebDAV SEARCH, a combination of various design approaches could be used:

文本数据的匹配和排序依赖于排序规则。关于WebDAV搜索,可以使用多种设计方法的组合:

o Require server support for specific collations.

o 需要特定排序规则的服务器支持。

o Require that the server can advertise which collations it supports.

o 要求服务器可以公布其支持的排序规则。

o Allow a client to select the collation to be used.

o 允许客户端选择要使用的排序规则。

In practice, the current implementations of WebDAV SEARCH usually rely on backends they do not control, and for which collation information may not be available. To make things worse, implementations of the DAV:basicsearch grammar frequently need to combine data from multiple underlying stores (such as properties and full text content), and thus collation support may vary based on the operator or property.

在实践中,WebDAV搜索的当前实现通常依赖于它们不控制的后端,并且这些后端的排序信息可能不可用。更糟糕的是,DAV:basicsearch语法的实现经常需要组合来自多个底层存储(例如属性和全文内容)的数据,因此排序支持可能因运算符或属性而异。

Another open issue is what collation formalism to support. At the time of this writing, the two specifications below seem to provide the necessary framework and thus may be the base for future work on collation support in WebDAV SEARCH:

另一个悬而未决的问题是支持什么样的校勘形式主义。在撰写本文时,以下两个规范似乎提供了必要的框架,因此可能是未来WebDAV搜索中排序支持工作的基础:

1. "Internet Application Protocol Collation Registry" ([RFC4790]).

1. “Internet应用程序协议整理注册表”([RFC4790])。

2. "XQuery 1.0 and XPath 2.0 Functions and Operators" ([XPATHFUNC], Section 7.3.1).

2. “XQuery 1.0和XPath 2.0函数和运算符”([XPATHFUNC],第7.3.1节)。

B.2. Count
B.2. 计数

DAV:basicsearch does not allow a request that returns the count of matching resources.

DAV:basicsearch不允许返回匹配资源计数的请求。

A protocol extension would need to extend DAV:select, and also modify the DAV:multistatus response format.

协议扩展需要扩展DAV:select,还需要修改DAV:multistatus响应格式。

B.3. Diagnostics for Unsupported Queries
B.3. 不支持查询的诊断

There are many reasons why a given query may not be supported by a server. Query Schema Discovery (Section 4) can be used to discover some constraints, but not all.

服务器可能不支持给定查询的原因有很多。查询模式发现(第4节)可用于发现某些约束,但不是全部约束。

Future revisions should consider the introduction of specific condition codes ([RFC4918], Section 16) to these situations.

未来的修订应该考虑引入特定的条件代码([RCF418],第16节)。

B.4. Language Matching
B.4. 语言匹配

Section 5.12.2 defines language matching in terms of the XPath "lang" function ([XPATH], Section 4.3). Future revisions should consider building on [BCP47] instead.

第5.12.2节根据XPath“lang”函数([XPath],第4.3节)定义了语言匹配。未来的修订应该考虑建立在[BCP47 ]上。

B.5. Matching Media Types
B.5. 匹配媒体类型

Matching media types using the DAV:getcontenttype property and the DAV:like operator is hard due to DAV:getcontenttype also allowing parameters. A new operator specifically designed for the purpose of matching media types probably would simplify things a lot. See <http ://lists.w3.org/Archives/Public/www-webdav-dasl/2003OctDec/0109.html> for a specific proposal.

使用DAV:getcontenttype属性和DAV:like运算符匹配媒体类型很困难,因为DAV:getcontenttype也允许参数。一家专门为匹配媒体类型而设计的新运营商可能会大大简化工作。具体提案见<http://lists.w3.org/Archives/Public/www-webdav-dasl/2003OctDec/0109.html>。

B.6. Query by Name
B.6. 按名称查询

DAV:basicsearch operates on the properties (and optionally the contents) of resources, and thus doesn't really allow matching on parts of the resource's URI. See <http://lists.w3.org/Archives/ Public/www-webdav-dasl/2003OctDec/0100.html> for a proposed extension covering this use case.

DAV:basicsearch对资源的属性(以及可选的内容)进行操作,因此不允许在资源的URI部分进行匹配。看<http://lists.w3.org/Archives/ Public/www.webdav-dasl/2003OctDec/0100.html>以获取涵盖此用例的拟议扩展。

B.7. Result Paging
B.7. 结果分页

A frequently discussed feature is the ability to specifically request the "next" set of results, when either the server decided to truncate the result, or the client explicitly asked for a limited set (for instance, using the DAV:limit element defined in Section 5.17).

一个经常讨论的特性是,当服务器决定截断结果或客户端明确要求有限的结果集时(例如,使用第5.17节中定义的DAV:limit元素),能够专门请求“下一个”结果集。

In this case, it would be desirable if the server could keep the full query result, and provide a new URI identifying a separate result resource, allowing the client to retrieve additional data through GET requests, and remove the result through a DELETE request.

在这种情况下,如果服务器能够保留完整的查询结果,并提供一个标识单独结果资源的新URI,允许客户端通过GET请求检索其他数据,并通过DELETE请求删除结果,这将是可取的。

B.8. Search Scope Discovery
B.8. 搜索范围发现

Given a Search Arbiter resource, there's currently no way to discover programmatically the supported sets of search scopes. Future revisions of this specification could specify a scope discovery mechanism, similar to the Query Schema Discovery defined in Section 4.

给定搜索仲裁器资源,目前无法通过编程方式发现受支持的搜索范围集。本规范的未来版本可能会指定一种范围发现机制,类似于第4节中定义的查询模式发现。

Index

指数

C caseless attribute 26-27, 34 Condition Names DAV:search-grammar-discovery-supported (pre) 9 DAV:search-grammar-supported (pre) 9 DAV:search-multiple-scope-supported (pre) 9 DAV:search-scope-valid (pre) 9 Criteria 5

C无大小写属性26-27,34个条件名称DAV:支持搜索语法发现(pre)9 DAV:支持搜索语法(pre)9 DAV:支持搜索多个作用域(pre)9 DAV:搜索作用域有效(pre)9条件5

D DAV:and 26 DAV:ascending 26 DAV:contains 31 DAV:depth 23 DAV:descending 26 DAV:eq 27 caseless attribute 27 DAV:from 23 DAV:gt 27 DAV:gte 27 DAV:include-versions 23 DAV:is-collection 30 DAV:is-defined 30 DAV:language-defined 29 DAV:language-matches 29 DAV:like 30 DAV:limit 33 DAV:literal 27 DAV:lt 27 DAV:lte 27 DAV:not 26 DAV:nresults 33 DAV:or 26

D DAV:和26 DAV:升序26 DAV:包含31 DAV:深度23 DAV:降序26 DAV:eq 27无壳属性27 DAV:从23 DAV:gt 27 DAV:gte 27 DAV:包含版本23 DAV:是集合30 DAV:是定义的30 DAV:语言定义的29 DAV:语言匹配29 DAV:像30 DAV:限制33 DAV:文字27 DAV:lt 27 DAV:lte 27 DAV:不是26 DAV:结果33 DAV:或26

DAV:orderby 26 DAV:scope 23 DAV:score 32 relationship to DAV:orderby 33 DAV:search-grammar-discovery-supported precondition 9 DAV:search-grammar-supported precondition 9 DAV:search-multiple-scope-supported precondition 9 DAV:search-scope-valid precondition 9 DAV:select 23 DAV:supported-query-grammar-set property 14 DAV:typed-literal 28 DAV:where 24

DAV:orderby 26 DAV:scope 23 DAV:score 32与DAV的关系:orderby 33 DAV:搜索语法发现支持的前提条件9 DAV:搜索语法支持的前提条件9 DAV:搜索多范围支持的前提条件9 DAV:搜索范围有效的前提条件9 DAV:选择23 DAV:支持的查询语法集属性14 DAV:类型化文字28 DAV:其中24

M Methods SEARCH 7

M方法搜索7

O OPTIONS method 13 DASL response header 14

O选项方法13 DASL响应头14

P Properties DAV:supported-query-grammar-set 14

P属性DAV:支持的查询语法集14

Q Query 5 Query Grammar 5 Query Grammar Discovery 13 using live property 13 using OPTIONS 13 Query Schema 5

Q查询5查询语法5查询语法发现13使用live属性13使用选项13查询模式5

R Result 5 Result Record 5 Result Record Definition 5 Result Set 5 Result Set Truncation Example 10

R结果5结果记录5结果记录定义5结果集5结果集截断示例10

S Scope 6 Search Arbiter 6 SEARCH method 7 Search Modifier 6 Sort Specification 6

S范围6搜索仲裁器6搜索方法7搜索修改器6排序规范6

Authors' Addresses

作者地址

Julian F. Reschke (editor) greenbytes GmbH Hafenweg 16 Muenster, NW 48155 Germany

Julian F.Reschke(编辑)greenbytes GmbH Hafenweg 16 Muenster,西北48155德国

   Phone: +49 251 2807760
   EMail: julian.reschke@greenbytes.de
   URI:   http://greenbytes.de/tech/webdav/
        
   Phone: +49 251 2807760
   EMail: julian.reschke@greenbytes.de
   URI:   http://greenbytes.de/tech/webdav/
        

Surendra Reddy Mitrix, Inc. 303 Twin Dolphin Drive, Suite 600-37 Redwood City, CA 94065 U.S.A.

Surendra Reddy Mitrix,Inc.美国加利福尼亚州红木市双海豚大道303号600-37室,邮编94065。

   Phone: +1 408 500 1135
   EMail: Surendra.Reddy@mitrix.com
        
   Phone: +1 408 500 1135
   EMail: Surendra.Reddy@mitrix.com
        

Jim Davis 27 Borden Street Toronto, Ontario M5S 2M8 Canada

Jim Davis加拿大安大略省多伦多市波登街27号M5S 2M8

   Phone: +1 416 929 5854
   EMail: jrd3@alum.mit.edu
   URI:   http://www.econetwork.net/~jdavis
        
   Phone: +1 416 929 5854
   EMail: jrd3@alum.mit.edu
   URI:   http://www.econetwork.net/~jdavis
        

Alan Babich IBM Corporation 3565 Harbor Blvd. Costa Mesa, CA 92626 U.S.A.

艾伦·巴比奇IBM公司海港大道3565号。美国加利福尼亚州科斯塔梅萨92626。

   Phone: +1 714 327 3403
   EMail: ababich@us.ibm.com
        
   Phone: +1 714 327 3403
   EMail: ababich@us.ibm.com