Internet Engineering Task Force (IETF)                       M. Amundsen
Request for Comments: 6573                                    April 2012
Category: Informational
ISSN: 2070-1721
        
Internet Engineering Task Force (IETF)                       M. Amundsen
Request for Comments: 6573                                    April 2012
Category: Informational
ISSN: 2070-1721
        

The Item and Collection Link Relations

项目和集合链接关系

Abstract

摘要

RFC 5988 standardized a means of indicating the relationships between resources on the Web. This specification defines a pair of reciprocal link relation types that may be used to express the relationship between a collection and its members.

RFC 5988标准化了一种表示Web上资源之间关系的方法。本规范定义了一对相互链接关系类型,可用于表示集合及其成员之间的关系。

Status of This Memo

关于下段备忘

This document is not an Internet Standards Track specification; it is published for informational purposes.

本文件不是互联网标准跟踪规范;它是为了提供信息而发布的。

This document is a product of the Internet Engineering Task Force (IETF). It represents the consensus of the IETF community. It has received public review and has been approved for publication by the Internet Engineering Steering Group (IESG). Not all documents approved by the IESG are a candidate for any level of Internet Standard; see Section 2 of RFC 5741.

本文件是互联网工程任务组(IETF)的产品。它代表了IETF社区的共识。它已经接受了公众审查,并已被互联网工程指导小组(IESG)批准出版。并非IESG批准的所有文件都适用于任何级别的互联网标准;见RFC 5741第2节。

Information about the current status of this document, any errata, and how to provide feedback on it may be obtained at http://www.rfc-editor.org/info/rfc6573.

有关本文件当前状态、任何勘误表以及如何提供反馈的信息,请访问http://www.rfc-editor.org/info/rfc6573.

Copyright Notice

版权公告

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

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

