Network Working Group                                         G. Klyne
Request for Comments: 2533                    Content Technologies/5GM
Category: Standards Track                                   March 1999
        
Network Working Group                                         G. Klyne
Request for Comments: 2533                    Content Technologies/5GM
Category: Standards Track                                   March 1999
        

A Syntax for Describing Media Feature Sets

描述媒体功能集的语法

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) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

Abstract

摘要

A number of Internet application protocols have a need to provide content negotiation for the resources with which they interact [1]. A framework for such negotiation is described in [2], part of which is a way to describe the range of media features which can be handled by the sender, recipient or document transmission format of a message. A format for a vocabulary of individual media features and procedures for feature registration are presented in [3].

许多Internet应用程序协议需要为与之交互的资源提供内容协商[1]。[2]中描述了此类协商的框架,其中一部分是描述可由消息的发送者、接收者或文档传输格式处理的媒体功能范围的方法。[3]中介绍了单个媒体功能词汇表的格式和功能注册程序。

This document introduces and describes a syntax that can be used to define feature sets which are formed from combinations and relations involving individual media features. Such feature sets are used to describe the media feature handling capabilities of message senders, recipients and file formats.

本文档介绍并描述了可用于定义功能集的语法,这些功能集由涉及单个媒体功能的组合和关系构成。这些功能集用于描述消息发送者、接收者和文件格式的媒体功能处理能力。

An algorithm for feature set matching is also described here.

本文还介绍了一种特征集匹配算法。

Table of Contents

目录

   1. Introduction.............................................3
     1.1 Structure of this document ...........................3
     1.2 Document terminology and conventions .................4
     1.3 Discussion of this document ..........................4
   2. Content feature terminology and definitions..............4
   3. Media feature combinations and capabilities..............5
     3.1 Media features .......................................5
     3.2 Media feature collections and sets ...................5
     3.3 Media feature set descriptions .......................6
     3.4 Media feature combination scenario ...................7
        
   1. Introduction.............................................3
     1.1 Structure of this document ...........................3
     1.2 Document terminology and conventions .................4
     1.3 Discussion of this document ..........................4
   2. Content feature terminology and definitions..............4
   3. Media feature combinations and capabilities..............5
     3.1 Media features .......................................5
     3.2 Media feature collections and sets ...................5
     3.3 Media feature set descriptions .......................6
     3.4 Media feature combination scenario ...................7
        
        3.4.1 Data resource options............................7
        3.4.2 Recipient capabilities...........................7
        3.4.3 Combined options.................................7
     3.5 Feature set predicates ...............................8
        3.5.1 Comparison with directory search filters.........8
     3.6 Describing preferences ...............................9
     3.7 Combining preferences ...............................10
   4. Feature set representation..............................11
     4.1 Textual representation of predicates ................11
     4.2 Interpretation of feature predicate syntax ..........12
        4.2.1 Filter syntax...................................12
        4.2.2 Feature comparison..............................13
        4.2.3 Feature tags....................................13
        4.2.4 Feature values..................................14
          4.2.4.1 Boolean values                              14
          4.2.4.2 Numeric values                              14
          4.2.4.3 Token values                                15
          4.2.4.4 String values                               15
        4.2.5 Notational conveniences.........................15
     4.3 Feature set definition example ......................16
   5. Matching feature sets...................................16
     5.1 Feature set matching strategy .......................18
     5.2 Formulating the goal predicate ......................19
     5.3 Replace set expressions .............................19
     5.4 Move logical negations inwards ......................20
     5.5 Replace comparisons and logical negations ...........20
     5.6 Conversion to canonical form ........................21
     5.7 Grouping of feature predicates ......................22
     5.8 Merge single-feature constraints ....................22
        5.8.1 Rules for simplifying ordered values............23
        5.8.2 Rules for simplifying unordered values..........23
   6. Other features and issues...............................24
     6.1 Named and auxiliary predicates ......................24
        6.1.1 Defining a named predicate......................24
        6.1.2 Invoking named predicates.......................25
        6.1.3 Auxiliary predicates in a filter................25
        6.1.4 Feature matching with named predicates..........25
        6.1.5 Example.........................................26
     6.2 Unit designations ...................................26
     6.3 Unknown feature value data types ....................27
   7. Examples and additional comments........................27
     7.1 Worked example ......................................27
     7.2 A note on feature tag scoping .......................31
   8. Security Considerations.................................34
   9. Acknowledgements........................................34
   10. References.............................................35
   11. Author's Address.......................................36
   Full Copyright Statement...................................37
        
        3.4.1 Data resource options............................7
        3.4.2 Recipient capabilities...........................7
        3.4.3 Combined options.................................7
     3.5 Feature set predicates ...............................8
        3.5.1 Comparison with directory search filters.........8
     3.6 Describing preferences ...............................9
     3.7 Combining preferences ...............................10
   4. Feature set representation..............................11
     4.1 Textual representation of predicates ................11
     4.2 Interpretation of feature predicate syntax ..........12
        4.2.1 Filter syntax...................................12
        4.2.2 Feature comparison..............................13
        4.2.3 Feature tags....................................13
        4.2.4 Feature values..................................14
          4.2.4.1 Boolean values                              14
          4.2.4.2 Numeric values                              14
          4.2.4.3 Token values                                15
          4.2.4.4 String values                               15
        4.2.5 Notational conveniences.........................15
     4.3 Feature set definition example ......................16
   5. Matching feature sets...................................16
     5.1 Feature set matching strategy .......................18
     5.2 Formulating the goal predicate ......................19
     5.3 Replace set expressions .............................19
     5.4 Move logical negations inwards ......................20
     5.5 Replace comparisons and logical negations ...........20
     5.6 Conversion to canonical form ........................21
     5.7 Grouping of feature predicates ......................22
     5.8 Merge single-feature constraints ....................22
        5.8.1 Rules for simplifying ordered values............23
        5.8.2 Rules for simplifying unordered values..........23
   6. Other features and issues...............................24
     6.1 Named and auxiliary predicates ......................24
        6.1.1 Defining a named predicate......................24
        6.1.2 Invoking named predicates.......................25
        6.1.3 Auxiliary predicates in a filter................25
        6.1.4 Feature matching with named predicates..........25
        6.1.5 Example.........................................26
     6.2 Unit designations ...................................26
     6.3 Unknown feature value data types ....................27
   7. Examples and additional comments........................27
     7.1 Worked example ......................................27
     7.2 A note on feature tag scoping .......................31
   8. Security Considerations.................................34
   9. Acknowledgements........................................34
   10. References.............................................35
   11. Author's Address.......................................36
   Full Copyright Statement...................................37
        
1. Introduction
1. 介绍

A number of Internet application protocols have a need to provide content negotiation for the resources with which they interact [1]. A framework for such negotiation is described in [2]. A part of this framework is a way to describe the range of media features which can be handled by the sender, recipient or document transmission format of a message.

许多Internet应用程序协议需要为与之交互的资源提供内容协商[1]。[2]中描述了此类协商的框架。该框架的一部分是描述消息的发送者、接收者或文档传输格式可以处理的媒体功能范围的一种方法。

Descriptions of media feature capabilities need to be based upon some underlying vocabulary of individual media features. A format for such a vocabulary and procedures for registering media features within this vocabulary are presented in [3].

媒体功能功能的描述需要基于单个媒体功能的一些基本词汇表。[3]中介绍了此类词汇表的格式以及在此词汇表中注册媒体功能的步骤。

This document defines a syntax that can be used to describe feature sets which are formed from combinations and relations involving individual media features. Such feature sets are used to describe the media handling capabilities of message senders, recipients and file formats.

本文档定义了一种语法,可用于描述由涉及单个媒体功能的组合和关系形成的功能集。这些功能集用于描述消息发送者、接收者和文件格式的媒体处理能力。

An algorithm for feature set matching is also described here.

本文还介绍了一种特征集匹配算法。

The feature set syntax is built upon the principle of using feature set predicates as "mathematical relations" which define constraints on feature handling capabilities. This allows that the same form of feature set expression can be used to describe sender, receiver and file format capabilities. This has been loosely modelled on the way that relational databases use Boolean expresions to describe a set of result values, and a syntax that is based upon LDAP search filters.

功能集语法建立在使用功能集谓词作为“数学关系”的原则之上,该数学关系定义了功能处理能力的约束。这允许使用相同形式的功能集表达式来描述发送方、接收方和文件格式功能。这是基于关系数据库使用布尔表达式来描述一组结果值的方式以及基于LDAP搜索过滤器的语法进行的松散建模。

1.1 Structure of this document
1.1 本文件的结构

The main part of this memo addresses the following main areas:

本备忘录的主要部分涉及以下主要领域:

Section 2 introduces and references some terms which are used with special meaning.

第2节介绍和引用了一些具有特殊含义的术语。

Section 3 introduces the concept of describing media handling capabilities as combinations of possible media features, and the idea of using Boolean expressions to express such combinations.

第3节介绍了将媒体处理能力描述为可能的媒体功能组合的概念,以及使用布尔表达式表示这些组合的思想。

Section 4 contains a description of a syntax for describing feature sets based on the previously-introduced idea of Boolean expressions used to describe media feature combinations.

第4节描述了用于描述特征集的语法,该语法基于之前介绍的用于描述媒体特征组合的布尔表达式的思想。

Section 5 describes an algorithm for feature set matching.

第5节描述了一种特征集匹配算法。

Section 6 discusses some additional media feature description and processing issues that may be viewed as extensions to the core framework.

第6节讨论了一些附加的媒体功能描述和处理问题,这些问题可能被视为核心框架的扩展。

Section 7 contains a worked example of feature set matching, and some additional explanatory comments spurred by issues arising from applying this framework to fascimile transmissions.

第7节包含一个功能集匹配的工作示例,以及因将此框架应用于Fancimile传输而产生的问题而引发的一些附加解释性意见。

1.2 Document terminology and conventions
1.2 文件术语和公约

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 RFC 2119.

本文件中的关键词“必须”、“不得”、“必需”、“应”、“不应”、“应”、“不应”、“建议”、“可”和“可选”应按照RFC 2119中的说明进行解释。

NOTE: Comments like this provide additional nonessential information about the rationale behind this document. Such information is not needed for building a conformant implementation, but may help those who wish to understand the design in greater depth.

注:此类评论提供了有关本文件背后的基本原理的其他非必要信息。构建一致性实现不需要这些信息,但可以帮助那些希望更深入地理解设计的人。

1.3 Discussion of this document
1.3 对本文件的讨论

Discussion of this document should take place on the content negotiation and media feature registration mailing list hosted by the Internet Mail Consortium (IMC):

本文件的讨论应在互联网邮件联盟(IMC)主办的内容协商和媒体功能注册邮件列表上进行:

Please send comments regarding this document to:

请将有关本文件的意见发送至:

ietf-medfree@imc.org

ietf-medfree@imc.org

To subscribe to this list, send a message with the body 'subscribe' to "ietf-medfree-request@imc.org".

要订阅此列表,请向“ietf medfree”发送一条正文为“订阅”的消息-request@imc.org".

To see what has gone on before you subscribed, please see the mailing list archive at:

要查看订阅前的情况,请访问邮件列表存档:

      http://www.imc.org/ietf-medfree/
        
      http://www.imc.org/ietf-medfree/
        
2. Content feature terminology and definitions
2. 内容功能术语和定义

Feature Collection is a collection of different media features and associated values. This might be viewed as describing a specific rendering of a specific instance of a document or resource by a specific recipient.

功能集合是不同媒体功能和关联值的集合。这可能被视为描述特定收件人对文档或资源的特定实例的特定呈现。

Feature Set is a set of zero, one or more feature collections.

要素集是零个、一个或多个要素集合的集合。

NOTE: this term is used slightly differently by earlier work on Transparent Content Negotiation in HTTP [4].

注意:HTTP[4]中关于透明内容协商的早期工作使用的术语略有不同。

Feature set predicate A function of an arbitrary feature collection value which returns a Boolean result. A TRUE result is taken to mean that the corresponding feature collection belongs to some set of media feature handling capabilities defined by this predicate.

要素集谓词具有任意要素集合值的函数,该函数返回布尔结果。如果结果为真,则表示相应的功能集合属于此谓词定义的某组媒体功能处理功能。

Other terms used in this memo are defined in [2].

本备忘录中使用的其他术语定义见[2]。

3. Media feature combinations and capabilities
3. 媒体功能组合和功能
3.1 Media features
3.1 媒体特色

This memo assumes that individual media feature values are simple atomic values:

本备忘录假设单个媒体功能值是简单的原子值:

o Boolean values.

o 布尔值。

o Enumerated values.

o 枚举值。

o Text string values (treated as atomic entities, like enumerated value tokens).

o 文本字符串值(视为原子实体,如枚举值标记)。

o Numeric values (Integer or rational).

o 数值(整数或有理数)。

These values all have the property that they can be compared for equality ('='), and that numeric and ordered enumeration values can be compared for less-than and greater-than relationship ('<=', '>='). These basic comparison operations are used as the primitive building blocks for more comprehensive capability expressions.

这些值都具有这样的属性:可以比较它们是否相等(“=”),并且可以比较小于和大于关系(“<=”、“>=”)的数值和有序枚举值。这些基本比较操作被用作更全面能力表达式的基本构建块。

3.2 Media feature collections and sets
3.2 媒体功能集合和集合

