draft-ietf-httpapi-linkset-03.txt   draft-ietf-httpapi-linkset-04.txt 
Network Working Group E. Wilde Network Working Group E. Wilde
Internet-Draft Axway Internet-Draft Axway
Intended status: Informational H. Van de Sompel Intended status: Informational H. Van de Sompel
Expires: 5 January 2022 Data Archiving and Networked Services Expires: 9 April 2022 Data Archiving and Networked Services
4 July 2021 6 October 2021
Linkset: Media Types and a Link Relation Type for Link Sets Linkset: Media Types and a Link Relation Type for Link Sets
draft-ietf-httpapi-linkset-03 draft-ietf-httpapi-linkset-04
Abstract Abstract
This specification defines two document formats and respective media This specification defines two formats and respective media types for
types for representing sets of links as stand-alone resources. One representing sets of links as stand-alone documents. One format is
format is JSON-based, the other aligned with the format for JSON-based, the other aligned with the format for representing links
representing links in the HTTP "Link" header field. This in the HTTP "Link" header field. This specification also introduces
specification also introduces a link relation type to support a link relation type to support discovery of sets of links.
discovery of sets of links.
Note to Readers Note to Readers
Please discuss this draft on the "Building Blocks for HTTP APIs" Please discuss this draft on the "Building Blocks for HTTP APIs"
mailing list (https://www.ietf.org/mailman/listinfo/httpapi). mailing list (https://www.ietf.org/mailman/listinfo/httpapi).
Online access to all versions and files is available on GitHub Online access to all versions and files is available on GitHub
(https://github.com/ietf-wg-httpapi/linkset). (https://github.com/ietf-wg-httpapi/linkset).
Status of This Memo Status of This Memo
skipping to change at page 1, line 44 skipping to change at page 1, line 43
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at https://datatracker.ietf.org/drafts/current/. Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on 5 January 2022. This Internet-Draft will expire on 9 April 2022.
Copyright Notice Copyright Notice
Copyright (c) 2021 IETF Trust and the persons identified as the Copyright (c) 2021 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents (https://trustee.ietf.org/ Provisions Relating to IETF Documents (https://trustee.ietf.org/
license-info) in effect on the date of publication of this document. license-info) in effect on the date of publication of this document.
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
and restrictions with respect to this document. Code Components and restrictions with respect to this document. Code Components
extracted from this document must include Simplified BSD License text extracted from this document must include Simplified BSD License text
as described in Section 4.e of the Trust Legal Provisions and are as described in Section 4.e of the Trust Legal Provisions and are
provided without warranty as described in the Simplified BSD License. provided without warranty as described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3
2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3
3. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 3 3. Use Cases and Motivation . . . . . . . . . . . . . . . . . . 3
3.1. Third-Party Links . . . . . . . . . . . . . . . . . . . . 4 3.1. Third-Party Links . . . . . . . . . . . . . . . . . . . . 4
3.2. Challenges Writing to HTTP Link Header Field . . . . . . 4 3.2. Challenges Writing to HTTP Link Header Field . . . . . . 5
3.3. Large Number of Links . . . . . . . . . . . . . . . . . . 5 3.3. Large Number of Links . . . . . . . . . . . . . . . . . . 5
4. Document Formats for Sets of Links . . . . . . . . . . . . . 5 4. Document Formats for Sets of Links . . . . . . . . . . . . . 5
4.1. HTTP Link Document Format: application/linkset . . . . . 6 4.1. HTTP Link Document Format: application/linkset . . . . . 6
4.2. JSON Document Format: application/linkset+json . . . . . 6 4.2. JSON Document Format: application/linkset+json . . . . . 7
4.2.1. Set of Links . . . . . . . . . . . . . . . . . . . . 7 4.2.1. Set of Links . . . . . . . . . . . . . . . . . . . . 7
4.2.2. Link Context Object . . . . . . . . . . . . . . . . . 7 4.2.2. Link Context Object . . . . . . . . . . . . . . . . . 8
4.2.3. Link Target Object . . . . . . . . . . . . . . . . . 8 4.2.3. Link Target Object . . . . . . . . . . . . . . . . . 8
4.2.4. Link Target Attributes . . . . . . . . . . . . . . . 10 4.2.4. Link Target Attributes . . . . . . . . . . . . . . . 10
4.2.5. JSON Extensibility . . . . . . . . . . . . . . . . . 14 4.2.5. JSON Extensibility . . . . . . . . . . . . . . . . . 14
5. The "profile" attribute for media types to Represent Sets of 5. The "profile" paramter for media types to Represent Sets of
Links . . . . . . . . . . . . . . . . . . . . . . . . . . 15 Links . . . . . . . . . . . . . . . . . . . . . . . . . . 15
6. The "linkset" Relation Type for Linking to a Set of Links . . 15 6. The "linkset" Relation Type for Linking to a Set of Links . . 15
7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 16 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 16
7.1. Set of Links Provided as application/linkset . . . . . . 16 7.1. Set of Links Provided as application/linkset . . . . . . 16
7.2. Set of Links Provided as application/linkset+json . . . . 17 7.2. Set of Links Provided as application/linkset+json . . . . 17
7.3. Discovering a Link Set via the "linkset" Link Relation 7.3. Discovering a Link Set via the "linkset" Link Relation
Type . . . . . . . . . . . . . . . . . . . . . . . . . . 19 Type . . . . . . . . . . . . . . . . . . . . . . . . . . 19
8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 7.4. Link Set Profiles . . . . . . . . . . . . . . . . . . . . 20
8.1. Link Relation Type: linkset . . . . . . . . . . . . . . . 20 7.4.1. Using a "profile" Attribute with a "linkset" Link . . 20
8.2. Media Type: application/linkset . . . . . . . . . . . . . 20 7.4.2. Using a "profile" Parameter with a Link Set Media
8.3. Media Type: application/linkset+json . . . . . . . . . . 21 Type . . . . . . . . . . . . . . . . . . . . . . . . 21
9. Security Considerations . . . . . . . . . . . . . . . . . . . 22 7.4.3. Using a Link with a "profile" Link Relation Type . . 21
10. Normative References . . . . . . . . . . . . . . . . . . . . 23 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 22
11. Informative References . . . . . . . . . . . . . . . . . . . 24 8.1. Link Relation Type: linkset . . . . . . . . . . . . . . . 22
Appendix A. JSON-LD Context . . . . . . . . . . . . . . . . . . 25 8.2. Media Type: application/linkset . . . . . . . . . . . . . 23
Appendix B. Implementation Status . . . . . . . . . . . . . . . 30 8.3. Media Type: application/linkset+json . . . . . . . . . . 24
B.1. GS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 9. Security Considerations . . . . . . . . . . . . . . . . . . . 25
B.2. FAIR Signposting Profile . . . . . . . . . . . . . . . . 31 10. Normative References . . . . . . . . . . . . . . . . . . . . 25
B.3. Open Journal Systems (OJS) . . . . . . . . . . . . . . . 31 11. Informative References . . . . . . . . . . . . . . . . . . . 27
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 31 Appendix A. JSON-LD Context . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31 Appendix B. Implementation Status . . . . . . . . . . . . . . . 32
B.1. GS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
B.2. FAIR Signposting Profile . . . . . . . . . . . . . . . . 33
B.3. Open Journal Systems (OJS) . . . . . . . . . . . . . . . 33
Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 33
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 33
1. Introduction 1. Introduction
Resources on the Web often use typed Web Links [RFC8288], either Resources on the Web often use typed Web Links [RFC8288], either
embedded in resource representations, for example using the <link> embedded in resource representations, for example using the <link>
element for HTML documents, or conveyed in the HTTP "Link" header element for HTML documents, or conveyed in the HTTP "Link" header
field for documents of any media type. In some cases, however, field for documents of any media type. In some cases, however,
providing links in this manner is impractical or impossible and providing links in this manner is impractical or impossible and
delivering a set of links as a stand-alone document is preferable. delivering a set of links as a stand-alone document is preferable.
Therefore, this specification defines two document formats and Therefore, this specification defines two document formats that
associated media types to represent sets of links. It also defines serialize Web Links and their attributes. One serializes links in
the "linkset" relation type that supports discovery of any resource the same format as used in HTTP the Link header field, and the other
that conveys a set of links as a stand-alone document. as a JSON object. It also defines associated media types to
represent sets of links and the "linkset" relation type that supports
discovery of any resource that conveys a set of links as a stand-
alone document.
2. Terminology 2. Terminology
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14 [RFC2119] [RFC8174] when, and only when, they appear in all 14 [RFC2119] [RFC8174] when, and only when, they appear in all
capitals, as shown here. capitals, as shown here.
This specification uses the terms "link context" and "link target" as This specification uses the terms "link context" and "link target" as
defined in [RFC8288]. defined in [RFC8288].
In the examples provided in this document, links in the HTTP "Link" In the examples provided in this document, links in the HTTP "Link"
header field are shown on separate lines in order to improve header field are shown on separate lines in order to improve
readability. Note, however, that as per Section 5.5 of readability. Note, however, that as per Section 5.5 of
[I-D.ietf-httpbis-semantics], line breaks are deprecated in values [I-D.ietf-httpbis-semantics], line breaks are deprecated in values
for HTTP fields; only whitespaces and tabs are supported as for HTTP fields; only whitespaces and tabs are supported as
separators. separators.
3. Scenarios 3. Use Cases and Motivation
The following sections outline scenarios in which providing links by The following sections describe uses cases in which providing links
means of a standalone document instead of in an HTTP "Link" header by means of a standalone document instead of in an HTTP "Link" header
field or as links embedded in the resource representation is field or as links embedded in the resource representation is
advantageous or necessary. advantageous or necessary.
For all scenarios, links could be provided by means of a stand-alone For all scenarios, links could be provided by means of a stand-alone
document that is formatted according to the JSON-based serialization, document that is formatted according to the JSON-based serialization,
the serialization aligned with the HTTP "Link" field format, or both. the serialization aligned with the HTTP "Link" field format, or both.
The former serialization is motivated by the widespread use of JSON The former serialization is motivated by the widespread use of JSON
and related tools, which suggests that handling sets of links and related tools, which suggests that handling sets of links
expressed as JSON documents should be attractive to developers. The expressed as JSON documents should be attractive to developers. The
latter serialization is provided for compatibility with the existing latter serialization is provided for compatibility with the existing
skipping to change at page 5, line 37 skipping to change at page 5, line 48
the size of HTTP "Link" header fields. the size of HTTP "Link" header fields.
4. Document Formats for Sets of Links 4. Document Formats for Sets of Links
This section specifies two document formats to convey a set of links. This section specifies two document formats to convey a set of links.
Both are based on the abstract model specified in Section 2 of Web Both are based on the abstract model specified in Section 2 of Web
Linking [RFC8288] that defines a link as consisting of a "link Linking [RFC8288] that defines a link as consisting of a "link
context", a "link relation type", a "link target", and optional context", a "link relation type", a "link target", and optional
"target attributes": "target attributes":
* The format defined in Section 4.1 is identical to the payload of * The format defined in Section 4.1 is near identical to the field
the HTTP "Link" header field as specified in Web Linking Section 3 value of the HTTP "Link" header field as specified in Web Linking
of [RFC8288]. Section 3 of [RFC8288].
* The format defined in Section 4.2 is based on JSON [RFC8259]. * The format defined in Section 4.2 is based on JSON [RFC8259].
Note that Section 3.3 of [RFC8288] deprecates the "rev" construct Note that Section 3.3 of [RFC8288] deprecates the "rev" construct
that was provided by [RFC5988] as a means to express links with a that was provided by [RFC5988] as a means to express links with a
directionality that is the inverse of direct links that use the "rel" directionality that is the inverse of direct links that use the "rel"
construct. In both serializations for link sets defined here, construct. In both serializations for link sets defined here,
inverse links SHOULD be represented as direct links using the "rel" inverse links may be represented as direct links using the "rel"
construct and by switching the position of the resources involved in construct and by switching the position of the resources involved in
the link. the link.
4.1. HTTP Link Document Format: application/linkset 4.1. HTTP Link Document Format: application/linkset
This document format is identical to the payload of the HTTP "Link" This document format is near identical to the field value of the HTTP
header field as defined in Section 3 of [RFC8288], more specifically "Link" header field as defined in Section 3 of [RFC8288], more
by its ABNF production rule for "Link" and subsequent ones. The use specifically by its ABNF production rule for "Link" and subsequent
of non-ASCII characters in the payload of the HTTP "Link" Header ones. It differs only from the format for field values of the HTTP
field is not interoperable. "Link" header in that not only spaces and horizontal tabs are allowed
as seperators but also new line characters as a means to improve
usability. The use of non-ASCII characters in the field value of the
HTTP "Link" Header field is not interoperable.
The assigned media type for this format is "application/linkset". The assigned media type for this format is "application/linkset".
When converting an "application/linkset" document to a field value
for the HTTP "Link" header, new line characters SHOULD be removed in
order to comply with Section 5.5 of [I-D.ietf-httpbis-semantics].
In order to support use cases where "application/linkset" documents In order to support use cases where "application/linkset" documents
are re-used outside the context of an HTTP interaction, it is are re-used outside the context of an HTTP interaction, it is
RECOMMENDED to make them self-contained by adhering to the following RECOMMENDED to make them self-contained by adhering to the following
guidelines: guidelines:
* For every link provided in the set of links, explicitly provide * For every link provided in the set of links, explicitly provide
the link context using the "anchor" attribute. the link context using the "anchor" attribute.
* For link context ("anchor" attribute) and link target ("href" * For link context ("anchor" attribute) and link target ("href"
attribute), use URI References that are not relative references attribute), use URI References that are not relative references
(as defined in Section 4.1 of [RFC3986]). (as defined in Section 4.1 of [RFC3986]).
If these recommendations are not followed, interpretation of links in If these recommendations are not followed, interpretation of links in
"application/linkset" documents will depend on which URI is used as "application/linkset" documents will depend on which URI is used as
context. context.
It should be noted that the "application/linkset" format specified It should be noted that the "application/linkset" format specified
here is different than the "application/link-format" format specified here is different than the "application/link-format" format specified
in [RFC6690] in that the former fully matches the payload of the HTTP in [RFC6690] in that the former fully matches the field value of the
"Link" header field as defined in Section 3 of [RFC8288], whereas the HTTP "Link" header field as defined in Section 3 of [RFC8288],
latter introduces constraints on that definition to meet requirements whereas the latter introduces constraints on that definition to meet
for Constrained RESTful Environments. requirements for Constrained RESTful Environments.
4.2. JSON Document Format: application/linkset+json 4.2. JSON Document Format: application/linkset+json
This document format uses JSON [RFC8259] as the syntax to represent a This document format uses JSON [RFC8259] as the syntax to represent a
set of links. The set of links follows the abstract model defined by set of links. The set of links follows the abstract model defined by
Web Linking Section 2 of [RFC8288]. Web Linking Section 2 of [RFC8288].
The assigned media type for this format is "application/ The assigned media type for this format is "application/
linkset+json". linkset+json".
skipping to change at page 7, line 26 skipping to change at page 7, line 40
The "application/linkset+json" serialization is designed such that it The "application/linkset+json" serialization is designed such that it
can directly be used as the content of a JSON-LD serialization by can directly be used as the content of a JSON-LD serialization by
adding an appropriate context. Appendix A shows an example of a adding an appropriate context. Appendix A shows an example of a
possible context that, when added to a JSON serialization, allows it possible context that, when added to a JSON serialization, allows it
to be interpreted as RDF. to be interpreted as RDF.
4.2.1. Set of Links 4.2.1. Set of Links
In the JSON representation of a set of links: In the JSON representation of a set of links:
* A set of links MUST be represented as a JSON object which MUST * A set of links is represented as a JSON object which MUST have
have "linkset" as its sole member. "linkset" as its sole member.
* The "linkset" member is an array in which a distinct JSON object - * The "linkset" member is an array in which a distinct JSON object -
the "link context object" (see Section 4.2.2) - MUST be used to the "link context object" (see Section 4.2.2) - is used to
represent links that have the same link context. represent links that have the same link context.
* Even if there is only one link context object, it MUST be wrapped * Even if there is only one link context object, it MUST be wrapped
in an array. Members other than link context objects MUST NOT be in an array.
included in this array.
4.2.2. Link Context Object 4.2.2. Link Context Object
In the JSON representation one or more links that have the same link In the JSON representation one or more links that have the same link
context are represented by a JSON object, the link context object. A context are represented by a JSON object, the link context object. A
link context object adheres to the following rules: link context object adheres to the following rules:
* Each link context object MAY have an "anchor" member with a value * Each link context object MAY have an "anchor" member with a value
that represents the link context. If present, this value MUST be that represents the link context. If present, this value MUST be
a URI Reference and SHOULD NOT be a relative reference as per a URI Reference and SHOULD NOT be a relative reference as per
skipping to change at page 8, line 22 skipping to change at page 8, line 33
- For registered relation types (Section 2.1.1 of [RFC8288]), the - For registered relation types (Section 2.1.1 of [RFC8288]), the
name of this member is the registered name of the relation name of this member is the registered name of the relation
type. type.
- For extension relation types (Section 2.1.2 of [RFC8288]), the - For extension relation types (Section 2.1.2 of [RFC8288]), the
name of this member is the URI that uniquely represents the name of this member is the URI that uniquely represents the
relation type. relation type.
* Even if there is only one link target object it MUST be wrapped in * Even if there is only one link target object it MUST be wrapped in
an array. Members other than link target objects MUST NOT be an array.
included in this array.
4.2.3. Link Target Object 4.2.3. Link Target Object
In the JSON representation a link target is represented by a JSON In the JSON representation a link target is represented by a JSON
object, the link target object. A link target object adheres to the object, the link target object. A link target object adheres to the
following rules: following rules:
* Each link target object MUST have an "href" member with a value * Each link target object MUST have an "href" member with a value
that represents the link target. This value MUST be a URI that represents the link target. This value MUST be a URI
Reference and SHOULD NOT be a relative reference as per Reference and SHOULD NOT be a relative reference as per
skipping to change at page 10, line 25 skipping to change at page 10, line 25
{"href": "http://example.com/foo2"} {"href": "http://example.com/foo2"}
] ]
} }
] ]
} }
Figure 3 Figure 3
4.2.4. Link Target Attributes 4.2.4. Link Target Attributes
A link may be further qualified by target attributes. Three types of A link may be further qualified by target attributes as defined by
attributes exist: Section 2 of Web Linking [RFC8288]. Three types of attributes exist:
* Attributes defined in Section 3.4.1 of Web Linking [RFC8288]. * Serialisation-defined attributes described in Section 3.4.1 of Web
Linking [RFC8288].
* Extension attributes defined and used by communities as allowed by * Extension attributes defined and used by communities as allowed by
Section 3.4.2 of [RFC8288]. Section 3.4.2 of [RFC8288].
* Internationalized versions of the "title" attribute defined by * Internationalized versions of the "title" attribute defined by
[RFC8288] and of extension attributes allowed by Section 3.4 of [RFC8288] and of extension attributes allowed by Section 3.4 of
[RFC8288]. [RFC8288].
The handling of these different types of attributes is described in The handling of these different types of attributes is described in
the sections below. the sections below.
skipping to change at page 14, line 46 skipping to change at page 14, line 46
} }
] ]
} }
] ]
} }
Figure 6 Figure 6
4.2.5. JSON Extensibility 4.2.5. JSON Extensibility
The extensibility of the JSON document format for representing a set The Web linking model ([RFC8288]) provides for the use of extension
of links is restricted to the extensibility provided by [RFC8288]. target attributes as discussed in Section 4.2.4.3. Extensions based
The Web linking model provides for the use of extension target on the JSON syntax (such as additional members of the linkset member
attributes as discussed in Section 4.2.4.3. Extensions based on the that are not defined in this specification) SHOULD NOT be used. In
JSON syntax MUST NOT be used, and MUST be ignored when found in a case they are used nevertheless, they MUST NOT change the semantics
JSON linkset document. of the JSON members defined in this specification. Agents that
consume JSON linkset documents MUST ignore such extensions.
This limitation of the JSON format allows to unambiguously round trip This limitation of the JSON format allows to unambiguously round trip
between links provided in the HTTP "Link" header field, sets of links between links provided in the HTTP "Link" header field, sets of links
serialized according to the "application/linkset" format, and sets of serialized according to the "application/linkset" format, and sets of
links serialized according to the "application/linkset+json" format. links serialized according to the "application/linkset+json" format.
5. The "profile" attribute for media types to Represent Sets of Links 5. The "profile" paramter for media types to Represent Sets of Links
As a means to convey specific constraints or conventions (as per As a means to convey specific constraints or conventions (as per
[RFC6906]) that apply to a link set document, the "profile" attribute [RFC6906]) that apply to a link set document, the "profile"
MAY be used in conjunction with the media types "application/linkset" parrameter MAY be used in conjunction with the media types
and "application/linkset+json" detailed in Section 4.1 and "application/linkset" and "application/linkset+json" detailed in
Section 4.2, respectively. For example, the attribute could be used Section 4.1 and Section 4.2, respectively. For example, the
to indicate that a link set uses a specific, limited set of link parrameter could be used to indicate that a link set uses a specific,
relation types. limited set of link relation types.
The value of the "profile" attribute MUST be a non-empty list of The value of the "profile" parrameter MUST be a non-empty list of
space-separated URIs, each of which identifies specific constraints space-separated URIs, each of which identifies specific constraints
or conventions that apply to the link set document. Profile URIs MAY or conventions that apply to the link set document. Profile URIs MAY
be registered in the IANA Profile URI Registry in the manner be registered in the IANA Profile URI Registry in the manner
specified by [RFC7284]. specified by [RFC7284].
The presence of a "profile" attribute in conjunction with the The presence of a "profile" parameter in conjunction with the
"application/linkset" and "application/linkset+json" media types does "application/linkset" and "application/linkset+json" media types does
not change the semantics of a link set. As such, clients with and not change the semantics of a link set. As such, clients with and
without knowledge of profile URIs can use the same representation. without knowledge of profile URIs can use the same representation.
Section 7.4.2 shows an example of using the "profile" parameter in
conjunction with the "application/linkset+json" media type.
6. The "linkset" Relation Type for Linking to a Set of Links 6. The "linkset" Relation Type for Linking to a Set of Links
The target of a link with the "linkset" relation type provides a set The target of a link with the "linkset" relation type provides a set
of links, including links in which the resource that is the link of links, including links in which the resource that is the link
context participates. context participates.
A link with the "linkset" relation type MAY be provided in the header A link with the "linkset" relation type MAY be provided in the header
field and/or the body of a resource's representation. It may also be field and/or the body of a resource's representation. It may also be
discovered by other means, such as through client-side information. discovered by other means, such as through client-side information.
skipping to change at page 16, line 11 skipping to change at page 16, line 11
of links provided by the resource that is the target of the link can of links provided by the resource that is the target of the link can
contain links in which the resource that is the context of the link contain links in which the resource that is the context of the link
does not participate; it MAY decide to ignore those links. does not participate; it MAY decide to ignore those links.
A user agent that follows a "linkset" link and obtains links for A user agent that follows a "linkset" link and obtains links for
which anchors and targets are expressed as relative references (as which anchors and targets are expressed as relative references (as
per Section 4.1 of [RFC3986]) MUST determine what the context is for per Section 4.1 of [RFC3986]) MUST determine what the context is for
these links; it SHOULD ignore links for which it is unable to these links; it SHOULD ignore links for which it is unable to
unambiguously make that determination. unambiguously make that determination.
As a means to convey specific constraints or conventions (as per
[RFC6906]) that apply to a link set document, the "profile" attribute
MAY be used in conjunction with the "linkset" link relation type.
For example, the attribute could be used to indicate that a link set
uses a specific, limited set of link relation types. The value of
the "profile" attribute MUST be a non-empty list of space-separated
URIs, each of which identifies specific constraints or conventions
that apply to the link set document. Profile URIs MAY be registered
in the IANA Profile URI Registry in the manner specified by
[RFC7284]. Section 7.4.1 shows an example of using the "profile"
attribute on a link with the "linkset" relation type, making both the
link set and the profile(s) to which it complies discoverable.
7. Examples 7. Examples
Section 7.1 and Section 7.2 show examples whereby a set of links is Section 7.1 and Section 7.2 show examples whereby a set of links is
provided as "application/linkset" and "application/linkset+json" provided as "application/linkset" and "application/linkset+json"
documents, respectively. Section 7.3 illustrates the use of the documents, respectively. Section 7.3 illustrates the use of the
"linkset" link relation type to support discovery of sets of links. "linkset" link relation type to support discovery of sets of links
and Section 7.4 shows how to convey profile information pertaining to
a links set.
7.1. Set of Links Provided as application/linkset 7.1. Set of Links Provided as application/linkset
Figure 7 shows a client issuing an HTTP GET request against resource Figure 7 shows a client issuing an HTTP GET request against resource
<https://example.org/links/resource1>. <https://example.org/links/resource1>.
GET /links/resource1 HTTP/1.1 GET /links/resource1 HTTP/1.1
Host: example.org Host: example.org
Figure 7: Client HTTP GET request Figure 7: Client HTTP GET request
skipping to change at page 20, line 20 skipping to change at page 20, line 20
; type="application/linkset+json" ; type="application/linkset+json"
Content-Length: 236 Content-Length: 236
Content-Type: text/html;charset=utf-8 Content-Type: text/html;charset=utf-8
Figure 12: Response to HTTP HEAD request Figure 12: Response to HTTP HEAD request
Section 7.2 shows a client obtaining a set of links by issuing an Section 7.2 shows a client obtaining a set of links by issuing an
HTTP GET on the target of the link with the "linkset" relation type, HTTP GET on the target of the link with the "linkset" relation type,
<https://example.org/links/resource1>. <https://example.org/links/resource1>.
7.4. Link Set Profiles
The examples in this section illustrate the use of the "profile"
attribute for a link with the "linkset" link relation type and the
"profile" attribute for a link set media type. The examples are
inspired by the implementation of link sets by GS1 (the standards
body behind many of the world's barcodes).
7.4.1. Using a "profile" Attribute with a "linkset" Link
Figure 13 shows a client issuing an HTTP HEAD request against trade
item 09506000134352 at <https://id.gs1.org/01/9506000134352>.
HEAD /01/9506000134352 HTTP/1.1
Host: id.gs1.org
Figure 13: Client HTTP HEAD request
Figure 14 shows the server's response to the request of Figure 13,
including a "linkset" link with a "profile" attribute that has the
Profile URI <https://www.gs1.org/voc/?show=linktypes> as its value.
Dereferencing that URI yields a profile document that lists all the
link relation types that a client can expect when requesting the link
set made discoverable by the "linkset" link. For posterity that
profile document was saved in the Internet Archive at
<https://web.archive.org/web/20210927160406/https://www.gs1.org/
voc/?show=linktypes> on 27 September 2021.
HTTP/1.1 307 Temporary Redirect
Date: Mon, 27 Sep 2021 16:03:07 GMT
Server: nginx
Link: https://id.gs1.org/01/9506000134352?linkType=all
; rel="linkset"
; type="application/linkset+json"
; profile="https://www.gs1.org/voc/?show=linktypes"
Location: https://dalgiardino.com/risotto-rice-with-mushrooms/
Figure 14: Response to the client's HEAD request including a
"profile" attribute for the "linkset" link
7.4.2. Using a "profile" Parameter with a Link Set Media Type
Figure 15 shows a client issuing an HTTP HEAD request against the
link set <https://id.gs1.org/01/9506000134352?linkType=all> that was
discovered through the HTTP interactions shown in Section 7.4.1.
HEAD /01/9506000134352?linkType=all HTTP/1.1
Host: id.gs1.org
Figure 15: Client HTTP HEAD request
Figure 16 shows the server's response to the request of Figure 15.
Note the "profile" parameter for the application/linkset+json media
type, which has as value the same Profile URI <https://www.gs1.org/
voc/?show=linktypes> as was used in xref target="Response_pr_at"/>.
HTTP/1.1 200 OK
Date: Mon, 27 Sep 2021 16:03:33 GMT
Server: nginx
Content-Type: application/linkset+json; profile="https://www.gs1.org/voc/?show=linktypes"
Content-Length: 396
Figure 16: Response to the client's HEAD request including a
"profile" parameter for the "application/linkset+json" media type
7.4.3. Using a Link with a "profile" Link Relation Type
Note that the response Figure 16 from the link set resource is
equivalent to the response shown in Figure 17, which leverages the
"profile" link relation type defined in [RFC6906].
HTTP/1.1 200 OK
Date: Mon, 27 Sep 2021 16:03:33 GMT
Server: nginx
Content-Type: application/linkset+json
Link: https://www.gs1.org/voc/?show=linktypes; rel="profile"
Content-Length: 396
Figure 17: Response to the client's HEAD request including a
"profile" link
A link with a "profile" link relation type as shown in Figure 17 can
also be conveyed in the link set document itself. This is
illustrated by Figure 18. Following the recommendation that all
links in a link set document should have an explicit anchor, such a
link has the URI of the link set itself as anchor and the Profile URI
as target. Multiple Profile URIs are handled by using multiple
"href" members.
{
"linkset":
[
{ "anchor": "https://id.gs1.org/01/9506000134352?linkType=all",
"profile": [
{"href": "https://www.gs1.org/voc/?show=linktypes"}
]
},
{ "anchor": "https://id.gs1.org/01/9506000134352",
"https://gs1.org/voc/whatsInTheBox": [
{"href": "https://example.com/en/packContents/GB"}
]
}
]
}
Figure 18: A Link Set that declares the profile it complies with
using a "profile" link
8. IANA Considerations 8. IANA Considerations
8.1. Link Relation Type: linkset 8.1. Link Relation Type: linkset
The link relation type below should be registered by IANA per The link relation type below should be registered by IANA per
Section 6.2.1 of Web Linking [RFC8288]: Section 6.2.1 of Web Linking [RFC8288]:
Relation Name: linkset Relation Name: linkset
Description: The link target of a link with the "linkset" relation Description: The link target of a link with the "linkset" relation
type provides a set of links, including links in which the link type provides a set of links, including links in which the link
context of the link participates. context of the link participates.
Reference: [[ This document ]] Reference: [[ This document ]]
8.2. Media Type: application/linkset 8.2. Media Type: application/linkset
The Internet media type [RFC6838] for a natively encoded linkset is The Internet media type [RFC6838] for a natively encoded linkset is
application/linkset. application/linkset.
skipping to change at page 24, line 44 skipping to change at page 27, line 16
DOI 10.17487/RFC6906, March 2013, DOI 10.17487/RFC6906, March 2013,
<https://www.rfc-editor.org/info/rfc6906>. <https://www.rfc-editor.org/info/rfc6906>.
[RFC7284] Lanthaler, M., "The Profile URI Registry", RFC 7284, [RFC7284] Lanthaler, M., "The Profile URI Registry", RFC 7284,
DOI 10.17487/RFC7284, June 2014, DOI 10.17487/RFC7284, June 2014,
<https://www.rfc-editor.org/info/rfc7284>. <https://www.rfc-editor.org/info/rfc7284>.
[I-D.ietf-httpbis-semantics] [I-D.ietf-httpbis-semantics]
Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP
Semantics", Work in Progress, Internet-Draft, draft-ietf- Semantics", Work in Progress, Internet-Draft, draft-ietf-
httpbis-semantics-15, 30 March 2021, httpbis-semantics-19, 12 September 2021,
<https://datatracker.ietf.org/doc/html/draft-ietf-httpbis- <https://datatracker.ietf.org/doc/html/draft-ietf-httpbis-
semantics-15>. semantics-19>.
11. Informative References 11. Informative References
[W3C.REC-json-ld-20140116] [W3C.REC-json-ld-20140116]
Sporny, M., Kellogg, G., and M. Lanthaler, "JSON-LD 1.0", Sporny, M., Kellogg, G., and M. Lanthaler, "JSON-LD 1.0",
World Wide Web Consortium Recommendation REC-json-ld- World Wide Web Consortium Recommendation REC-json-ld-
20140116, 16 January 2014, 20140116, 16 January 2014,
<https://www.w3.org/TR/2014/REC-json-ld-20140116>. <https://www.w3.org/TR/2014/REC-json-ld-20140116>.
[RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom
skipping to change at page 25, line 33 skipping to change at page 28, line 5
context [W3C.REC-json-ld-20140116] that maps the JSON keys to context [W3C.REC-json-ld-20140116] that maps the JSON keys to
corresponding Linked Data terms. And, as per corresponding Linked Data terms. And, as per
[W3C.REC-json-ld-20140116] section 6.8 (https://www.w3.org/TR/2014/ [W3C.REC-json-ld-20140116] section 6.8 (https://www.w3.org/TR/2014/
REC-json-ld-20140116/#interpreting-json-as-json-ld), when delivering REC-json-ld-20140116/#interpreting-json-as-json-ld), when delivering
a link set that is rendered according to the "application/ a link set that is rendered according to the "application/
linkset+json" media type to a user agent, a server can convey the linkset+json" media type to a user agent, a server can convey the
availability of such a JSON-LD context by using a link with the availability of such a JSON-LD context by using a link with the
relation type "http://www.w3.org/ns/json-ld#context" in the HTTP relation type "http://www.w3.org/ns/json-ld#context" in the HTTP
"Link" header. "Link" header.
Using the latter approach to support discovery of a JSON-LD Context, Figure 19 shows the response of an HTTP GET against the URI of a link
the response to the GET request of Figure 9 against the URI of a set set resource and illustrates this approach to support discovery of a
of links would be as shown in Figure 13. JSON-LD Context. The example is inspired by the GS1 implementation
and shows a link set that uses relation types from the GS1 vocabulary
at <https://www.gs1.org/voc/> that are expressed as HTTP URIs.
HTTP/1.1 200 OK HTTP/1.1 200 OK
Date: Mon, 12 Aug 2019 10:48:22 GMT Date: Mon, 11 Oct 2021 10:48:22 GMT
Server: Apache-Coyote/1.1 Server: Apache-Coyote/1.1
Content-Type: application/linkset+json Content-Type: application/linkset+json
Link: <https://example.org/contexts/linkset.jsonld> Link: <https://example.org/contexts/linkset.jsonld>
; rel="http://www.w3.org/ns/json-ld#context" ; rel="http://www.w3.org/ns/json-ld#context"
; type="application/ld+json" ; type="application/ld+json"
Content-Length: 1349 Content-Length: 1532
{ {
"linkset": [ "linkset": [
{ {
"anchor": "https://example.org/resource1", "anchor": "https://id.gs1.org/01/09506000149301",
"author": [ "https://gs1.org/voc/pip": [
{
"href": "https://authors.example.net/johndoe",
"type": "application/rdf+xml"
}
],
"memento": [
{ {
"href": "https://example.org/resource1?version=1", "href": "https://example.com/en/defaultPage",
"hreflang": [
"en"
],
"type": "text/html", "type": "text/html",
"datetime": "Thu, 13 Jun 2019 09:34:33 GMT" "title": "Product information"
}, },
{ {
"href": "https://example.org/resource1?version=2", "href": "https://example.com/fr/defaultPage",
"type": "text/html", "hreflang": [
"datetime": "Sun, 21 Jul 2019 12:22:04 GMT" "fr"
],
"title": "Information produit"
} }
], ],
"latest-version": [ "https://gs1.org/voc/whatsInTheBox": [
{ {
"href": "https://example.org/resource1?version=3", "href": "https://example.com/en/packContents/GB",
"type": "text/html" "hreflang": [
} "en"
] ],
}, "title": "What's in the box?"
{ },
"anchor": "https://example.org/resource1?version=3",
"predecessor-version": [
{ {
"href": "https://example.org/resource1?version=2", "href": "https://example.com/fr/packContents/FR",
"type": "text/html" "hreflang": [
} "fr"
] ],
}, "title": "Qu'y a-t-il dans la boite?"
{ },
"anchor": "https://example.org/resource1?version=2",
"predecessor-version": [
{ {
"href": "https://example.org/resource1?version=1", "href": "https://example.com/fr/packContents/CH",
"type": "text/html" "hreflang": [
"fr"
],
"title": "Qu'y a-t-il dans la boite?"
} }
] ],
}, "https://gs1.org/voc/relatedVideo": [
{
"anchor": "https://example.org/resource1#comment=1",
"author": [
{ {
"href": "https://authors.example.net/alice" "href": "https://video.example",
"hreflang": [
"en",
"fr"
],
"title*": [
{
"value": "See it in action!",
"language": "en"
},
{
"value": "Voyez-le en action!",
"language": "fr"
}
]
} }
] ]
} }
] ]
} }
Figure 13: Using a typed link to support discovery of a JSON-LD Figure 19: Using a typed link to support discovery of a JSON-LD
Context for a Set of Links Context for a Set of Links
In order to obtain the JSON-LD Context conveyed by the server, the In order to obtain the JSON-LD Context conveyed by the server, the
user agent issues an HTTP GET against the link target of the link user agent issues an HTTP GET against the link target of the link
with the "http://www.w3.org/ns/json-ld#context" relation type. The with the "http://www.w3.org/ns/json-ld#context" relation type. The
response to this GET is shown in Figure 14. This particular JSON-LD response to this GET is shown in Figure 20. This particular JSON-LD
context maps "application/linkset+json" representations of link sets context maps "application/linkset+json" representations of link sets
to Dublin Core Terms. It also renders each link relation as a URI to Dublin Core Terms. Note that the "linkset" entry in the JSON-LD
Reference, inspired by the same approach used for Atom [RFC4287] context is introduced to support links with the "linkset" relation
described in Appendix A.2 of [RFC8288]. type in link sets.
HTTP/1.1 200 OK HTTP/1.1 200 OK
Content-Type: application/ld+json Content-Type: application/ld+json
Content-Length: 708 Content-Length: 658
{ {
"@context": [ "@context": [
{ {
"@vocab": "http://www.iana.org/assignments/relation/", "@version": 1.1,
"anchor": "@id", "@vocab": "https://gs1.org/voc/",
"href": "@id", "anchor": "@id",
"linkset": "@graph", "href": "@id",
"_linkset": "@graph", "linkset": {
"title": { "@id": "@graph",
"@id": "http://purl.org/dc/terms/title" "@context": {
"linkset": "linkset"
}
}, },
"title*": { "title": {
"@id": "http://purl.org/dc/terms/title" "@id": "http://purl.org/dc/terms/title"
}, },
"type": { "title*": {
"@id": "http://purl.org/dc/terms/format" "@id": "http://purl.org/dc/terms/title"
}, },
"datetime": { "type": {
"@id": "http://purl.org/dc/terms/date" "@id": "http://purl.org/dc/terms/format"
} }
}, },
{ {
"language": "@language", "language": "@language",
"value": "@value", "value": "@value",
"hreflang": { "hreflang": {
"@id": "http://purl.org/dc/terms/language", "@id": "http://purl.org/dc/terms/language",
"@container": "@set" "@container": "@set"
} }
} }
] ]
} }
Figure 14: JSON-LD Context mapping to Dublin Core Terms and IANA Figure 20: JSON-LD Context mapping to Dublin Core Terms
assignments
Applying the JSON-LD context of Figure 14 to the link set of Applying the JSON-LD context of Figure 20 to the link set of
Figure 13 allows transforming the "application/linkset+json" link set Figure 19 allows transforming the "application/linkset+json" link set
to an RDF link set. Figure 15 shows the latter represented by means to an RDF link set. Figure 21 shows the latter represented by means
of the "text/turtle" RDF serialization. of the "text/turtle" RDF serialization.
<https://authors.example.net/johndoe> <https://example.com/en/defaultPage>
<http://purl.org/dc/terms/format> <http://purl.org/dc/terms/format>
"application/rdf+xml" . "text/html" .
<https://example.org/resource1#comment=1> <https://example.com/en/defaultPage>
<http://www.iana.org/assignments/relation/author> <http://purl.org/dc/terms/language>
<https://authors.example.net/alice> . "en" .
<https://example.org/resource1> <https://example.com/en/defaultPage>
<http://www.iana.org/assignments/relation/author> <http://purl.org/dc/terms/title>
<https://authors.example.net/johndoe> . "Product information" .
<https://example.org/resource1> <https://example.com/en/packContents/GB>
<http://www.iana.org/assignments/relation/latest-version> <http://purl.org/dc/terms/language>
<https://example.org/resource1?version=3> . "en" .
<https://example.org/resource1> <https://example.com/en/packContents/GB>
<http://www.iana.org/assignments/relation/memento> <http://purl.org/dc/terms/title>
<https://example.org/resource1?version=1> . "What's in the box?" .
<https://example.org/resource1> <https://example.com/fr/defaultPage>
<http://www.iana.org/assignments/relation/memento> <http://purl.org/dc/terms/language>
<https://example.org/resource1?version=2> . "fr" .
<https://example.org/resource1?version=1> <https://example.com/fr/defaultPage>
<http://purl.org/dc/terms/date> <http://purl.org/dc/terms/title>
"Thu, 13 Jun 2019 09:34:33 GMT" . "Information produit" .
<https://example.org/resource1?version=1> <https://example.com/fr/packContents/CH>
<http://purl.org/dc/terms/format> <http://purl.org/dc/terms/language>
"text/html" . "fr" .
<https://example.org/resource1?version=2> <https://example.com/fr/packContents/CH>
<http://purl.org/dc/terms/date> <http://purl.org/dc/terms/title>
"Sun, 21 Jul 2019 12:22:04 GMT" . "Qu'y a-t-il dans la boite?" .
<https://example.org/resource1?version=2> <https://example.com/fr/packContents/FR>
<http://purl.org/dc/terms/format> <http://purl.org/dc/terms/language>
"text/html" . "fr" .
<https://example.org/resource1?version=2> <https://example.com/fr/packContents/FR>
<http://www.iana.org/assignments/relation/predecessor-version> <http://purl.org/dc/terms/title>
<https://example.org/resource1?version=1> . "Qu'y a-t-il dans la boite?" .
<https://example.org/resource1?version=3> <https://id.gs1.org/01/09506000149301>
<http://purl.org/dc/terms/format> <https://gs1.org/voc/pip>
"text/html" . <https://example.com/en/defaultPage> .
<https://example.org/resource1?version=3> <https://id.gs1.org/01/09506000149301>
<http://www.iana.org/assignments/relation/predecessor-version> <https://gs1.org/voc/pip>
<https://example.org/resource1?version=2> . <https://example.com/fr/defaultPage> .
<https://id.gs1.org/01/09506000149301>
<https://gs1.org/voc/relatedVideo>
<https://video.example> .
<https://id.gs1.org/01/09506000149301>
<https://gs1.org/voc/whatsInTheBox>
<https://example.com/en/packContents/GB> .
<https://id.gs1.org/01/09506000149301>
<https://gs1.org/voc/whatsInTheBox>
<https://example.com/fr/packContents/CH> .
Figure 15: RDF serialization of the link set resulting from <https://id.gs1.org/01/09506000149301>
applying the JSON-LD context <https://gs1.org/voc/whatsInTheBox>
<https://example.com/fr/packContents/FR> .
<https://video.example>
<http://purl.org/dc/terms/language>
"en" .
<https://video.example>
<http://purl.org/dc/terms/language>
"fr" .
<https://video.example>
<http://purl.org/dc/terms/title>
"See it in action!"@en .
<https://video.example>
<http://purl.org/dc/terms/title>
"Voyez-le en action!"@fr .
Note that the JSON-LD context of Figure 14 does not handle (meta)link Figure 21: RDF serialization of the link set resulting from
relations of type ""linkset"" as they are in conflict with the top- applying the JSON-LD context
level JSON key. A workaround is to rename the top-level key to
""_linkset"" in the "application/linkset+json" before transforming a
link set to JSON-LD.
Appendix B. Implementation Status Appendix B. Implementation Status
This section is to be removed before publishing as an RFC. This section is to be removed before publishing as an RFC.
This section records the status of known implementations of the This section records the status of known implementations of the
protocol defined by this specification at the time of posting of this protocol defined by this specification at the time of posting of this
Internet-Draft, and is based on a proposal described in RFC 6982 Internet-Draft, and is based on a proposal described in RFC 6982
[RFC6982]. The description of implementations in this section is [RFC6982]. The description of implementations in this section is
intended to assist the IETF in its decision processes in progressing intended to assist the IETF in its decision processes in progressing
skipping to change at page 31, line 34 skipping to change at page 33, line 47
federally funded efforts to expand and improve access to research. federally funded efforts to expand and improve access to research.
The OJS platform has implemented "linkset" support as an alternative The OJS platform has implemented "linkset" support as an alternative
way to provide links when there are more than a configured limit way to provide links when there are more than a configured limit
(they consider using about 10 as a good default, for testing purpose (they consider using about 10 as a good default, for testing purpose
it is currently set to 8). it is currently set to 8).
Acknowledgements Acknowledgements
Thanks for comments and suggestions provided by Phil Archer, Thanks for comments and suggestions provided by Phil Archer,
Dominique Guinard, Mark Nottingham, Julian Reschke, Stian Soiland- Dominique Guinard, Mark Nottingham, Julian Reschke, Rob Sanderson,
Reyes, and Sarven Capadisli. Stian Soiland-Reyes, and Sarven Capadisli.
Authors' Addresses Authors' Addresses
Erik Wilde Erik Wilde
Axway Axway
Email: erik.wilde@dret.net Email: erik.wilde@dret.net
URI: http://dret.net/netdret/ URI: http://dret.net/netdret/
Herbert Van de Sompel Herbert Van de Sompel
Data Archiving and Networked Services Data Archiving and Networked Services
Email: herbert.van.de.sompel@dans.knaw.nl Email: herbert.van.de.sompel@dans.knaw.nl
 End of changes. 67 change blocks. 
199 lines changed or deleted 365 lines changed or added

This html diff was produced by rfcdiff 1.48. The latest version is available from http://tools.ietf.org/tools/rfcdiff/