This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (http://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.

本文件受BCP 78和IETF信托有关IETF文件的法律规定的约束(http://trustee.ietf.org/license-info)自本文件出版之日起生效。请仔细阅读这些文件,因为它们描述了您对本文件的权利和限制。从本文件中提取的代码组件必须包括信托法律条款第4.e节中所述的简化BSD许可证文本,并提供简化BSD许可证中所述的无担保。

1. Introduction
1. 介绍

RFC 5988 standardized a means of indicating the relationships between resources on the Web. This specification defines a pair of reciprocal link relation types that may be used to express the relationship between a collection and its members.

RFC 5988标准化了一种表示Web上资源之间关系的方法。本规范定义了一对相互链接关系类型,可用于表示集合及其成员之间的关系。

These link relation types can be applied to a wide range of use cases across multiple media types. For example, the 'collection' and 'item' link relation types are used in these media types:

这些链接关系类型可以应用于多种媒体类型的广泛用例。例如,“集合”和“项目”链接关系类型用于这些媒体类型:

1. OpenSearch 1.1: see Section 4.5.4.1 of [OpenSearch]

1. OpenSearch 1.1:见[OpenSearch]第4.5.4.1节

2. Maze+XML: see [Maze]

2. Maze+XML:参见[Maze]

3. Collection+JSON: see [CollectionJSON]

3. Collection+JSON:请参阅[CollectionJSON]

2. Link Relations
2. 链接关系

The following link relations are defined.

定义了以下链接关系。

2.1. 'item'
2.1. “项目”

When included in a resource that represents a collection, the 'item' link relation identifies a target resource that represents a member of that collection.

当包含在表示集合的资源中时,“项”链接关系标识表示该集合成员的目标资源。

For example, if a resource represents a catalog of products, that same representation may include one or more links to resources that represent members of that catalog.

例如,如果一个资源表示一个产品目录,那么同一个表示可能包括一个或多个指向表示该目录成员的资源的链接。

   <html>
   ...
     <h1>Product Group X Listing</h1>
     ...
     <a href="..." rel="item">View Product X001</a>
     <a href="..." rel="item">View Product X002</a>
     ...
   </html>
        
   <html>
   ...
     <h1>Product Group X Listing</h1>
     ...
     <a href="..." rel="item">View Product X001</a>
     <a href="..." rel="item">View Product X002</a>
     ...
   </html>
        

or, in the case of a Link Header field

或者,在链接头字段的情况下

   Link: <...>; rel="item"; title="View Product X001"
   Link: <...>; rel="item"; title="View Product X002"
        
   Link: <...>; rel="item"; title="View Product X001"
   Link: <...>; rel="item"; title="View Product X002"
        
2.2. 'collection'
2.2. “收藏”

When included in a resource that represents a member of a collection, the 'collection' link relation identifies a target resource that represents a collection of which the context resource is a member.

当包含在表示集合成员的资源中时,“集合”链接关系标识表示上下文资源是其成员的集合的目标资源。

For example, if a resource represents a single product in a catalog, that same representation may include a link to a resource that represents a product group to which this single product belongs:

例如,如果资源表示目录中的单个产品,则该表示可能包括指向表示该单个产品所属产品组的资源的链接:

   <a href="..." rel="collection">Return to Product Group X</a>
        
   <a href="..." rel="collection">Return to Product Group X</a>
        

or, in the case of a Link Header field

或者,在链接头字段的情况下

   Link: <...>; rel="collection"; title="Return to Product Group X"
        
   Link: <...>; rel="collection"; title="Return to Product Group X"
        

Since it is possible that a resource could be a member of multiple collections, multiple 'collection' link relations may appear within the same representation:

由于资源可能是多个集合的成员,因此多个“集合”链接关系可能出现在同一表示中:

   <a href="..." rel="collection">View other widgets</a>
   <a href="..." rel="collection">View all discontinued items</a>
        
   <a href="..." rel="collection">View other widgets</a>
   <a href="..." rel="collection">View all discontinued items</a>
        

The target resource representation need not be restricted to representing a list. It may simply be a document that provides details on the collection of which the context resource is a member:

目标资源表示不必局限于表示列表。它可能只是一个文档,提供上下文资源所属集合的详细信息:

   Link: <...>; rel="collection";
         title="Shakespeare's Collected Works - A History"
        
   Link: <...>; rel="collection";
         title="Shakespeare's Collected Works - A History"
        

It should also be noted that the same link might represent an 'item' in one collection as well as a 'collection' itself. In this case, both link relation values can be applied to the same link:

还应注意,同一链接可能表示一个集合中的“项”以及“集合”本身。在这种情况下,两个链接关系值都可以应用于同一链接:

   Link: <...>; rel="collection item";
         title="A Review of Issac Asimov's Collected Works - Vol. I"
        
   Link: <...>; rel="collection item";
         title="A Review of Issac Asimov's Collected Works - Vol. I"
        
3. IANA Considerations
3. IANA考虑

IANA has registered the 'collection' and 'item' link relations below as per [RFC5988].

IANA已根据[RFC5988]注册了以下“集合”和“项目”链接关系。

3.1. 'item' Link Relation Registration
3.1. “项目”链接关系注册

Relation Name:

关系名称:

item

项目

Description:

说明:

The target IRI points to a resource that is a member of the collection represented by the context IRI.

目标IRI指向一个资源,该资源是上下文IRI表示的集合的成员。

Reference:

参考:

See Section 2

见第2节

3.2. 'collection' Link Relation Registration
3.2. “集合”链接关系注册

Relation Name:

关系名称:

collection

收集

Description:

说明:

The target IRI points to a resource that represents the collection resource for the context IRI.

目标IRI指向表示上下文IRI的集合资源的资源。

Reference:

参考:

See Section 2

见第2节

4. Security Considerations
4. 安全考虑

The two link relation types defined in this document do not introduce any new security issues to those which are discussed in Section 7 of RFC5988 [RFC5988].

本文件中定义的两种链路关系类型不会给RFC5988[RFC5988]第7节中讨论的问题带来任何新的安全问题。

5. Internationalisation Considerations
5. 国际化考虑

The 'item' and 'collection' link relation types do not have any internationalization considerations other than those which are discussed in Section 8 of RFC5988 [RFC5988].

除了RFC5988[RFC5988]第8节中讨论的国际化注意事项外,“项”和“集合”链接关系类型没有任何国际化注意事项。

6. References
6. 工具书类
6.1. Normative References
6.1. 规范性引用文件

[RFC5988] Nottingham, M., "Web Linking", RFC 5988, October 2010.

[RFC5988]诺丁汉,M.,“网络链接”,RFC 5988,2010年10月。

6.2. Informative References
6.2. 资料性引用

[CollectionJSON] Amundsen, M., "Collection+JSON - Document Format", Web Page , July 2011, <http://www.iana.org/assignments/media-types>.

[CollectionJSON]Amundsen,M.,“Collection+JSON-文档格式”,网页,2011年7月<http://www.iana.org/assignments/media-types>.

[Maze] Amundsen, M., "Maze+XML - Format", Web Page , December 2010, <http://www.iana.org/assignments/media-types>.

[Maze]Amundsen,M.,“Maze+XML-格式”,网页,2010年12月<http://www.iana.org/assignments/media-types>.

[OpenSearch] Clinton, D., "Open Search 1.1", Work in Progress , March 2011, <http://www.opensearch.org/ Specifications/OpenSearch/1.1/>.

[OpenSearch]Clinton,D.,“OpenSearch 1.1”,正在进行的工作,2011年3月<http://www.opensearch.org/ 规范/OpenSearch/1.1/>。

Appendix A. Acknowledgements
附录A.确认书

The author gratefully acknowledges the contributions of Julian Reschke and Mykyta Yevstifeyev.

作者感谢Julian Reschke和Mykyta Yevstifeyev的贡献。

Author's Address

作者地址

Mike Amundsen

迈克·阿蒙森

   EMail: mca@amundsen.com
   URI:   http://amundsen.com
        
   EMail: mca@amundsen.com
   URI:   http://amundsen.com