Any single media feature value can be thought of as just one component of a feature collection that describes some instance of a resource (e.g. a printed document, a displayed image, etc.). Such a feature collection consists of a number of media feature tags (each per [3]) and associated feature values.

任何单个媒体特征值都可以看作是描述资源(例如打印文档、显示图像等)的某个实例的特征集合的一个组件。这样的特征集合由多个媒体特征标签(每个标签[3])和相关特征值组成。

A feature set is a set containing a number of feature collections. Thus, a feature set can describe a number of different data resource instances. These can correspond to different treatments of a single data resource (e.g. different resolutions used for printing a given document), a number of different data resources subjected to a common treatment (e.g. the range of different images that can be rendered on a given display), or some combination of these (see examples below).

要素集是包含多个要素集合的集合。因此,特征集可以描述许多不同的数据资源实例。这些可以对应于单个数据资源的不同处理方式(例如,用于打印给定文档的不同分辨率)、接受公共处理的多个不同数据资源(例如,可以在给定显示器上渲染的不同图像的范围)或这些的一些组合(参见下面的示例)。

Thus, a description of a feature set can describe the capabilities of a data resource or some entity that processes or renders a data resource.

因此,特征集的描述可以描述数据资源或处理或呈现数据资源的某个实体的能力。

3.3 Media feature set descriptions
3.3 媒体功能集说明

A feature set may be unbounded. For example, in principle, there is no limit on the number of different documents that may be output using a given printer. But to be practically useful, a feature set description must be finite.

要素集可以是无界的。例如,原则上,使用给定打印机输出的不同文档的数量没有限制。但为了实际有用,特征集描述必须是有限的。

The general approach to describing feature sets is to start from the assumption that anything is possible; i.e. the feature set contains all possible document instances (feature collections). Then constraints are applied that progressively remove document instances from this set; e.g. for a monochrome printer, all document instances that use colour are removed, or for a document that must be rendered at some minimum resolution, all document instances with lesser resolutions are removed from the set. The mechanism used to remove document instances from the set is the mathematical idea of a "relation"; i.e. a Boolean function (a "predicate") that takes a feature collection parameter and returns a Boolean value that is TRUE if the feature collection describes an acceptable document instance, or FALSE if it describes one that is excluded.

描述特征集的一般方法是从任何事情都可能的假设开始;i、 e.功能集包含所有可能的文档实例(功能集合)。然后应用约束,逐步从该集合中移除文档实例;e、 g.对于单色打印机,将删除所有使用颜色的文档实例,或者对于必须以某种最低分辨率呈现的文档,将从集合中删除所有分辨率较低的文档实例。用于从集合中删除文档实例的机制是“关系”的数学概念;i、 e.一个布尔函数(“谓词”),它接受要素集合参数并返回一个布尔值,如果要素集合描述了一个可接受的文档实例,则该布尔值为TRUE;如果要素集合描述了一个被排除的文档实例,则返回FALSE。

                     P(C)
       P(C) = TRUE <- : -> P(C) = FALSE
                      :
           +----------:----------+  This box represents some
           |          :          |  set of feature collections (C)
           | Included : Excluded |  that is constrained by the
           |          :          |  predicate P.
           +----------:----------+
                      :
        
                     P(C)
       P(C) = TRUE <- : -> P(C) = FALSE
                      :
           +----------:----------+  This box represents some
           |          :          |  set of feature collections (C)
           | Included : Excluded |  that is constrained by the
           |          :          |  predicate P.
           +----------:----------+
                      :
        

The result of applying a series of such constraints is a smaller set of feature collections that represent some media handling capability. Where the individual constraints are represented by predicates that each describe some media handling capability, the combined effect of these constraints is some subset of the individual constraint capabilities that can be represented by a predicate that is the logical-AND of the individual constraint predicates.

应用一系列此类约束的结果是一组较小的功能集合,它们代表一些媒体处理能力。如果单个约束由描述某些媒体处理能力的谓词表示,则这些约束的组合效应是单个约束能力的某个子集,可以由单个约束谓词的逻辑AND谓词表示。

3.4 Media feature combination scenario
3.4 媒体功能组合方案

This section develops some example scenarios, introducing the notation that is defined formally in section 4.

本节开发了一些示例场景,介绍了第4节中正式定义的符号。

3.4.1 Data resource options
3.4.1 数据资源选项

The following expression describes a data resource that can be displayed either: (a) as a 750x500 pixel image using 15 colours, or (b) at 150dpi on an A4 page.

以下表达式描述了可以显示的数据资源:(a)使用15种颜色显示为750x500像素图像,或(b)在A4页面上以150dpi显示。

      (| (& (pix-x=750) (pix-y=500) (color=15) )
         (& (dpi>=150) (papersize=iso-A4) ) )
        
      (| (& (pix-x=750) (pix-y=500) (color=15) )
         (& (dpi>=150) (papersize=iso-A4) ) )
        
3.4.2 Recipient capabilities
3.4.2 接收者能力

The following expression describes a receiving system that has: (a) a screen capable of displaying 640*480 pixels and 16 million colours (24 bits per pixel), 800*600 pixels and 64 thousand colours (16 bits per pixel) or 1024*768 pixels and 256 colours (8 bits per pixel), or (b) a printer capable of rendering 300dpi on A4 paper.

以下表达式描述了一种接收系统,其具有:(a)能够显示640*480像素和1600万颜色(每像素24位)、800*600像素和64000颜色(每像素16位)或1024*768像素和256颜色(每像素8位)的屏幕,或(b)能够在A4纸上呈现300dpi的打印机。

         (| (& (| (& (pix-x<=640)  (pix-y<=480) (color<=16777216) )
                  (& (pix-x<=800)  (pix-y<=600) (color<=65535) )
                  (& (pix-x<=1024) (pix-y<=768) (color<=256) ) )
               (ua-media=screen) )
            (& (dpi=300)
               (ua-media=stationery) (papersize=iso-A4) ) )
        
         (| (& (| (& (pix-x<=640)  (pix-y<=480) (color<=16777216) )
                  (& (pix-x<=800)  (pix-y<=600) (color<=65535) )
                  (& (pix-x<=1024) (pix-y<=768) (color<=256) ) )
               (ua-media=screen) )
            (& (dpi=300)
               (ua-media=stationery) (papersize=iso-A4) ) )
        

Note that this expression says nothing about the colour or grey-scale capabilities of the printer. In the scheme presented here, it is presumed to be unconstrained in this respect (or, more realistically, any such constraints are handled out-of-band by anyone sending to this recipient).

请注意,此表达式与打印机的颜色或灰度功能无关。在这里介绍的方案中,假定它在这方面不受约束(或者更现实地说,任何发送给该接收者的人都会在带外处理任何此类约束)。

3.4.3 Combined options
3.4.3 组合期权

The following example describes the range of document representations available when the resource described in the first example above is sent to the recipient described in the second example. This is the result of combining their capability feature sets:

下面的示例描述了将上面第一个示例中描述的资源发送给第二个示例中描述的收件人时可用的文档表示的范围。这是将它们的功能集结合在一起的结果:

         (| (& (pix-x=750) (pix-y=500) (color=15) )
            (& (dpi=300) (ua-media=stationery) (papersize=iso-A4) ) )
        
         (| (& (pix-x=750) (pix-y=500) (color=15) )
            (& (dpi=300) (ua-media=stationery) (papersize=iso-A4) ) )
        

The feature set described by this expression is the intersection of the sets described by the previous two capability expressions.

此表达式描述的特征集是前两个能力表达式描述的集合的交集。

3.5 Feature set predicates
3.5 特征集谓词

There are many ways of representing a predicate. The ideas in this memo were inspired by the programming language Prolog [5], and its use of predicates to describe sets of objects.

表示谓词的方法有很多种。本备忘录中的思想受到编程语言Prolog[5]的启发,并使用谓词来描述对象集。

For the purpose of media feature descriptions in networked application protocols, the format used for LDAP search filters [7,8] has been adopted, because it is a good match for the requirements of capability identification, and has a very simple structure that is easy to parse and process.

为了在网络应用程序协议中描述媒体功能,采用了LDAP搜索过滤器[7,8]所用的格式,因为它很好地符合能力识别的要求,并且具有非常简单的结构,易于解析和处理。

3.5.1 Comparison with directory search filters
3.5.1 与目录搜索筛选器的比较

Observe that a feature collection is similar to a directory entry, in that it consists of a collection of named values. Further, the semantics of the mechanism for selecting feature collections from a feature set is in many respects similar to selection of directory entries from a directory.

请注意,要素集合类似于目录条目,因为它由命名值的集合组成。此外,从功能集中选择功能集合的机制的语义在许多方面类似于从目录中选择目录项。

A feature set predicate used to describe media handling capabilities is implicitly applied to some feature collection. Within the predicate, members of the feature collection are identified by their feature tags, and are compared with known feature values. (Compare with the way an LDAP search filter is applied to a directory entry, whose members are identified by attribute type names, and compared with known attribute values.)

用于描述媒体处理能力的功能集谓词隐式应用于某些功能集合。在谓词中,要素集合的成员由其要素标记标识,并与已知要素值进行比较。(与LDAP搜索筛选器应用于目录条目的方式进行比较,目录条目的成员由属性类型名称标识,并与已知属性值进行比较。)

For example, in:

例如,在:

      (& (dpi>=150) (papersize=iso-A4) )
        
      (& (dpi>=150) (papersize=iso-A4) )
        

the tokens 'dpi' and 'papersize' are feature tags, and '150' and ' iso-A4' are feature values. (In a corresponding LDAP search filter, they would be directory entry attribute types and attribute values.)

标记“dpi”和“papersize”是特征标记,“150”和“iso-A4”是特征值。(在相应的LDAP搜索筛选器中,它们将是目录条目属性类型和属性值。)

Differences between directory selection (per [7]) and feature set selection are:

目录选择(按照[7])和功能集选择之间的区别如下:

o Directory selection provides substring-, approximate- and extensible- matching for attribute values. Such matching is not provided for feature set selection.

o 目录选择为属性值提供子字符串、近似和可扩展匹配。不为特征集选择提供此类匹配。

o Directory selection may be based on the presence of an attribute without regard to its value. Within the semantic framework described by this document, Boolean-valued feature tests can be used to provide a similar effect.

o 目录选择可以基于属性的存在而不考虑其值。在本文描述的语义框架内,布尔值特征测试可用于提供类似的效果。

o Directory selection provides for matching rules that test for the presence or absence of a named attribute type.

o 目录选择提供用于测试命名属性类型是否存在的匹配规则。

o Directory selection provides for matching rules which are dependent upon the declared data type of an attribute value.

o 目录选择提供了依赖于属性值的声明数据类型的匹配规则。

o Feature selection provides for the association of a quality value with a feature predicate as a way of ranking the selected value collections.

o 特征选择提供了质量值与特征谓词的关联,作为对所选值集合进行排序的一种方式。

Within the semantic framework described by this document, Boolean-valued feature tests can be used where presence tests would be used in a directory search filter.

在本文档描述的语义框架内,布尔值特征测试可用于目录搜索过滤器中的状态测试。

The idea of extensible matching and matching rules dependent upon data types are facets of a problem not addressed by this memo, but which do not necessarily affect the feature selection syntax. An aspect that might bear on the syntax would be specification of an explicit matching rule as part of a selection expression.

可扩展匹配的思想和依赖于数据类型的匹配规则是本备忘录未解决的问题的一个方面,但不一定会影响特征选择语法。可能会影响语法的一个方面是将显式匹配规则指定为选择表达式的一部分。

3.6 Describing preferences
3.6 描述偏好

A convenient way to describe preferences is by numeric "quality values".

描述偏好的一种方便方法是使用数字“质量值”。

It has been suggested that numeric quality values are potentially misleading if used as more than just a way of ranking options. For the purposes of this memo, ranking of options is sufficient.

有人认为,如果将数字质量值不仅仅用作排序选项的方式,则可能会产生误导。就本备忘录而言,期权排名已足够。

Numeric quality values in the range 0 to 1, with up to 3 fractional digits, are used to rank feature sets according to preference. Higher values are preferred over lower values, and equal values are presumed to be equally preferred. Beyond this, the actual number used has no significance defined here. Arithmetic operations on quality values are likely to produce unpredictable results unless appropriate semantics have been defined for the context where such operations are used.

0到1范围内的数字质量值(最多3个小数位数)用于根据首选项对要素集进行排序。较高的值优先于较低的值,并且假定相同的值也同样优先。除此之外,实际使用的数字在此没有定义意义。除非为使用质量值的上下文定义了适当的语义,否则对质量值的算术运算可能会产生不可预测的结果。

In the absence of any explicitly applied quality value, a value of "1" is assumed.

在没有任何明确应用的质量值的情况下,假定值为“1”。

Using the notation defined later, a quality value may be attached to any feature set predicate sub-expression:

使用后面定义的符号,可以将质量值附加到任何特征集谓词子表达式:

      (| (& (pix-x=750) (pix-y=500) (color=15) );q=0.8
         (& (dpi>=150) (papersize=iso-A4) )     ;q=0.7 )
        
      (| (& (pix-x=750) (pix-y=500) (color=15) );q=0.8
         (& (dpi>=150) (papersize=iso-A4) )     ;q=0.7 )
        

Section 3.7 below explains that quality values attached to sub-expressions are not always useful.

