RFC 6573 INFORMATIONAL WEB · HTTP · LINKS

The Item and Collection Link Relations

Standard link types for connecting collections to their members

On rfc-editor.org ↗
PUBLISHED
April 2012
AUTHORS
M. Amundsen
STREAM
IETF
LINK RELATIONS DEFINED
2 (item and collection)
RELATION: COLLECTION
Points from member to collection
RELATION: ITEM
Points from collection to member
DOI
10.17487/RFC6573

RFC text

Contents
Original text · RFC Editor View on rfc-editor.org ↗
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.

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.

   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.

Copyright Notice

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

   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.

1.  Introduction

   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.

   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]

   2.  Maze+XML: see [Maze]

   3.  Collection+JSON: see [CollectionJSON]

2.  Link Relations

   The following link relations are defined.

2.1.  'item'

   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>

   or, in the case of a Link Header field

   Link: <...>; rel="item"; title="View Product X001"
   Link: <...>; rel="item"; title="View Product X002"

2.2.  'collection'

   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>

   or, in the case of a Link Header field

   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>

   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"

   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"

3.  IANA Considerations

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

3.1.  'item' Link Relation Registration

   Relation Name:

      item
   Description:

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

   Reference:

      See Section 2

3.2.  'collection' Link Relation Registration

   Relation Name:

      collection

   Description:

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

   Reference:

      See Section 2

4.  Security Considerations

   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].

5.  Internationalisation Considerations

   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].

6.  References

6.1.  Normative References

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

6.2.  Informative References

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

   [Maze]            Amundsen, M., "Maze+XML - Format", Web Page ,
                     December 2010,
                     <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/>.

Appendix A.  Acknowledgements

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

Author's Address

   Mike Amundsen

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

AI ELI5

On this page
PROBLEMWeb resources need a standardized way to express relationships between collections and their individual members.
MECHANISMRFC 6573 defines two reciprocal link relation types: 'item' (collection points to members) and 'collection' (member points back to its collection).
STANDARDIZED NAVIGATION LINKSApplications can use these standard link types across different formats to navigate between collections and their contents.

§1What Link Relations Are

RFC 5988 established a way to describe relationships between web resources using link relations. RFC 6573 adds two specific relation types to that vocabulary: item and collection. These let web resources express the relationship between a collection and its members—like a catalog showing its products, or a product showing which catalog it belongs to.

Link relations are labels that tell you what kind of relationship one web page has to another. 'item' and 'collection' are two new labels for saying 'this thing is part of that group' and 'this group contains that thing.'

§2Item and Collection Links

The item link relation is used in a collection resource to point to resources that are members of that collection. For example, a product catalog page might include multiple rel='item' links pointing to individual product pages.

The collection link relation is the reverse: used in a member resource to point back to the collection it belongs to. A single product page might include a rel='collection' link back to its product catalog.

A resource can be both an item in one collection and itself a collection of other items, in which case it can use both link relations.

If you are looking at a list of items, rel='item' links point to each individual item. If you are looking at one item, rel='collection' points back to the list it came from.

§3Uses Across Media Types

These link relation types are not tied to any one media type or format. They can be used in HTML with anchor tags, in HTTP Link headers, in JSON documents, and in specialized formats like OpenSearch, Collection+JSON and Maze+XML. This generality means that any web-based system can adopt these standard relation names to describe the same concept.

Whether your web page is HTML, JSON, or some special format, you can use rel='item' and rel='collection' to show what things belong together.

§4References