下面的第3.7节解释了附加到子表达式的质量值并不总是有用的。

NOTE: the syntax for quality values used here taken from that defined for HTTP 'Accept:' headers in RFC 2068 [9], section 3.9. However, the use of quality values defined here does not go as far as that defined in RFC 2068.

注:此处使用的质量值语法取自RFC 2068[9]第3.9节中为HTTP“Accept:”头定义的语法。然而,此处定义的质量值的使用没有RFC 2068中定义的那么远。

3.7 Combining preferences
3.7 组合偏好

The general problem of describing and combining preferences among feature sets is very much more complex than simply describing allowable feature sets. For example, given two feature sets:

描述和组合特征集之间偏好的一般问题比简单描述允许的特征集要复杂得多。例如,给定两个要素集:

      (& (a1);q=0.8 (b1);q=0.7 )
      (& (a2);q=0.5 (b2);q=0.9 )
        
      (& (a1);q=0.8 (b1);q=0.7 )
      (& (a2);q=0.5 (b2);q=0.9 )
        

where: feature a1 is preferred over a2 feature b2 is preferred over b1

其中:特征a1优先于a2,特征b2优先于b1

Which of these feature sets is preferred? In the absence of additional information or assumptions, there is no generally satisfactory answer to this.

以下哪种功能集是首选的?在缺乏其他信息或假设的情况下,没有普遍令人满意的答案。

The proposed resolution of this issue is simply to say that no rules are provided for combining preference information. Applied to the above example, any preference information about (a1) in relation to (a2), or (b1) in relation to (b2) is not presumed to convey information about preference of (& (a1) (b1) ) in relation to (& (a2) (b2) ).

这个问题的拟议解决方案只是说,没有提供组合偏好信息的规则。应用于上述示例,关于(a1)相对于(a2)或(b1)相对于(b2)的任何偏好信息不被推定为传达关于(&(a1)(b1))相对于(&(a2)(b2))的偏好的信息。

In practical terms, this restricts the application of preference information to top-level predicate clauses. A top-level clause completely defines an allowable feature set; clauses combined by logical-AND operators cannot be top-level clauses (see canonical format for feature set predicates, described later).

实际上,这限制了偏好信息在顶级谓词子句中的应用。顶级子句完全定义了允许的特征集;由逻辑AND运算符组合的子句不能是顶级子句(请参阅稍后描述的功能集谓词的规范格式)。

NOTE: This memo does not apply specific meaning to quality values or rules for combining them. Application of such meanings and rules is not prohibited, but is seen as an area for continuing research and experimentation.

注:本备忘录不适用于质量值的特定含义或组合它们的规则。这些含义和规则的应用并不被禁止,但被视为一个继续研究和实验的领域。

An example of a design that uses extended quality value semantics and combining operations is "Transparent Content Negotiation in HTTP" [4]. Other work that also extends quality values is the content negotiation algorithm in the Apache HTTP server [14].

使用扩展质量值语义和组合操作的设计示例是“HTTP中的透明内容协商”[4]。其他扩展质量值的工作是ApacheHTTP服务器中的内容协商算法[14]。

4. Feature set representation
4. 特征集表示

The foregoing sections have described a framework for defining feature sets with predicates applied to feature collections. This section presents a concrete representation for feature set predicates.

前面的章节描述了一个框架,用于定义应用于要素集合的谓词的要素集。本节介绍功能集谓词的具体表示。

4.1 Textual representation of predicates
4.1 谓词的文本表示

The text representation of a feature set is based on RFC 2254 "The String Representation of LDAP Search Filters" [8], excluding those elements not relevant to feature set selection (discussed above), and adding elements specific to feature set selection (e.g. options to associate quality values with predicates).

功能集的文本表示基于RFC 2254“LDAP搜索过滤器的字符串表示”[8],排除与功能集选择无关的元素(如上所述),并添加特定于功能集选择的元素(例如,将质量值与谓词关联的选项)。

The format of a feature predicate is defined by the production for "filter" in the following, using the syntax notation and core rules of RFC 2234 [10]:

特征谓词的格式由下文中“过滤器”的产品使用RFC 2234[10]的语法符号和核心规则定义:

      filter     =  "(" filtercomp ")" *( ";" parameter )
      parameter  =  "q" "=" qvalue
                 /  ext-param "=" ext-value
      qvalue     =  ( "0" [ "." 0*3DIGIT ] )
                 /  ( "1" [ "." 0*3("0") ] )
      ext-param  =  ALPHA *( ALPHA / DIGIT / "-" )
      ext-value  =  <parameter value, according to the named parameter>
      filtercomp =  and / or / not / item
      and        =  "&" filterlist
      or         =  "|" filterlist
      not        =  "!" filter
      filterlist =  1*filter
      item       =  simple / set / ext-pred
      set        =  attr "=" "[" setentry *( "," setentry ) "]"
      setentry   =  value "/" range
      range      =  value ".." value
      simple     =  attr filtertype value
      filtertype =  equal / greater / less
      equal      =  "="
      greater    =  ">="
      less       =  "<="
      attr       =  ftag
      value      =  fvalue
      ftag       =  <Feature tag, as defined in RFC 2506 [3]>
      fvalue     =  Boolean / number / token / string
      Boolean    =  "TRUE" / "FALSE"
      number     =  integer / rational
      integer    =  [ "+" / "-" ] 1*DIGIT
      rational   =  [ "+" / "-" ] 1*DIGIT "/" 1*DIGIT
        
      filter     =  "(" filtercomp ")" *( ";" parameter )
      parameter  =  "q" "=" qvalue
                 /  ext-param "=" ext-value
      qvalue     =  ( "0" [ "." 0*3DIGIT ] )
                 /  ( "1" [ "." 0*3("0") ] )
      ext-param  =  ALPHA *( ALPHA / DIGIT / "-" )
      ext-value  =  <parameter value, according to the named parameter>
      filtercomp =  and / or / not / item
      and        =  "&" filterlist
      or         =  "|" filterlist
      not        =  "!" filter
      filterlist =  1*filter
      item       =  simple / set / ext-pred
      set        =  attr "=" "[" setentry *( "," setentry ) "]"
      setentry   =  value "/" range
      range      =  value ".." value
      simple     =  attr filtertype value
      filtertype =  equal / greater / less
      equal      =  "="
      greater    =  ">="
      less       =  "<="
      attr       =  ftag
      value      =  fvalue
      ftag       =  <Feature tag, as defined in RFC 2506 [3]>
      fvalue     =  Boolean / number / token / string
      Boolean    =  "TRUE" / "FALSE"
      number     =  integer / rational
      integer    =  [ "+" / "-" ] 1*DIGIT
      rational   =  [ "+" / "-" ] 1*DIGIT "/" 1*DIGIT
        
      token      =  ALPHA *( ALPHA / DIGIT / "-" )
      string     =  DQUOTE *(%x20-21 / %x23-7E) DQUOTE
                    ; quoted string of SP and VCHAR without DQUOTE
      ext-pred   =  <Extension constraint predicate, not defined here>
        
      token      =  ALPHA *( ALPHA / DIGIT / "-" )
      string     =  DQUOTE *(%x20-21 / %x23-7E) DQUOTE
                    ; quoted string of SP and VCHAR without DQUOTE
      ext-pred   =  <Extension constraint predicate, not defined here>
        

(Subject to constraints imposed by the protocol that carries a feature predicate, whitespace characters may appear between any pair of syntax elements or literals that appear on the right hand side of these productions.)

(根据承载特征谓词的协议施加的约束,空白字符可能出现在这些产品右侧出现的任何一对语法元素或文本之间。)

As described, the syntax permits parameters (including quality values) to be attached to any "filter" value in the predicate (not just top-level values). Only top-level quality values are recognized. If no explicit quality value is given, a value of '1.0' is applied.

如上所述,语法允许将参数(包括质量值)附加到谓词中的任何“过滤器”值(而不仅仅是顶级值)。仅识别顶级质量值。如果未给出明确的质量值,则应用值“1.0”。

NOTE: The flexible approach to quality values and other parameter values in this syntax has been adopted for two reasons: (a) to make it easy to combine separately constructed feature predicates, and (b) to provide an extensible tagging mechanism for possible future use (for example, to incorporate a conceivable requirement to explicitly specify a matching rule).

注:采用这种语法中质量值和其他参数值的灵活方法有两个原因:(a)便于组合单独构造的特征谓词,以及(b)为将来可能的使用提供可扩展的标记机制(例如,纳入明确指定匹配规则的可能要求)。

4.2 Interpretation of feature predicate syntax
4.2 特征谓词语法的解释

A feature set predicate is described by the syntax production for ' filter'.

功能集谓词由“filter”的语法产品描述。

4.2.1 Filter syntax
4.2.1 过滤语法

A 'filter' is defined as either a simple feature comparison ('item', see below) or a composite filter ('and', 'or', 'not'), decorated with optional parameter values (including "q=qvalue").

“过滤器”被定义为一个简单的功能比较('item',见下文)或一个复合过滤器('and','or','not'),用可选参数值(包括“q=qvalue”)修饰。

A composite filter is a logical combination of one or more 'filter' values:

复合筛选器是一个或多个“筛选器”值的逻辑组合:

(& f1 f2 ... fn ) is the logical-AND of the filter values 'f1', 'f2' up to 'fn'. That is, it is satisfied by any feature collection that satisfies all of the predicates represented by those filters.

(&f1 f2…fn)是筛选器值“f1”、“f2”到“fn”之间的逻辑AND。也就是说,满足这些过滤器表示的所有谓词的任何特征集合都可以满足它。

(| f1 f2 ... fn ) is the logical-OR of the filter values 'f1', 'f2' up to 'fn'. That is, it is satisfied by any feature collection that satisfies at least one of the predicates represented by those filters.

(| f1 f2…fn)是筛选值“f1”、“f2”到“fn”的逻辑OR。也就是说,满足至少一个由这些过滤器表示的谓词的任何特征集合都可以满足它。

(! f1 ) is the logical negation of the filter value 'f1'. That is, it is satusfied by any feature collection that does NOT satisfy the predicate represented by 'f1'.

(!f1)是筛选值“f1”的逻辑求反。也就是说,它由任何不满足“f1”表示的谓词的要素集合来确定。

4.2.2 Feature comparison
4.2.2 特征比较

A feature comparison is defined by the 'simple' option of the syntax production for 'item'. There are three basic forms:

功能比较由“item”的语法生成的“simple”选项定义。有三种基本形式:

(ftag=value) compares the feature named 'ftag' (in some feature collection that is being tested) with the supplied 'value', and matches if they are equal. This can be used with any type of feaure value (numeric, Boolean, token or string).

(ftag=值)将名为“ftag”(在正在测试的某些功能集合中)的功能与提供的“值”进行比较,如果它们相等,则进行匹配。这可以用于任何类型的feaure值(数字、布尔值、标记或字符串)。

(ftag<=value) compares the numeric feature named 'ftag' with the supplied 'value', and matches if the feature is less than or equal to 'value'.

(ftag<=值)将名为“ftag”的数字特征与提供的“值”进行比较,如果特征小于或等于“值”,则匹配。

(ftag>=value) compares the numeric feature named 'ftag' with the supplied 'value', and matches if the feature is greater than or equal to 'value'.

(ftag>=值)将名为“ftag”的数字特征与提供的“值”进行比较,如果特征大于或等于“值”,则匹配。

Less-than and greater-than tests may be performed with feature values that are not numeric but, in general, they amount to equality tests as there is no ordering relation on non-numeric values defined by this specification. Specific applications may define such ordering relations on specific feature tags, but such definitions are beyond the scope of (and not required for conformance to) this specification.

小于和大于测试可使用非数字的特征值执行,但通常,它们相当于相等测试,因为本规范定义的非数字值没有排序关系。特定应用程序可在特定特征标签上定义此类排序关系,但此类定义超出本规范的范围(且不要求符合本规范)。

4.2.3 Feature tags
4.2.3 特征标记

Feature tags conform to the syntax given in "Media Feature Tag Registration Procedure" [3]. Feature tags used to describe capabilities should be registered using the procedures described in that memo. Unregistered feature tags should be allocated in the "URI tree", as discussed in the media feature registration procedures memo [3].

功能标签符合“媒体功能标签注册程序”[3]中给出的语法。用于描述功能的功能标签应使用该备忘录中描述的程序进行注册。未注册的功能标签应在“URI树”中分配,如媒体功能注册程序备忘录[3]中所述。

If an unrecognized feature tag is encountered in the course of feature set predicate processing, it should be still be processed as a legitimate feature tag. The feature set matching rules are designed to allow new feature tags to be introduced without affecting the validity of existing capability assertions.

如果在要素集谓词处理过程中遇到无法识别的要素标记,则仍应将其作为合法要素标记进行处理。功能集匹配规则旨在允许引入新的功能标记,而不会影响现有功能断言的有效性。

4.2.4 Feature values
4.2.4 特征值

A feature may have a number, Boolean, token or string value.

特征可以有数字、布尔值、标记或字符串值。

4.2.4.1 Boolean values
4.2.4.1 布尔值

A Boolean is simply a token with two predefined values: "TRUE" and "FALSE". (Upper- or lower- case letters may be used in any combination.)

布尔值只是一个具有两个预定义值的标记:“TRUE”和“FALSE”。(大写或小写字母可用于任何组合。)

4.2.4.2 Numeric values
4.2.4.2 数值

A numeric value is either a decimal integer, optionally preceded by a "+" or "-" sign, or rational number.

数值可以是十进制整数,也可以前面加“+”或“-”号,也可以是有理数。

A rational number is expressed as "n/m", optionally preceded by a "+" or "-" sign. The "n" and "m" are unsigned decimal integers, and the value represented by "n/m" is "n" divided by "m". Thus, the following are all valid representations of the number 1.5:

有理数表示为“n/m”,可以选择前面加“+”或“-”号。“n”和“m”是无符号十进制整数,“n/m”表示的值是“n”除以“m”。因此,以下是数字1.5的所有有效表示:

3/2 +15/10 600/400

3/2 +15/10 600/400

Thus, several rational number forms may express the same value. A canonical form of rational number is obtained by finding the highest common factor of "n" and "m", and dividing both "n" and "m" by that value.

因此,几个有理数形式可以表示相同的值。通过找到“n”和“m”的最高公因式,并将“n”和“m”除以该值,即可得到有理数的标准形式。

A simple integer value may be used anywhere in place of a rational number. Thus, we have:

一个简单的整数值可以用来代替有理数。因此,我们:

+5 is equivalent to +5/1 or +50/10, etc. -2 is equivalent to -2/1 or -4/2, etc.

+5相当于+5/1或+50/10等-2相当于-2/1或-4/2等。

Any sign in a rational number must precede the entire number, so the following are not valid rational numbers:

有理数中的任何符号都必须位于整数之前,因此以下是无效的有理数:

      3/+2, 15/-10      (**NOT VALID**)
        
      3/+2, 15/-10      (**NOT VALID**)
        
4.2.4.3 Token values
4.2.4.3 标记值

A token value is any sequence of letters, digits and '-' characters that conforms to the syntax for 'token' given above. It is a name that stands for some (unspecified) value.

标记值是符合上述“标记”语法的字母、数字和“-”字符序列。它是代表某个(未指定)值的名称。

4.2.4.4 String values
4.2.4.4 字符串值

A string value is any sequence of characters enclosed in double quotes that conform to the syntax for 'string' given above.

字符串值是包含在双引号中的任何字符序列,符合上述“字符串”的语法。

The semantics of string defined by this memo are the same as those for a token value. But a string allows a far greater variety of internal formats, and specific applications may choose to interpret the content in ways that go beyond those given here. Where such interpretation is possible, the allowed string formats and the corresponding interpretations should be indicated in the media feature registration (per RFC 2506 [3]).

此备忘录定义的字符串的语义与令牌值的语义相同。但是字符串允许更多种类的内部格式,特定的应用程序可以选择以超出这里给出的方式来解释内容。如果可以进行此类解释,则应在媒体功能注册中注明允许的字符串格式和相应的解释(根据RFC 2506[3])。

4.2.5 Notational conveniences
4.2.5 符号便利

The 'set' option of the syntax production for 'item' is simply a shorthand notation for some common situations that can be expressed using 'simple' constructs. Occurrences of 'set' items can eliminated by applying the following identities:

“item”的语法生成的“set”选项只是一些常见情况的简写符号,可以使用“simple”结构表示。通过应用以下标识可以消除“集合”项的出现:

      T = [ E1, E2, ... En ]  -->  (| (T=[E1]) (T=[E2]) ... (T=[En]) )
      (T=[R1..R2])            -->  (& (T>=R1) (T<=R2) )
      (T=[E])                 -->  (T=E)
        
      T = [ E1, E2, ... En ]  -->  (| (T=[E1]) (T=[E2]) ... (T=[En]) )
      (T=[R1..R2])            -->  (& (T>=R1) (T<=R2) )
      (T=[E])                 -->  (T=E)
        

Examples:

示例:

The expression: ( paper-size=[A4,B4] ) can be used to express a capability to print documents on either A4 or B4 sized paper.

表达式:(纸张大小=[A4,B4])可用于表示在A4或B4大小的纸张上打印文档的能力。

The expression: ( width=[4..17/2] ) might be used to express a capability to print documents that are anywhere between 4 and 8.5 inches wide.

表达式:(width=[4..17/2])可用于表示打印宽度在4到8.5英寸之间的文档的能力。

The set construct is designed so that enumerated values and ranges can be combined in a single expression, e.g.: ( width=[3,4,6..17/2] )

集合构造的设计使枚举值和范围可以组合在单个表达式中,例如:(宽度=[3,4,6..17/2])

4.3 Feature set definition example
4.3 要素集定义示例

The following is an example of a feature predicate that describes a number of image size and resolution combinations, presuming the registration and use of 'Pix-x', 'Pix-y', 'Res-x' and 'Res-y' feature tags:

以下是一个特征谓词示例,它描述了许多图像大小和分辨率组合,假定“Pix-x”、“Pix-y”、“Res-x”和“Res-y”特征标记的注册和使用:

(| (& (Pix-x=1024)

(|)(&(Pix-x=1024)

            (Pix-y=768)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) )
         (& (Pix-x=800)
            (Pix-y=600)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) ) ;q=0.9
         (& (Pix-x=640)
            (Pix-y=480)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) ) ;q=0.8 )
        
            (Pix-y=768)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) )
         (& (Pix-x=800)
            (Pix-y=600)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) ) ;q=0.9
         (& (Pix-x=640)
            (Pix-y=480)
            (| (& (Res-x=150) (Res-y=150) )
               (& (Res-x=150) (Res-y=300) )
               (& (Res-x=300) (Res-y=300) )
               (& (Res-x=300) (Res-y=600) )
               (& (Res-x=600) (Res-y=600) ) ) ) ;q=0.8 )
        
5. Matching feature sets
5. 匹配特征集

This section presents a procedure for combining feature sets to determine the common feature collections to which they refer, if there are any. Making a selection from the possible feature collections (based on q-values or otherwise) is not covered here.

本节介绍了组合要素集的过程,以确定它们所引用的公共要素集(如果有)。此处不包括从可能的特征集合(基于q值或其他)中进行选择。

Matching a feature set to some given feature collection is essentially very straightforward: the feature set predicate is simply evaluated for the given feature collection, and the result (TRUE or FALSE) indicates whether the feature collection matches the capabilities, and the associated quality value can be used for selecting among alternative feature collections.

将要素集与某个给定要素集合相匹配本质上非常简单:只需对给定要素集合计算要素集谓词,结果(TRUE或FALSE)指示要素集合是否与功能匹配,关联的质量值可用于在备选特征集合中进行选择。

Matching a feature set to some other feature set is less straightforward. Here, the problem is to determine whether or not there is at least one feature collection that matches both feature sets (e.g. is there an overlap between the feature capabilities of a given file format and the feature capabilities of a given recipient?)

将一个功能集与其他功能集进行匹配并不那么简单。这里的问题是确定是否至少有一个特征集合与两个特征集匹配(例如,给定文件格式的特征功能与给定收件人的特征功能之间是否存在重叠?)

This feature set matching is accomplished by logical manipulation of the predicate expressions as described in the following sub-sections.

此功能集匹配是通过对谓词表达式进行逻辑操作来完成的,如以下小节所述。

For this procedure to work reliably, the predicates must be reduced to a canonical form. The canonical form used here is "disjunctive normal form". A syntax for disjunctive normal form is:

为了使该过程可靠地工作,必须将谓词简化为规范形式。这里使用的标准形式是“析取范式”。析取范式的语法为:

      filter     =  orlist
      orlist     =  "(" "|" andlist ")" / term
      andlist    =  "(" "&" termlist ")" / term
      termlist   =  1*term
      term       =  "(" "!" simple ")" / simple
        
      filter     =  orlist
      orlist     =  "(" "|" andlist ")" / term
      andlist    =  "(" "&" termlist ")" / term
      termlist   =  1*term
      term       =  "(" "!" simple ")" / simple
        

where "simple" is as described previously in section 4.1. Thus, the canonicalized form has at most three levels: an outermost "(|...)" disjunction of "(&...)" conjunctions of possibly negated feature value tests.

其中“简单”如前文第4.1节所述。因此,规范化形式最多有三个层次:可能被否定的特征值测试的最外层“(|…)”连接的析取。

NOTE: The usual canonical form for predicate expressions is "clausal form". Procedures for converting general predicate expressions are given in [5] (section 10.2), [11] (section 2.13) and [12] (section 5.3.2).

注:谓词表达式通常的规范形式是“子句形式”。[5](第10.2节)、[11](第2.13节)和[12](第5.3.2节)中给出了转换一般谓词表达式的程序。

"Clausal form" for a predicate is similar to "conjunctive normal form" for a proposition, being a conjunction (logical AND) of disjunctions (logical ORs). The related form used here, better suited to feature set matching, is "disjunctive normal form", which is a logical disjunction (OR) of conjunctions (ANDs). In this form, the aim of feature set matching is to show that at least one of the disjunctions can be satisfied by some feature collection.

谓词的“从句形式”类似于命题的“合取范式”,是析取(逻辑OR)的合取(逻辑AND)。这里使用的更适合于特征集匹配的相关形式是“析取范式”,它是连接词(AND)的逻辑析取(OR)。在这种形式中,特征集匹配的目的是表明某些特征集合至少可以满足一个析取。

Is this consideration of canonical forms really required? After all, the feature predicates are just Boolean expressions, aren't they? Well, no: a feature predicate is a Boolean expression containing primitive feature value tests (comparisons), represented by 'item' in the feature predicate syntax. If these tests could all be assumed to be independently TRUE or FALSE, then each could be regarded as an atomic proposition, and the whole predicate could be dealt with according to the (relatively simple) rules of Propositional Calculus.

真的需要考虑规范形式吗?毕竟,特征谓词只是布尔表达式,不是吗?否:特征谓词是一个布尔表达式,包含基本特征值测试(比较),在特征谓词语法中用“item”表示。如果这些测试都可以独立地假设为真或假,那么每个测试都可以被视为一个原子命题,整个谓词可以根据命题演算的(相对简单的)规则来处理。

But, in general, the same feature tag may appear in more than one predicate 'item', so the tests cannot be regarded as independent. Indeed, interdependence is needed in any meaningful application of feature set matching, and it is important to capture these dependencies (e.g. does the set of resolutions that a sender can supply overlap the set of resolutions that a recipient can handle?). Thus, we have to deal with elements of the Predicate Calculus, with some additional rules for algebraic manipulation.

但是,一般来说,相同的特征标记可能出现在多个谓词“item”中,因此测试不能被视为独立的。事实上,在任何有意义的功能集匹配应用中都需要相互依赖性,捕获这些依赖性非常重要(例如,发送方可以提供的一组解决方案是否与接收方可以处理的一组解决方案重叠?)。因此,我们必须处理谓词演算的元素,以及一些用于代数操作的附加规则。

A description of both the Propositional and Predicate calculi can be found in [12].

关于命题运算和谓词运算的描述见[12]。

We aim to show that these additional rules are more unfamiliar than complicated. The construction and use of feature predicates actually avoids some of the complexity of dealing with fully-generalized Predicate Calculus.

我们的目的是证明这些额外的规则是不熟悉的,而不是复杂的。特征谓词的构造和使用实际上避免了处理完全广义谓词演算的一些复杂性。

5.1 Feature set matching strategy
5.1 特征集匹配策略

The overall strategy for matching feature sets, expanded below, is:

匹配特征集的总体策略如下所述:

1. Formulate the feature set match hypothesis.

1. 制定特征集匹配假设。

2. Replace "set" expressions with equivalent comparisons.

2. 用等效比较替换“set”表达式。

3. Move logical negations "inwards", so that they are all applied directly to feature comparisons.

3. 将逻辑否定“向内”移动,以便它们都直接应用于特征比较。

4. Eliminate logical negations, and express all feature comparisons in terms of just four comparison operators

4. 消除逻辑否定,并仅用四个比较运算符表示所有特征比较

5. Reduce the hypothesis to canonical disjunctive normal form (a disjunction of conjunctions).

5. 将假设简化为标准析取范式(连接的析取)。

6. For each of the conjunctions, attempt to show that it can be satisfied by some feature collection.

6. 对于每个连接,尝试显示某些特征集合可以满足它。

6.1 Separate the feature value tests into independent feature groups, such that each group contains tests involving just one feature tag. Thus, no predicate in a feature group contains a feature tag that also appears in some other group.

6.1 将特征值测试分离为独立的特征组,以便每个组包含仅涉及一个特征标记的测试。因此,要素组中没有谓词包含也出现在其他组中的要素标记。

6.2 For each feature group, merge the various constraints to a minimum form. This process either yields a reduced expression for the allowable range of feature values, or an expression containing the value FALSE, which is an indication that no combination of feature values can satisfy the constraints (in which case the corresponding conjunction can never be satisfied).

6.2 对于每个要素组,将各种约束合并为最小形式。该过程要么生成特征值允许范围的缩减表达式,要么生成包含值FALSE的表达式,这表示没有特征值的组合可以满足约束(在这种情况下,无法满足相应的连接)。

7. If the remaining disjunction contains at least one satisfiable conjunction, then the constraints are shown to be satisfiable.

7. 如果剩余的析取包含至少一个可满足的合取,则约束将显示为可满足的。

The final expression obtained by this procedure, if it is non-empty, can be used as a statement of the resulting feature set for possible further matching operations. That is, it can be used as a starting point for combining with additional feature set constraint predicate to determine a feature set that is constrained by the capabilities of several entities in a message transfer path.

通过此过程获得的最终表达式(如果它不是空的)可以用作生成的特征集的语句,以进行可能的进一步匹配操作。也就是说,它可以用作与其他功能集约束谓词组合的起点,以确定受消息传输路径中多个实体的功能约束的功能集。

NOTE: as presented, the feature matching process evaluates (and stores) all conjunctions of the disjunctive normal form before combining feature tag comparisons and eliminating unsatisfiable conjunctions. For low-memory systems an alternative approach is possible, in which each normal form conjunction is enumerated and evaluated in turn, with only those that are satisfiable being retained for further use.

注:如前所述,特征匹配过程在组合特征标记比较和消除不可满足的连接之前评估(并存储)析取范式的所有连接。对于低内存系统,另一种方法是可能的,在这种方法中,依次枚举和计算每个正常形式的连接,只保留那些可满足的连接以供进一步使用。

5.2 Formulating the goal predicate
5.2 制定目标谓词

A formal statement of the problem we need to solve can be given as: given two feature set predicates, '(P x)' and '(Q x)', where 'x' is some feature collection, we wish to establish the truth or otherwise of the proposition:

我们需要解决的问题的正式陈述可以如下所示:给定两个特征集谓词,“(px)”和“(qx)”,其中“x”是某个特征集合,我们希望确定命题的真实性或其他方面:

EXISTS(x) : (P x) AND (Q x)

存在(x):(px)和(qx)

i.e. does there exist a feature collection 'x' that satisfies both predicates, 'P' and 'Q'?

i、 是否存在同时满足谓词“P”和“Q”的特征集合“x”?

Then, if feature sets to be matched are described by predicates 'P' and 'Q', the problem is to determine if there is any feature set satisfying the goal predicate:

然后,如果要匹配的特征集由谓词“P”和“Q”描述,则问题在于确定是否有任何特征集满足目标谓词:

(& P Q)

(&P Q)

i.e. to determine whether the set thus described is non-empty.

i、 e.确定这样描述的集合是否为非空。

5.3 Replace set expressions
5.3 替换集合表达式

Replace all "set" instances in the goal predicate with equivalent "simple" forms:

将目标谓词中的所有“set”实例替换为等效的“simple”形式:

      T = [ E1, E2, ... En ]  -->  (| (T=[E1]) (T=[E2]) ... (T=[En]) )
      (T=[R1..R2])            -->  (& (T>=R1) (T<=R2) )
      (T=[E])                 -->  (T=E)
        
      T = [ E1, E2, ... En ]  -->  (| (T=[E1]) (T=[E2]) ... (T=[En]) )
      (T=[R1..R2])            -->  (& (T>=R1) (T<=R2) )
      (T=[E])                 -->  (T=E)
        
5.4 Move logical negations inwards
5.4 向内移动逻辑否定

The goal of this step is to move all logical negations so that they are applied directly to feature comparisons. During the following step, these logical negations are replaced by alternative comparison operators.

此步骤的目标是移动所有逻辑否定,以便将其直接应用于特征比较。在下面的步骤中,这些逻辑否定被替换为可选的比较运算符。

This is achieved by repeated application of the following transformation rules:

这是通过重复应用以下转换规则实现的:

      (! (& A1 A2 ... Am ) )  -->  (| (! A1 ) (! A2 ) ... (! Am ) )
      (! (| A1 A2 ... Am ) )  -->  (& (! A1 ) (! A2 ) ... (! Am ) )
      (! (! A ) )             -->  A
        
      (! (& A1 A2 ... Am ) )  -->  (| (! A1 ) (! A2 ) ... (! Am ) )
      (! (| A1 A2 ... Am ) )  -->  (& (! A1 ) (! A2 ) ... (! Am ) )
      (! (! A ) )             -->  A
        

The first two rules are extended forms of De Morgan's law, and the third is elimination of double negatives.

前两条规则是德摩根定律的扩展形式,第三条规则是消除双重否定。

5.5 Replace comparisons and logical negations
5.5 替换比较和逻辑否定

The predicates are derived from the syntax described previously, and contain primitive value testing functions '=', '<=', '>='. The primitive tests have a number of well known properties that are exploited to reach a useful conclusion; e.g.

谓词源自前面描述的语法,包含基本值测试函数“=”、“<=”、“>=”。原始测试具有许多众所周知的特性,可以利用这些特性得出有用的结论;例如

      (A = B)  & (B = C)  => (A = C)
      (A <= B) & (B <= C) => (A <= C)
        
      (A = B)  & (B = C)  => (A = C)
      (A <= B) & (B <= C) => (A <= C)
        

These rules form a core body of logic statements against which the goal predicate can be evaluated. The form in which these statements are expressed is important to realizing an effective predicate matching algorithm (i.e. one that doesn't loop or fail to find a valid result). The first step in formulating these rules is to simplify the framework of primitive predicates.

这些规则构成了逻辑语句的核心体,可以根据这些逻辑语句对目标谓词进行求值。这些语句的表达形式对于实现有效的谓词匹配算法(即不循环或无法找到有效结果的算法)非常重要。制定这些规则的第一步是简化基本谓词的框架。

The primitive predicates from which feature set definitions are constructed are '=', '<=' and '>='. Observe that, given any pair of feature values, the relationship between them must be exactly one of the following:

构成要素集定义的基本谓词有“=”、“<=”和“>=”。请注意,给定任何一对特征值,它们之间的关系必须正好是以下关系之一:

(LT a b): 'a' is less than 'b'. (EQ a b): 'a' is equal to 'b'. (GT a b): 'a' is greater than 'b'. (NE a b): 'a' is not equal to 'b', and is not less than or greater than 'b'.

(LT a b):“a”小于“b”。(等式a-b):“a”等于“b”。(GT a b):“a”大于“b”。(NE a b):“a”不等于“b”,且不小于或大于“b”。

(The final case arises when two values are compared for which no ordering relationship is defined, and the values are not equal; e.g. two unequal string values.)

(最后一种情况是比较两个未定义排序关系的值,并且这些值不相等;例如,两个不相等的字符串值。)

These four cases can be captured by a pair of primitive predicates:

这四种情况可以由一对基本谓词捕获:

(LE a b): 'a' is less than or equal to 'b'. (GE a b): 'a' is greater than or equal to 'b'.

(LE a b):“a”小于或等于“b”。(GE a b):“a”大于或等于“b”。

The four cases described above are prepresented by the following combinations of primitive predicate values:

上述四种情况由以下原始谓词值组合预先表示:

      (LE a b)   (GE a b) | relationship
      ----------------------------------
         TRUE      FALSE  | (LT a b)
         TRUE       TRUE  | (EQ a b)
        FALSE       TRUE  | (GT a b)
        FALSE      FALSE  | (NE a b)
        
      (LE a b)   (GE a b) | relationship
      ----------------------------------
         TRUE      FALSE  | (LT a b)
         TRUE       TRUE  | (EQ a b)
        FALSE       TRUE  | (GT a b)
        FALSE      FALSE  | (NE a b)
        

Thus, the original 3 primitive tests can be translated to combinations of just LE and GE, reducing the number of additional relationships that must be subsequently captured:

因此,最初的3个基本测试可以转换为LE和GE的组合,从而减少随后必须捕获的其他关系的数量:

      (a <= b)  -->  (LE a b)
      (a >= b)  -->  (GE a b)
      (a = b)   -->  (& (LE a b) (GE a b) )
        
      (a <= b)  -->  (LE a b)
      (a >= b)  -->  (GE a b)
      (a = b)   -->  (& (LE a b) (GE a b) )
        

Further, logical negations of the original 3 primitive tests can be eliminated by the introduction of 'not-greater' and 'not-less' primitives

此外,通过引入“不大于”和“不小于”原语,可以消除原始3个原语测试的逻辑否定

      (NG a b)  ==  (! (GE a b) )
      (NL a b)  ==  (! (LE a b) )
        
      (NG a b)  ==  (! (GE a b) )
      (NL a b)  ==  (! (LE a b) )
        

using the following transformation rules:

使用以下转换规则:

      (! (a = b) )   -->  (| (NL a b) (NG a b) )
      (! (a <= b) )  -->  (NL a b)
      (! (a >= b) )  -->  (NG a b)
        
      (! (a = b) )   -->  (| (NL a b) (NG a b) )
      (! (a <= b) )  -->  (NL a b)
      (! (a >= b) )  -->  (NG a b)
        

Thus, we have rules to transform all comparisons and logical negations into combinations of just 4 relational operators.

因此,我们有规则将所有比较和逻辑否定转换为4个关系运算符的组合。

5.6 Conversion to canonical form
5.6 转换为标准形式

NOTE: Logical negations have been eliminated in the previous step.

注:逻辑否定在上一步中已消除。

Expand bracketed disjunctions, and flatten bracketed conjunctions and disjunctions:

展开带括号的析取,展平带括号的析取和析取:

(& (| A1 A2 ... Am ) B1 B2 ... Bn ) --> (| (& A1 B1 B2 ... Bn ) (& A2 B1 B2 ... Bn ) : (& Am B1 B2 ... Bn ) ) (& (& A1 A2 ... Am ) B1 B2 ... Bn ) --> (& A1 A2 ... Am B1 B2 ... Bn ) (| (| A1 A2 ... Am ) B1 B2 ... Bn ) --> (| A1 A2 ... Am B1 B2 ... Bn )

(&(&(&(&(&)A1 A2…上午)B1 B2…Bn)-->(&(&)A1 A2…上午)B1 B2…Bn)(&(&(&)A1 A2…上午)B1 B2…Bn)-->(&(&(&)A1 A2…上午)B1 B2…Bn)-->(&(&)A1 A2…上午)B1 B2…Bn)

The result is in "disjunctive normal form", a disjunction of conjunctions:

结果是“析取范式”,即连接的析取:

(| (& S11 S12 ... ) (& S21 S22 ... ) : (& Sm1 Sm2 ... Smn ) )

(|)(&S11 S12…(&S21 S22…)(&Sm1 Sm2…Smn))

where the "Sij" elements are simple feature comparison forms constructed during the step at section 5.5. Each term within the top-level "(|...)" construct represents a single possible feature set that satisfies the goal. Note that the order of entries within the top-level '(|...)', and within each '(&...)', is immaterial.

其中,“Sij”元素是在第5.5节的步骤中构造的简单特征比较表格。顶级“(|…)”构造中的每个术语表示满足目标的单个可能特征集。请注意,顶级“(|…)”和每个“(&…)中的条目顺序无关紧要。

From here on, each conjunction '(&...)' is processed separately. Only one of these needs to be satisfiable for the original goal to be satisfiable.

从这里开始,每个连词“(&…”)将分别处理。只有其中一个目标是可满足的,原始目标才是可满足的。

(A textbook conversion to clausal form [5,11] uses slightly different rules to yield a "conjunctive normal form".)

(教科书中的从句形式转换[5,11]使用了稍微不同的规则来生成“连接范式”。)

5.7 Grouping of feature predicates
5.7 特征谓词的分组

NOTE: Remember that from here on, each conjunction is treated separately.

注意:请记住,从这里开始,每个连词都是单独处理的。

Each simple feature predicate contains a "left-hand" feature tag and a "right-hand" feature value with which it is compared.

每个简单的特征谓词都包含一个“左侧”特征标记和一个“右侧”特征值,并与之进行比较。

To arrange these into independent groups, simple predicates are grouped according to their left hand feature tag ('f').

为了将这些谓词排列成独立的组,简单谓词根据其左侧特征标记(“f”)进行分组。

5.8 Merge single-feature constraints
5.8 合并单个要素约束

Within each group, apply the predicate simplification rules given below to eliminate redundant single-feature constraints. All single-feature predicates are reduced to an equality or range constraint on that feature, possibly combined with a number of non-equality statements.

在每个组中,应用下面给出的谓词简化规则以消除冗余的单一特征约束。所有单个特性谓词都被简化为该特性上的相等或范围约束,可能与许多非相等语句结合使用。

If the constraints on any feature are found to be contradictory (i.e. resolved to FALSE according to the applied rules), the containing conjunction is not satisfiable and may be discarded. Otherwise, the resulting description is a minimal form of that particular conjunction of the feature set definition.

如果发现任何特征上的约束相互矛盾(即根据应用的规则解析为FALSE),则包含的连接不可满足,可能会被丢弃。否则,生成的描述是特征集定义的特定连接的最小形式。

5.8.1 Rules for simplifying ordered values
5.8.1 简化有序值的规则

These rules are applicable where there is an ordering relationship between the given values 'a' and 'b':

这些规则适用于给定值“a”和“b”之间存在排序关系的情况:

      (LE f a)  (LE f b)      -->  (LE f a),   a<=b
                                   (LE f b),   otherwise
      (LE f a)  (GE f b)      -->  FALSE,      a<b
      (LE f a)  (NL f b)      -->  FALSE,      a<=b
      (LE f a)  (NG f b)      -->  (LE f a),   a<b
                                   (NG f b),   otherwise
        
      (LE f a)  (LE f b)      -->  (LE f a),   a<=b
                                   (LE f b),   otherwise
      (LE f a)  (GE f b)      -->  FALSE,      a<b
      (LE f a)  (NL f b)      -->  FALSE,      a<=b
      (LE f a)  (NG f b)      -->  (LE f a),   a<b
                                   (NG f b),   otherwise
        
      (GE f a)  (GE f b)      -->  (GE f a),   a>=b
                                   (GE f b),   otherwise
      (GE f a)  (NL f b)      -->  (GE f a)    a>b
                                   (NL f b),   otherwise
      (GE f a)  (NG f b)      -->  FALSE,      a>=b
        
      (GE f a)  (GE f b)      -->  (GE f a),   a>=b
                                   (GE f b),   otherwise
      (GE f a)  (NL f b)      -->  (GE f a)    a>b
                                   (NL f b),   otherwise
      (GE f a)  (NG f b)      -->  FALSE,      a>=b
        
      (NL f a)  (NL f b)      -->  (NL f a),   a>=b
                                   (NL f b),   otherwise
      (NL f a)  (NG f b)      -->  FALSE,      a>=b
        
      (NL f a)  (NL f b)      -->  (NL f a),   a>=b
                                   (NL f b),   otherwise
      (NL f a)  (NG f b)      -->  FALSE,      a>=b
        
      (NG f a)  (NG f b)      -->  (NG f a),   a<=b
                                   (NG f b),   otherwise
        
      (NG f a)  (NG f b)      -->  (NG f a),   a<=b
                                   (NG f b),   otherwise
        
5.8.2 Rules for simplifying unordered values
5.8.2 简化无序值的规则

These rules are applicable where there is no ordering relationship applicable to the given values 'a' and 'b':

这些规则适用于没有适用于给定值“a”和“b”的排序关系的情况:

      (LE f a)  (LE f b)      -->  (LE f a),   a=b
                                   FALSE,      otherwise
      (LE f a)  (GE f b)      -->  FALSE,      a!=b
      (LE f a)  (NL f b)      -->  (LE f a)    a!=b
                                   FALSE,      otherwise
      (LE f a)  (NG f b)      -->  (LE f a),   a!=b
                                   FALSE,      otherwise
        
      (LE f a)  (LE f b)      -->  (LE f a),   a=b
                                   FALSE,      otherwise
      (LE f a)  (GE f b)      -->  FALSE,      a!=b
      (LE f a)  (NL f b)      -->  (LE f a)    a!=b
                                   FALSE,      otherwise
      (LE f a)  (NG f b)      -->  (LE f a),   a!=b
                                   FALSE,      otherwise
        
      (GE f a)  (GE f b)      -->  (GE f a),   a=b
                                   FALSE,      otherwise
      (GE f a)  (NL f b)      -->  (GE f a)    a!=b
                                   FALSE,      otherwise
      (GE f a)  (NG f b)      -->  (GE f a)    a!=b
                                   FALSE,      otherwise
        
      (GE f a)  (GE f b)      -->  (GE f a),   a=b
                                   FALSE,      otherwise
      (GE f a)  (NL f b)      -->  (GE f a)    a!=b
                                   FALSE,      otherwise
      (GE f a)  (NG f b)      -->  (GE f a)    a!=b
                                   FALSE,      otherwise
        
      (NL f a)  (NL f b)      -->  (NL f a),   a=b
      (NL f a)  (NG f b)      -->  (NL f a),   a=b
        
      (NL f a)  (NL f b)      -->  (NL f a),   a=b
      (NL f a)  (NG f b)      -->  (NL f a),   a=b
        
      (NG f a)  (NG f b)      -->  (NG f a),   a=b
        
      (NG f a)  (NG f b)      -->  (NG f a),   a=b
        
6. Other features and issues
6. 其他特点和问题
6.1 Named and auxiliary predicates
6.1 命名谓词和辅助谓词

Named and auxiliary predicates can serve two purposes:

命名谓词和辅助谓词可用于两个目的:

(a) making complex predicates easier to write and understand, and

(a) 使复杂谓词更易于编写和理解,以及

(b) providing a possible basis for naming and registering feature sets.

(b) 为命名和注册要素集提供可能的基础。

6.1.1 Defining a named predicate
6.1.1 定义命名谓词

A named predicate definition has the following form:

命名谓词定义具有以下形式:

      named-pred =  "(" fname *pname ")" ":-" filter
      fname      =  ftag        ; Feature predicate name
      pname      =  token       ; Formal parameter name
        
      named-pred =  "(" fname *pname ")" ":-" filter
      fname      =  ftag        ; Feature predicate name
      pname      =  token       ; Formal parameter name
        

'fname' is the name of the predicate.

“fname”是谓词的名称。

'pname' is the name of a formal parameter which may appear in the predicate body, and which is replaced by some supplied value when the predicate is invoked.

“pname”是一个可能出现在谓词体中的形式参数的名称,在调用谓词时,它会被提供的值替换。

'filter' is the predicate body. It may contain references to the formal parameters, and may also contain references to feature tags and other values defined in the environment in which the predicate is invoked. References to formal parameters may appear anywhere where a reference to a feature tag ('ftag') is permitted by the syntax for ' filter'.

“filter”是谓词体。它可能包含对形式参数的引用,也可能包含对特征标记和在调用谓词的环境中定义的其他值的引用。对形式参数的引用可能出现在“过滤器”语法允许引用特征标记(“ftag”)的任何地方。

The only specific mechanism defined by this memo for introducing a named predicate into a feature set definition is the "auxiliary predicate" described later. Specific negotiating protocols or other specifications may define other mechanisms.

本备忘录定义的将命名谓词引入功能集定义的唯一特定机制是后面描述的“辅助谓词”。具体的谈判协议或其他规范可以定义其他机制。

NOTE: There has been some suggestion of creating a registry for feature sets as well as individual feature values. Such a registry might be used to introduce named predicates corresponding to these feature sets into the environment of a capability assertion. Further discussion of this idea is beyond the scope of this memo.

注意:有人建议为要素集和单个要素值创建注册表。这样的注册表可用于将与这些功能集对应的命名谓词引入到功能断言的环境中。对这一想法的进一步讨论超出了本备忘录的范围。

6.1.2 Invoking named predicates
6.1.2 调用命名谓词

Assuming a named predicate has been introduced into the environment of some other predicate, it can be invoked by a filter 'ext-pred' of the form:

假设已将命名谓词引入其他谓词的环境中,则可通过以下形式的筛选器“ext pred”调用该谓词:

ext-pred = fname *param param = expr

ext pred=fname*param param=expr

The number of parameters must match the definition of the named predicate that is invoked.

参数的数量必须与调用的命名谓词的定义匹配。

6.1.3 Auxiliary predicates in a filter
6.1.3 过滤器中的辅助谓词

A auxiliary predicate is attached to a filter definition by the following extension to the "filter" syntax:

辅助谓词通过对“过滤器”语法的以下扩展附加到过滤器定义:

      filter     =/ "(" filtercomp *( ";" parameter ) ")"
                    "where" 1*( named-pred ) "end"
        
      filter     =/ "(" filtercomp *( ";" parameter ) ")"
                    "where" 1*( named-pred ) "end"
        

The named predicates introduced by "named-pred" are visible from the body of the "filtercomp" of the filter to which they are attached, but are not visible from each other. They all have access to the same environment as "filter", plus their own formal parameters. (Normal scoping rules apply: a formal parameter with the same name as a value in the environment of "filter" effectively hides the environment value from the body of the predicate to which it applies.)

“named pred”引入的命名谓词在其所连接的过滤器的“filtercomp”主体中可见,但彼此之间不可见。它们都可以访问与“过滤器”相同的环境,以及它们自己的形式参数。(应用常规范围规则:与“filter”环境中的值同名的形式参数有效地将环境值隐藏在其应用的谓词体中。)

NOTE: Recursive predicates are not permitted. The scoping rules should ensure this.

注意:不允许使用递归谓词。范围界定规则应确保这一点。

6.1.4 Feature matching with named predicates
6.1.4 与命名谓词的特征匹配

The preceding procedures can be extended to deal with named predicates simply by instantiating (i.e. substituting) the predicates wherever they are invoked, before performing the conversion to disjunctive normal form. In the absence of recursive predicates, this procedure is guaranteed to terminate.

在执行到析取范式的转换之前,只需实例化(即替换)调用的谓词,就可以扩展前面的过程来处理命名谓词。在没有递归谓词的情况下,此过程保证终止。

When substituting the body of a precdicate at its point of invocation, instances of formal parameters within the predicate body must be replaced by the corresponding actual parameter from the point of invocation.

在调用点替换predicate的主体时,谓词主体中形式参数的实例必须替换为调用点对应的实际参数。

6.1.5 Example
6.1.5 实例

This example restates that given in section 4.3 using an auxiliary predicate named 'Res':

此示例使用名为“Res”的辅助谓词重申了第4.3节中给出的内容:

      (| (& (Pix-x=1024) (Pix-y=768) (Res Res-x Res-y) )
         (& (Pix-x=800)  (Pix-y=600) (Res Res-x Res-y) );q=0.9
         (& (Pix-x=640)  (Pix-y=480) (Res Res-x Res-y) );q=0.8 )
      where
      (Res Res-x Res-y) :-
         (| (& (Res-x=150) (Res-y=150) )
            (& (Res-x=150) (Res-y=300) )
            (& (Res-x=300) (Res-y=300) )
            (& (Res-x=300) (Res-y=600) )
            (& (Res-x=600) (Res-y=600) ) )
      end
        
      (| (& (Pix-x=1024) (Pix-y=768) (Res Res-x Res-y) )
         (& (Pix-x=800)  (Pix-y=600) (Res Res-x Res-y) );q=0.9
         (& (Pix-x=640)  (Pix-y=480) (Res Res-x Res-y) );q=0.8 )
      where
      (Res Res-x Res-y) :-
         (| (& (Res-x=150) (Res-y=150) )
            (& (Res-x=150) (Res-y=300) )
            (& (Res-x=300) (Res-y=300) )
            (& (Res-x=300) (Res-y=600) )
            (& (Res-x=600) (Res-y=600) ) )
      end
        

Note that the formal parameters of "Res", "Res-x" and "Res-y", prevent the body of the named predicate from referencing similarly-named feature values.

请注意,“Res”、“Res-x”和“Res-y”的形式参数阻止命名谓词的主体引用类似命名的特征值。

6.2 Unit designations
6.2 单位名称

In some exceptional cases, there may be differing conventions for the units of measurement of a given feature. For example, resolution is commonly expressed as dots per inch (dpi) or dots per centimetre (dpcm) in different applications (e.g. printing vs faxing).

在某些例外情况下,给定特征的测量单位可能有不同的约定。例如,在不同的应用(例如打印与传真)中,分辨率通常表示为每英寸点数(dpi)或每厘米点数(dpcm)。

In such cases, a unit designator may be appended to a feature value according to the conventions indicated below (see also [3]). These considerations apply only to features with numeric values.

在这种情况下,可根据以下规定(另见[3])将单位指示符附加到特征值。这些注意事项仅适用于具有数值的要素。

Every feature tag has a standard unit of measurement. Any expression of a feature value that uses this unit is given without a unit designation -- this is the normal case. When the feature value is expressed in some other unit, a unit designator is appended to the numeric feature value.

每个特征标记都有一个标准的度量单位。任何使用此单位的特征值表达式都没有单位名称——这是正常情况。当特征值以其他单位表示时,将在数字特征值后附加一个单位指示符。

The registration of a feature tag indicates the standard unit of measurement for a feature, and also any alternate units and corresponding unit designators that may be used, according to RFC 2506 [3].

根据RFC 2506[3],特征标签的注册表示特征的标准测量单位,以及可能使用的任何替代单位和相应的单位标识符。

Thus, if the standard unit of measure for resolution is 'dpcm', then the feature predicate '(res=200)' would be used to indicate a resolution of 200 dots-per-centimetre, and '(res=72dpi)' might be used to indicate 72 dots-per-inch.

因此,如果分辨率的标准测量单位为“dpcm”,则特征谓词“(res=200)”将用于指示每厘米200点的分辨率,“(res=72dpi)”可能用于指示每英寸72点。

Unit designators are accommodated by the following extension to the feature predicate syntax:

单元标识符由以下特征谓词语法扩展提供:

      fvalue     =/ number *WSP token
        
      fvalue     =/ number *WSP token
        

When performing feature set matching, feature comparisons with and without unit designators, or feature comparisons with different unit designators, are treated as if they were different features. Thus, the feature predicate '(res=200)' would not, in general, fail to match with the predicate '(res=200dpi)'.

在执行要素集匹配时,使用和不使用单元代号的要素比较,或使用不同单元代号的要素比较,将被视为是不同的要素。因此,特征谓词(res=200)通常不会与谓词(res=200dpi)不匹配。

NOTE: A protocol processor with specific knowledge of the feature and units concerned might recognize the relationship between the feature predicates in the above example, and fail to match these predicates.

注意:具有特定功能和相关单元知识的协议处理器可能会识别上述示例中功能谓词之间的关系,并且无法匹配这些谓词。

This appears to be a natural behaviour in this simple example, but can cause additional complexity in more general cases. Accordingly, this is not considered to be required or normal behaviour. It is presumed that an application concerned will ensure consistent feature processing by adopting a consistent unit for any given feature.

在这个简单的示例中,这似乎是一种自然行为,但在更一般的情况下可能会导致额外的复杂性。因此,这不被认为是必需的或正常的行为。假定相关应用程序将通过对任何给定特征采用一致的单元来确保一致的特征处理。

6.3 Unknown feature value data types
6.3 未知特征值数据类型

This memo has dealt with feature values that have well-understood comparison properties: numbers, with equality, less-than, greater-than relationships, and other values with equality relationships only.

本备忘录处理的特征值具有充分理解的比较属性:数字、相等、小于、大于关系,以及其他仅具有相等关系的值。

Some feature values may have comparison operations that are not covered by this framework. For example, strings containing multi-part version numbers: "x.y.z". Such feature comparisons are not covered by this memo.

某些特征值可能具有本框架未涵盖的比较操作。例如,包含多部分版本号的字符串:“x.y.z”。本备忘录不包括此类功能比较。

Specific applications may recognize and process feature tags that are associated with such values. Future work may define ways to introduce new feature value data types in a way that allows them to be used by applications that do not contain built-in knowledge of their properties.

特定应用程序可以识别和处理与这些值相关联的特征标记。未来的工作可能会定义引入新特征值数据类型的方法,以允许不包含其属性内置知识的应用程序使用这些数据类型。

7. Examples and additional comments
7. 示例和补充意见
7.1 Worked example
7.1 工作实例

This example considers sending a document to a high-end black-and-white fax system with the following receiver capabilities:

此示例考虑将文档发送到具有以下接收器功能的高端黑白传真系统:

(& (dpi=[200,300]) (grey=2) (color=0) (image-coding=[MH,MR]) )

(&(dpi=[200300])(灰色=2)(颜色=0)(图像编码=[MH,MR]))

Turning to the document itself, assume it is available to the sender in three possible formats, A4 high resolution, B4 low resolution and A4 high resolution colour, described by:

关于文档本身,假设发送方可以使用三种可能的格式,A4高分辨率、B4低分辨率和A4高分辨率颜色,如下所述:

(& (dpi=300) (grey=2) (image-coding=MR) )

(&(dpi=300)(灰色=2)(图像编码=MR))

(& (dpi=200) (grey=2) (image-coding=[MH,MMR]) )

(&(dpi=200)(灰色=2)(图像编码=[MH,MMR]))

      (& (dpi=300) (dpi-xyratio=1)
         (color<=256)
         (image-coding=JPEG) )
        
      (& (dpi=300) (dpi-xyratio=1)
         (color<=256)
         (image-coding=JPEG) )
        

These three image formats can be combined into a composite capability statement by a logical-OR operation (to describe format-1 OR format-2 OR format-3):

这三种图像格式可以通过逻辑OR操作组合成一个复合功能语句(用于描述格式1、格式2或格式3):

(| (& (dpi=300) (grey=2) (image-coding=MR) ) (& (dpi=200) (grey=2) (image-coding=[MH,MMR]) ) (& (dpi=300) (color<=256) (image-coding=JPEG) ) )

(|)(&(dpi=300)(灰色=2)(图像编码=MR))(&(dpi=200)(灰色=2)(图像编码=MH,MMR])(&(dpi=300)(颜色<=256)(图像编码=JPEG)))

The composite document description can be matched with the receiver capability description by combining the capability descriptions with a logical AND operation:

通过将能力描述与逻辑AND操作相结合,复合文档描述可以与接收方能力描述相匹配:

(& (& (dpi=[200,300]) (grey=2) (color=0) (image-coding=[MH,MR]) ) (| (& (dpi=300) (grey=2) (image-coding=MR) ) (& (dpi=200) (grey=2) (image-coding=[MH,MMR]) ) (& (dpi=300)

(&(&(&(dpi=[200300])(灰色=2)(颜色=0)(图像编码=[MH,MR]))(&(&(dpi=300)(灰色=2)(图像编码=MR))(&(dpi=200)(灰色=2)(图像编码=[MH,MMR])(&(dpi=300)

               (color<=256)
               (image-coding=JPEG) ) ) )
        
               (color<=256)
               (image-coding=JPEG) ) ) )
        

--> Expand value-set notation:

-->展开值集表示法:

      (& (& (| (dpi=200) (dpi=300) )
            (grey=2) (color=0)
            (| (image-coding=MH) (image-coding=MR) ) )
         (| (& (dpi=300)
               (grey=2)
               (image-coding=MR) )
            (& (dpi=200)
               (grey=2)
               (| (image-coding=MH) (image-coding=MMR) ) )
            (& (dpi=300)
               (color<=256)
               (image-coding=JPEG) ) ) )
        
      (& (& (| (dpi=200) (dpi=300) )
            (grey=2) (color=0)
            (| (image-coding=MH) (image-coding=MR) ) )
         (| (& (dpi=300)
               (grey=2)
               (image-coding=MR) )
            (& (dpi=200)
               (grey=2)
               (| (image-coding=MH) (image-coding=MMR) ) )
            (& (dpi=300)
               (color<=256)
               (image-coding=JPEG) ) ) )
        

--> Flatten nested '(&...)':

-->展平嵌套的“(&…”:

      (& (| (dpi=200) (dpi=300) )
         (grey=2) (color=0)
         (| (image-coding=MH) (image-coding=MR) )
         (| (& (dpi=300)
               (grey=2)
               (image-coding=MR) )
            (& (dpi=200)
               (grey=2)
               (| (image-coding=MH) (image-coding=MMR) ) )
            (& (dpi=300)
               (color<=256)
               (image-coding=JPEG) ) ) )
        
      (& (| (dpi=200) (dpi=300) )
         (grey=2) (color=0)
         (| (image-coding=MH) (image-coding=MR) )
         (| (& (dpi=300)
               (grey=2)
               (image-coding=MR) )
            (& (dpi=200)
               (grey=2)
               (| (image-coding=MH) (image-coding=MMR) ) )
            (& (dpi=300)
               (color<=256)
               (image-coding=JPEG) ) ) )
        

--> (distribute '(&...)' over inner '(|...)'):

-->(将“(&…”分布在内部“(|…)”上):

      (& (| (dpi=200) (dpi=300) )
         (grey=2) (color=0)
         (| (image-coding=MH) (image-coding=MR) )
         (| (& (dpi=300) (grey=2) (image-coding=MR) )
            (& (dpi=200) (grey=2) (image-coding=MH) )
            (& (dpi=200) (grey=2) (image-coding=MMR) )
            (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
        
      (& (| (dpi=200) (dpi=300) )
         (grey=2) (color=0)
         (| (image-coding=MH) (image-coding=MR) )
         (| (& (dpi=300) (grey=2) (image-coding=MR) )
            (& (dpi=200) (grey=2) (image-coding=MH) )
            (& (dpi=200) (grey=2) (image-coding=MMR) )
            (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
        

--> continue to distribute '(&...)' over '(|...)', and flattening nested '(&...)' and '(|...)' ...:

-->继续将“(&…”分布在“(|…)”上,并展平嵌套的“(&…”和“(|…)”…:

      (| (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
        
      (| (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
        
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) ) )
        
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (| (& (dpi=300) (grey=2) (image-coding=MR) )
               (& (dpi=200) (grey=2) (image-coding=MH) )
               (& (dpi=200) (grey=2) (image-coding=MMR) )
               (& (dpi=300) (color<=256) (image-coding=JPEG) ) ) ) )
        

--> ... until normal form is achieved:

--> ... 在达到标准形式之前:

      (| (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
        
      (| (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (grey=2) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MH) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=200) (grey=2) (image-coding=MMR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MR)
        
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (color<=256) (image-coding=JPEG) ) )
        
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MH)
            (dpi=300) (color<=256) (image-coding=JPEG) ) ) )
         (& (dpi=300) (grey=2) (color=0) (image-coding=MR)
            (dpi=300) (color<=256) (image-coding=JPEG) ) )
        

--> Group terms in each conjunction by feature tag:

-->按要素标记对每个连词中的术语进行分组:

      (| (& (dpi=200) (dpi=300) (grey=2) (grey=2) (color=0)
            (image-coding=MH) (image-coding=MR) )
         (& (dpi=200) (dpi=300) (grey=2) (grey=2) (color=0)
            (image-coding=MR) (image-coding=MR) )
             :
            (etc.)
             :
         (& (dpi=300) (dpi=300) (grey=2) (color=0) (color<=256)
            (image-coding=MR) (image-coding=JPEG) ) )
        
      (| (& (dpi=200) (dpi=300) (grey=2) (grey=2) (color=0)
            (image-coding=MH) (image-coding=MR) )
         (& (dpi=200) (dpi=300) (grey=2) (grey=2) (color=0)
            (image-coding=MR) (image-coding=MR) )
             :
            (etc.)
             :
         (& (dpi=300) (dpi=300) (grey=2) (color=0) (color<=256)
            (image-coding=MR) (image-coding=JPEG) ) )
        

--> Combine feature tag comparisons and eliminate unsatisfiable conjunctions:

-->组合要素标记比较并消除不满意的连词:

      (| (& (dpi=300) (grey=2) (color=0) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH) ) )
        
      (| (& (dpi=300) (grey=2) (color=0) (image-coding=MR) )
         (& (dpi=200) (grey=2) (color=0) (image-coding=MH) ) )
        

Thus, we see that this combination of sender and receiver options can transfer a bi-level image, either at 300dpi using MR coding, or at 200dpi using MH coding.

因此,我们看到发送方和接收方选项的这种组合可以传输双层图像,或者使用MR编码以300dpi传输,或者使用MH编码以200dpi传输。

Points to note about the feature matching process:

有关特征匹配过程的注意事项:

o The colour document option is eliminated because the receiver cannot handle either colour (indicated by '(color=0)') or JPEG coding.

o 由于接收器无法处理颜色(由“(颜色=0)”表示)或JPEG编码,因此取消了彩色文档选项。

o The high resolution version of the document with '(dpi=300)' must be sent using '(image-coding=MR)' because this is the only available coding of the image data that the receiver can use for high resolution documents. (The available 300dpi document codings here are MMR and MH, and the receiver capabilities are MH and MR.)

o 必须使用“(图像编码=MR)”发送带有“(dpi=300)”的文档的高分辨率版本,因为这是接收器可用于高分辨率文档的唯一可用图像数据编码。(此处可用的300dpi文档编码为MMR和MH,接收器功能为MH和MR。)

7.2 A note on feature tag scoping
7.2 关于特征标记作用域的注记

This section contains some additional commentary on the interpretation of feture set predicates. It does not extend or modify what has been described previously. Rather, it attempts to clarify an area of possible misunderstanding.

本节包含一些关于胎儿集合谓词解释的附加注释。它不扩展或修改前面描述的内容。相反,它试图澄清一个可能存在误解的领域。

The essential fact that needs to be established here is:

这里需要确定的基本事实是:

Within a given feature collection, each feature tag may have only one value.

在给定的要素集合中,每个要素标记只能有一个值。

This idea is explained below in the context of using the media feature framework to describe the characteristics of transmitted image data.

下面在使用媒体特征框架来描述传输的图像数据的特征的上下文中解释该思想。

In this context, we have the requirement that any feature tag value must apply to the entire image, and cannot have different values for different parts of an image. This is a consequence of the way that the framework of feature predicates is used to describe different possible images, such as the different images that can be rendered by a given recipient.

在这种情况下,我们要求任何特征标记值必须应用于整个图像,并且对于图像的不同部分不能有不同的值。这是使用特征谓词框架来描述不同可能图像的方式的结果,例如给定接收者可以呈现的不同图像。

This idea is illustrated here using an example of a flawed feature set description based on the TIFF image format defined for use by Internet fax [13]:

这里使用一个基于互联网传真使用的TIFF图像格式的有缺陷的特征集描述示例来说明这一想法[13]:

      (& (& (MRC-mode=1) (stripe-size=256) )
         (| (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) )
            (image-coding=[MH,MR,MMR]) ) )
        
      (& (& (MRC-mode=1) (stripe-size=256) )
         (| (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) )
            (image-coding=[MH,MR,MMR]) ) )
        

This example is revealing because the 'stripe-size' attribute is applied differently to different attributes on an MRC-formatted data: it can be applied to the MRC format as a whole, and it can be applied separately to a JBIG image that may appear as part of the MRC data.

这个例子很有启发性,因为“条带大小”属性对MRC格式数据上的不同属性的应用不同:它可以作为一个整体应用于MRC格式,也可以单独应用于可能作为MRC数据一部分出现的JBIG图像。

One might imagine that this example describes a stripe size of 256 when applied to the MRC image format, and a separate stripe size of 128 when applied to a JBIG-2-LEVEL coded image within the MRC-formatted data. But it doesn't work that way: the predicates used obey the normal laws of Boolean logic, and would be transformed as follows:

可以想象,该示例描述了应用于MRC图像格式时的条带大小为256,以及应用于MRC格式数据中的JBIG-2级编码图像时的单独条带大小为128。但它不是这样工作的:使用的谓词遵循布尔逻辑的正常规律,并将按如下方式进行转换:

      --> [flatten nested (&...)]:
          (& (MRC-mode=1) (stripe-size=256)
             (| (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) )
                (image-coding=[MH,MR,MMR]) ) )
        
      --> [flatten nested (&...)]:
          (& (MRC-mode=1) (stripe-size=256)
             (| (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) )
                (image-coding=[MH,MR,MMR]) ) )
        
      --> [Distribute (&...) over (|...)]:
           (| (& (MRC-mode=1) (stripe-size=256)
                 (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) ) )
              (& (MRC-mode=1) (stripe-size=[0..256])
                 (image-coding=[MH,MR,MMR]) ) )
        
      --> [Distribute (&...) over (|...)]:
           (| (& (MRC-mode=1) (stripe-size=256)
                 (& (image-coding=JBIG-2-LEVEL) (stripe-size=128) ) )
              (& (MRC-mode=1) (stripe-size=[0..256])
                 (image-coding=[MH,MR,MMR]) ) )
        

--> [Flatten nested (&...) and group feature tags]: (| (& (MRC-mode=1) (stripe-size=256) (stripe-size=128) (image-coding=JBIG-2-LEVEL) ) (& (MRC-mode=1) (stripe-size=256) (image-coding=[MH,MR,MMR]) ) )

-->[展平嵌套(&…)和组特征标记]:(&(MRC模式=1)(条带大小=256)(条带大小=128)(图像编码=JBIG-2-LEVEL))(&(MRC模式=1)(条带大小=256)(图像编码=[MH,MR,MMR]))

Examination of this final expression shows that it requires both ' stripe-size=128' and 'stripe-size=256' within the same conjunction. This is manifestly false, so the entire conjunction must be false, reducing the entire predicate expression to:

对这个最终表达式的检查表明,它需要在同一个连词中同时使用“stripe size=128”和“stripe size=256”。这显然是错误的,因此整个连接必须是错误的,从而将整个谓词表达式减少为:

(& (MRC-mode=1) (stripe-size=256) (image-coding=[MH,MR,MMR]) ) )

(&(MRC模式=1)(条带大小=256)(图像编码=[MH,MR,MMR]))

This indicates that no MRC formatted data containing a JBIG-2-LEVEL coded image is permitted within the feature set, which is not what was intended in this case.

这表明功能集中不允许包含JBIG-2级编码图像的MRC格式数据,这不是本例中的目的。

The only way to avoid this in situations when a given characteristic has different constraints in different parts of a resource is to use separate feature tags. In this example, 'MRC-stripe-size' and ' JBIG-stripe-size' could be used to capture the intent:

在给定特征在资源的不同部分具有不同约束的情况下,避免这种情况的唯一方法是使用单独的特征标记。在本例中,“MRC条带大小”和“JBIG条带大小”可用于捕获意图:

      (& (& (MRC-mode=1) (MRC-stripe-size=256) )
         (| (& (image-coding=JBIG-2-LEVEL) (JBIG-stripe-size=128) )
            (image-coding=[MH,MR,MMR]) ) )
        
      (& (& (MRC-mode=1) (MRC-stripe-size=256) )
         (| (& (image-coding=JBIG-2-LEVEL) (JBIG-stripe-size=128) )
            (image-coding=[MH,MR,MMR]) ) )
        

which would reduce to:

这将减少到:

(| (& (MRC-mode=1) (MRC-stripe-size=256) (JBIG-stripe-size=128) (image-coding=JBIG-2-LEVEL) ) (& (MRC-mode=1) (MRC-stripe-size=256) (image-coding=[MH,MR,MMR]) ) )

(|)(&(MRC模式=1)(MRC条带大小=256)(JBIG条带大小=128)(图像编码=JBIG-2级))(&(MRC模式=1)(MRC条带大小=256)(图像编码=[MH,MR,MMR]))

The property of the capability description framework explicated above is captured by the idea of a "feature collection" which (in this context) describes the feature values that apply to a single resource. Within a feature collection, each feature tag may have no more than one value.

上述能力描述框架的属性通过“特征集合”的概念来体现,该集合(在本文中)描述了应用于单个资源的特征值。在要素集合中,每个要素标记的值不得超过一个。

The characteristics of an image sender or receiver are described by a "Feature set", which is formally a set of feature collections. Here, the feature set predicate is applied to some image feature collection to determine whether or not it belongs to the set that can be handled by an image receiver.

图像发送者或接收者的特征由“特征集”描述,该特征集形式上是一组特征集合。这里,将特征集谓词应用于某些图像特征集合,以确定它是否属于可由图像接收器处理的集合。

8. Security Considerations
8. 安全考虑

Some security considerations for content negotiation are raised in [1,2,3].

[1,2,3]中提出了内容协商的一些安全注意事项。

The following are primary security concerns for capability identification mechanisms:

以下是能力识别机制的主要安全问题:

o Unintentional disclosure of private information through the announcement of capabilities or user preferences.

o 通过公布功能或用户偏好无意中泄露私人信息。

o Disruption to system operation caused by accidental or malicious provision of incorrect capability information.

o 意外或恶意提供不正确的功能信息导致系统运行中断。

o Use of a capability identification mechanism might be used to probe a network (e.g. by identifying specific hosts used, and exploiting their known weaknesses).

o 使用能力识别机制可用于探测网络(例如,通过识别使用的特定主机,并利用其已知弱点)。

The most contentious security concerns are raised by mechanisms which automatically send capability identification data in response to a query from some unknown system. Use of directory services (based on LDAP [7], etc.) seem to be less problematic because proper authentication mechanisms are available.

最有争议的安全问题是由自动发送能力标识数据以响应来自未知系统的查询的机制引起的。使用目录服务(基于LDAP[7]等)似乎问题较少,因为有适当的身份验证机制可用。

Mechanisms that provide capability information when sending a message are less contentious, presumably because some intention can be inferred that person whose details are disclosed wishes to communicate with the recipient of those details. This does not, however, solve problems of spoofed supply of incorrect capability information.

在发送消息时提供能力信息的机制争议较少,这可能是因为可以推断出某些意图,即披露其详细信息的人希望与这些详细信息的接收者通信。然而,这并不能解决欺骗提供不正确能力信息的问题。

The use of format converting gateways may prove problematic because such systems would tend to defeat any message integrity and authenticity checking mechanisms that are employed.

使用格式转换网关可能会出现问题,因为这样的系统往往会破坏所采用的任何消息完整性和真实性检查机制。

9. Acknowledgements
9. 致谢

Thanks are due to Larry Masinter for demonstrating the breadth of the media feature issue, and encouraging the development of some early thoughts.

感谢Larry Masinter展示了媒体专题的广度,并鼓励了一些早期思想的发展。

Many of the ideas presented derive from the "Transparent Content Negotiation in HTTP" work of Koen Holtman and Andy Mutz [4].

提出的许多想法源自Koen Holtman和Andy Mutz的“HTTP中的透明内容协商”工作[4]。

Early discussions of ideas with the IETF HTTP and FAX working groups led to further useful inputs from Koen Holtman, Ted Hardie and Dan Wing. The debate later moved to the IETF 'conneg' working group, where Al Gilman and Koen Holtman were particularly helpful in refining the feature set algebra. Ideas for dealing with preferences and specific units were suggested by Larry Masinter.

早期与IETF HTTP和传真工作组讨论的想法导致Koen Holtman、Ted Hardie和Dan Wing提供了更多有用的信息。辩论后来转移到IETF“conneg”工作组,在那里,Al Gilman和Koen Holtman在细化功能集代数方面特别有帮助。Larry Masinter提出了处理偏好和特定单位的想法。

This work was supported by Content Technologies Ltd and 5th Generation Messaging Ltd.

这项工作得到了内容技术有限公司和第五代通讯有限公司的支持。

10. References
10. 工具书类

[1] Hardie, T., "Scenarios for the Delivery of Negotiated Content", Work in Progress.

[1] Hardie,T.,“协商内容交付的场景”,正在进行中。

[2] Klyne, G., "Requirements for protocol-independent content negotiation", Work in Progress.

[2] Klyne,G.“协议无关内容协商的要求”,正在进行中。

[3] Holtman, K., Mutz, A., and T. Hardie, "Media Feature Tag Registration Procedure", BCP 31, RFC 2506, March 1999.

[3] Holtman,K.,Mutz,A.,和T.Hardie,“媒体功能标签注册程序”,BCP 31,RFC 2506,1999年3月。

[4] Holtman, K. and A. Mutz, "Transparent Content Negotiation in HTTP", RFC 2295, March 1998.

[4] Holtman,K.和A.Mutz,“HTTP中的透明内容协商”,RFC 2295,1998年3月。

[5] "Programming in Prolog" (2nd edition), W. F. Clocksin and C. S. Mellish, Springer Verlag, ISBN 3-540-15011-0 / 0-387-15011-0, 1984.

[5] 《Prolog编程》(第二版),W.F.Clocksin和C.S.Mellish,Springer Verlag,ISBN 3-540-15011-0/0-387-15011-01984。

[6] Masinter, L., Holtman, K., Mutz, A., and D. Wing, "Media Features for Display, Print, and Fax", RFC 2534, March 1999.

[6] Masinter,L.,Holtman,K.,Mutz,A.,和D.Wing,“用于显示、打印和传真的媒体功能”,RFC 25341999年3月。

[7] Wahl, M., Howes, T. and S. Kille, "Lightweight Directory Access Protocol (v3)", RFC 2251, December 1997.

[7] Wahl,M.,Howes,T.和S.Kille,“轻量级目录访问协议(v3)”,RFC 2251,1997年12月。

[8] Howes, T., "The String Representation of LDAP Search Filters", RFC 2254, December 1997.

[8] Howes,T.,“LDAP搜索过滤器的字符串表示”,RFC 2254,1997年12月。

[9] Fielding, R., Gettys, J., Mogul, J., Frytyk, H. and T. Berners-Lee, "Hyptertext Transfer Protocol -- HTTP/1.1", RFC 2068, January 1997.

[9] 菲尔丁,R.,盖蒂斯,J.,莫格尔,J.,弗莱蒂克,H.和T.伯纳斯李,“Hyptertext传输协议——HTTP/1.1”,RFC 2068,1997年1月。

[10] Crocker, D., Editor, and P. Overell, "Augmented BNF for Syntax Specifications: ABNF", RFC 2234, November 1997.

[10] Crocker,D.,编辑和P.Overell,“语法规范的扩充BNF:ABNF”,RFC 2234,1997年11月。

[11] "Logic, Algebra and Databases", Peter Gray, Ellis Horwood Series: Computers and their Applications, ISBN 0-85312-709-3/0- 85312-803-3 (Ellis Horwood Ltd), ISBN 0-470-20103-7/0-470- 20259-9 (Halstead Press), 1984.

[11] “逻辑、代数和数据库”,彼得·格雷,埃利斯·霍伍德系列:计算机及其应用,ISBN 0-85312-709-3/0-85312-803-3(埃利斯·霍伍德有限公司),ISBN 0-470-20103-7/0-470-20259-9(霍尔斯特德出版社),1984年。

[12] "Logic and its Applications", Edmund Burk and Eric Foxley, Prentice Hall, Series in computer science, ISBN 0-13-030263-5, 1996.

[12] “逻辑及其应用”,Edmund Burk和Eric Foxley,Prentice Hall,计算机科学系列,ISBN 0-13-030263-52996。

[13] McIntyre, L., Buckley, R., Venable, D., Zilles, S., Parsons, G. and J. Rafferty, "File Format for Internet Fax", RFC 2301, March 1998.

[13] McIntyre,L.,Buckley,R.,Venable,D.,Zilles,S.,Parsons,G.和J.Rafferty,“互联网传真的文件格式”,RFC 2301,1998年3月。

   [14] Apache content negotiation algorithm,
        <http://www.apache.org/docs/content-negotiation.html>
        
   [14] Apache content negotiation algorithm,
        <http://www.apache.org/docs/content-negotiation.html>
        
11. Author's Address
11. 作者地址

Graham Klyne Content Technologies Ltd. 5th Generation Messaging Ltd. Forum 1 5 Watlington Street Station Road Nettlebed Theale Henley-on-Thames Reading, RG7 4RA RG9 5AB United Kingdom United Kingdom.

格雷厄姆·克莱恩内容技术有限公司第五代信息技术有限公司论坛1沃特灵顿街车站路5号泰晤士河畔的泰晤士河莱丁,RG7 4RA RG9 5AB英国。

   Phone:     +44 118 930 1300      +44 1491 641 641
   Facsimile: +44 118 930 1301      +44 1491 641 611
   EMail:     GK@ACM.ORG
        
   Phone:     +44 118 930 1300      +44 1491 641 641
   Facsimile: +44 118 930 1301      +44 1491 641 611
   EMail:     GK@ACM.ORG
        

Full Copyright Statement

完整版权声明

Copyright (C) The Internet Society (1999). All Rights Reserved.

版权所有(C)互联网协会(1999年)。版权所有。

This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.

本文件及其译本可复制并提供给他人,对其进行评论或解释或协助其实施的衍生作品可全部或部分编制、复制、出版和分发,不受任何限制,前提是上述版权声明和本段包含在所有此类副本和衍生作品中。但是,不得以任何方式修改本文件本身,例如删除版权通知或对互联网协会或其他互联网组织的引用,除非出于制定互联网标准的需要,在这种情况下,必须遵循互联网标准过程中定义的版权程序,或根据需要将其翻译成英语以外的其他语言。

The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.

上述授予的有限许可是永久性的,互联网协会或其继承人或受让人不会撤销。

This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.

本文件和其中包含的信息是按“原样”提供的,互联网协会和互联网工程任务组否认所有明示或暗示的保证,包括但不限于任何保证,即使用本文中的信息不会侵犯任何权利,或对适销性或特定用途适用性的任何默示保证。