idnits 2.17.1 draft-ietf-httpapi-linkset-03.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- == There is 1 instance of lines with non-ascii characters in the document. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (4 July 2021) is 1026 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- ** Obsolete normative reference: RFC 6982 (Obsoleted by RFC 7942) == Outdated reference: A later version (-19) exists of draft-ietf-httpbis-semantics-15 -- Obsolete informational reference (is this intentional?): RFC 5988 (Obsoleted by RFC 8288) Summary: 1 error (**), 0 flaws (~~), 3 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 Network Working Group E. Wilde 3 Internet-Draft Axway 4 Intended status: Informational H. Van de Sompel 5 Expires: 5 January 2022 Data Archiving and Networked Services 6 4 July 2021 8 Linkset: Media Types and a Link Relation Type for Link Sets 9 draft-ietf-httpapi-linkset-03 11 Abstract 13 This specification defines two document formats and respective media 14 types for representing sets of links as stand-alone resources. One 15 format is JSON-based, the other aligned with the format for 16 representing links in the HTTP "Link" header field. This 17 specification also introduces a link relation type to support 18 discovery of sets of links. 20 Note to Readers 22 Please discuss this draft on the "Building Blocks for HTTP APIs" 23 mailing list (https://www.ietf.org/mailman/listinfo/httpapi). 25 Online access to all versions and files is available on GitHub 26 (https://github.com/ietf-wg-httpapi/linkset). 28 Status of This Memo 30 This Internet-Draft is submitted in full conformance with the 31 provisions of BCP 78 and BCP 79. 33 Internet-Drafts are working documents of the Internet Engineering 34 Task Force (IETF). Note that other groups may also distribute 35 working documents as Internet-Drafts. The list of current Internet- 36 Drafts is at https://datatracker.ietf.org/drafts/current/. 38 Internet-Drafts are draft documents valid for a maximum of six months 39 and may be updated, replaced, or obsoleted by other documents at any 40 time. It is inappropriate to use Internet-Drafts as reference 41 material or to cite them other than as "work in progress." 43 This Internet-Draft will expire on 5 January 2022. 45 Copyright Notice 47 Copyright (c) 2021 IETF Trust and the persons identified as the 48 document authors. All rights reserved. 50 This document is subject to BCP 78 and the IETF Trust's Legal 51 Provisions Relating to IETF Documents (https://trustee.ietf.org/ 52 license-info) in effect on the date of publication of this document. 53 Please review these documents carefully, as they describe your rights 54 and restrictions with respect to this document. Code Components 55 extracted from this document must include Simplified BSD License text 56 as described in Section 4.e of the Trust Legal Provisions and are 57 provided without warranty as described in the Simplified BSD License. 59 Table of Contents 61 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 62 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 63 3. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 3 64 3.1. Third-Party Links . . . . . . . . . . . . . . . . . . . . 4 65 3.2. Challenges Writing to HTTP Link Header Field . . . . . . 4 66 3.3. Large Number of Links . . . . . . . . . . . . . . . . . . 5 67 4. Document Formats for Sets of Links . . . . . . . . . . . . . 5 68 4.1. HTTP Link Document Format: application/linkset . . . . . 6 69 4.2. JSON Document Format: application/linkset+json . . . . . 6 70 4.2.1. Set of Links . . . . . . . . . . . . . . . . . . . . 7 71 4.2.2. Link Context Object . . . . . . . . . . . . . . . . . 7 72 4.2.3. Link Target Object . . . . . . . . . . . . . . . . . 8 73 4.2.4. Link Target Attributes . . . . . . . . . . . . . . . 10 74 4.2.5. JSON Extensibility . . . . . . . . . . . . . . . . . 14 75 5. The "profile" attribute for media types to Represent Sets of 76 Links . . . . . . . . . . . . . . . . . . . . . . . . . . 15 77 6. The "linkset" Relation Type for Linking to a Set of Links . . 15 78 7. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 16 79 7.1. Set of Links Provided as application/linkset . . . . . . 16 80 7.2. Set of Links Provided as application/linkset+json . . . . 17 81 7.3. Discovering a Link Set via the "linkset" Link Relation 82 Type . . . . . . . . . . . . . . . . . . . . . . . . . . 19 83 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 84 8.1. Link Relation Type: linkset . . . . . . . . . . . . . . . 20 85 8.2. Media Type: application/linkset . . . . . . . . . . . . . 20 86 8.3. Media Type: application/linkset+json . . . . . . . . . . 21 87 9. Security Considerations . . . . . . . . . . . . . . . . . . . 22 88 10. Normative References . . . . . . . . . . . . . . . . . . . . 23 89 11. Informative References . . . . . . . . . . . . . . . . . . . 24 90 Appendix A. JSON-LD Context . . . . . . . . . . . . . . . . . . 25 91 Appendix B. Implementation Status . . . . . . . . . . . . . . . 30 92 B.1. GS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 93 B.2. FAIR Signposting Profile . . . . . . . . . . . . . . . . 31 94 B.3. Open Journal Systems (OJS) . . . . . . . . . . . . . . . 31 95 Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . 31 96 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 31 98 1. Introduction 100 Resources on the Web often use typed Web Links [RFC8288], either 101 embedded in resource representations, for example using the 102 element for HTML documents, or conveyed in the HTTP "Link" header 103 field for documents of any media type. In some cases, however, 104 providing links in this manner is impractical or impossible and 105 delivering a set of links as a stand-alone document is preferable. 107 Therefore, this specification defines two document formats and 108 associated media types to represent sets of links. It also defines 109 the "linkset" relation type that supports discovery of any resource 110 that conveys a set of links as a stand-alone document. 112 2. Terminology 114 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 115 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 116 "OPTIONAL" in this document are to be interpreted as described in BCP 117 14 [RFC2119] [RFC8174] when, and only when, they appear in all 118 capitals, as shown here. 120 This specification uses the terms "link context" and "link target" as 121 defined in [RFC8288]. 123 In the examples provided in this document, links in the HTTP "Link" 124 header field are shown on separate lines in order to improve 125 readability. Note, however, that as per Section 5.5 of 126 [I-D.ietf-httpbis-semantics], line breaks are deprecated in values 127 for HTTP fields; only whitespaces and tabs are supported as 128 separators. 130 3. Scenarios 132 The following sections outline scenarios in which providing links by 133 means of a standalone document instead of in an HTTP "Link" header 134 field or as links embedded in the resource representation is 135 advantageous or necessary. 137 For all scenarios, links could be provided by means of a stand-alone 138 document that is formatted according to the JSON-based serialization, 139 the serialization aligned with the HTTP "Link" field format, or both. 140 The former serialization is motivated by the widespread use of JSON 141 and related tools, which suggests that handling sets of links 142 expressed as JSON documents should be attractive to developers. The 143 latter serialization is provided for compatibility with the existing 144 serialization used in the HTTP "Link" field and to allow reuse of 145 tools created to handle it. 147 It is important to keep in mind that when providing links by means of 148 a standalone representation, other links can still be provided using 149 other approaches, i.e. it is possible combine various mechanisms to 150 convey links. 152 3.1. Third-Party Links 154 In some cases it is useful that links pertaining to a resource are 155 provided by a server other than the one that hosts the resource. For 156 example, this allows: 158 * Providing links in which the resource is involved not just as link 159 context but also as link target. 161 * Providing links pertaining to the resource that the server hosting 162 that resource is not aware of. 164 * External management of links pertaining to the resource in a 165 special-purpose link management service. 167 In such cases, links pertaining to a resource can be provided by 168 another, specific resource. That specific resource may be managed by 169 the same or by another custodian as the resource to which the links 170 pertain. For clients intent on consuming links provided in that 171 manner, it would be beneficial if the following conditions were met: 173 * Links are provided in a document that uses a well-defined media 174 type. 176 * The resource to which the provided links pertain is able to link 177 to the resource that provides these links using a well-known link 178 relation type. 180 These requirements are addressed in this specification through the 181 definition of two media types and a link relation type, respectively. 183 3.2. Challenges Writing to HTTP Link Header Field 185 In some cases, it is not straightforward to write links to the HTTP 186 "Link" header field from an application. This can, for example, be 187 the case because not all required link information is available to 188 the application or because the application does not have the 189 capability to directly write HTTP fields. In such cases, providing 190 links by means of a standalone document can be a solution. Making 191 the resource that provides these links discoverable can be achieved 192 by means of a typed link. 194 3.3. Large Number of Links 196 When conveying links in an HTTP "Link" header field, it is possible 197 for the size of the HTTP response fields to become unpredictable. 198 This can be the case when links are determined dynamically dependent 199 on a range of contextual factors. It is possible to statically 200 configure a web server to correctly handle large HTTP response fields 201 by specifying an upper bound for their size. But when the number of 202 links is unpredictable, estimating a reliable upper bound is 203 challenging. 205 Section 15 of HTTP [I-D.ietf-httpbis-semantics] defines error codes 206 related to excess communication by the user agent ("413 Request 207 Entity Too Large" and "414 Request-URI Too Long"), but no specific 208 error codes are defined to indicate that response field content 209 exceeds the upper bound that can be handled by the server, and thus 210 it has been truncated. As a result, applications take counter 211 measures aimed at controlling the size of the HTTP "Link" header 212 field, for example by limiting the links they provide to those with 213 select relation types, thereby limiting the value of the HTTP "Link" 214 header field to clients. Providing links by means of a standalone 215 document overcomes challenges related to the unpredictable nature of 216 the size of HTTP "Link" header fields. 218 4. Document Formats for Sets of Links 220 This section specifies two document formats to convey a set of links. 221 Both are based on the abstract model specified in Section 2 of Web 222 Linking [RFC8288] that defines a link as consisting of a "link 223 context", a "link relation type", a "link target", and optional 224 "target attributes": 226 * The format defined in Section 4.1 is identical to the payload of 227 the HTTP "Link" header field as specified in Web Linking Section 3 228 of [RFC8288]. 230 * The format defined in Section 4.2 is based on JSON [RFC8259]. 232 Note that Section 3.3 of [RFC8288] deprecates the "rev" construct 233 that was provided by [RFC5988] as a means to express links with a 234 directionality that is the inverse of direct links that use the "rel" 235 construct. In both serializations for link sets defined here, 236 inverse links SHOULD be represented as direct links using the "rel" 237 construct and by switching the position of the resources involved in 238 the link. 240 4.1. HTTP Link Document Format: application/linkset 242 This document format is identical to the payload of the HTTP "Link" 243 header field as defined in Section 3 of [RFC8288], more specifically 244 by its ABNF production rule for "Link" and subsequent ones. The use 245 of non-ASCII characters in the payload of the HTTP "Link" Header 246 field is not interoperable. 248 The assigned media type for this format is "application/linkset". 250 In order to support use cases where "application/linkset" documents 251 are re-used outside the context of an HTTP interaction, it is 252 RECOMMENDED to make them self-contained by adhering to the following 253 guidelines: 255 * For every link provided in the set of links, explicitly provide 256 the link context using the "anchor" attribute. 258 * For link context ("anchor" attribute) and link target ("href" 259 attribute), use URI References that are not relative references 260 (as defined in Section 4.1 of [RFC3986]). 262 If these recommendations are not followed, interpretation of links in 263 "application/linkset" documents will depend on which URI is used as 264 context. 266 It should be noted that the "application/linkset" format specified 267 here is different than the "application/link-format" format specified 268 in [RFC6690] in that the former fully matches the payload of the HTTP 269 "Link" header field as defined in Section 3 of [RFC8288], whereas the 270 latter introduces constraints on that definition to meet requirements 271 for Constrained RESTful Environments. 273 4.2. JSON Document Format: application/linkset+json 275 This document format uses JSON [RFC8259] as the syntax to represent a 276 set of links. The set of links follows the abstract model defined by 277 Web Linking Section 2 of [RFC8288]. 279 The assigned media type for this format is "application/ 280 linkset+json". 282 In order to support use cases where "application/linkset+json" 283 documents are re-used outside the context of an HTTP interaction, it 284 is RECOMMENDED to make them self-contained by adhering to the 285 following guidelines: 287 * For every link provided in the set of links, explicitly provide 288 the link context using the "anchor" member. 290 * For link context ("anchor" member) and link target ("href" 291 member), use URI References that are not relative references (as 292 defined in Section 4.1 of [RFC3986]). 294 If these recommendations are not followed, interpretation of 295 "application/linkset+json" will depend on which URI is used as 296 context URI. 298 The "application/linkset+json" serialization is designed such that it 299 can directly be used as the content of a JSON-LD serialization by 300 adding an appropriate context. Appendix A shows an example of a 301 possible context that, when added to a JSON serialization, allows it 302 to be interpreted as RDF. 304 4.2.1. Set of Links 306 In the JSON representation of a set of links: 308 * A set of links MUST be represented as a JSON object which MUST 309 have "linkset" as its sole member. 311 * The "linkset" member is an array in which a distinct JSON object - 312 the "link context object" (see Section 4.2.2) - MUST be used to 313 represent links that have the same link context. 315 * Even if there is only one link context object, it MUST be wrapped 316 in an array. Members other than link context objects MUST NOT be 317 included in this array. 319 4.2.2. Link Context Object 321 In the JSON representation one or more links that have the same link 322 context are represented by a JSON object, the link context object. A 323 link context object adheres to the following rules: 325 * Each link context object MAY have an "anchor" member with a value 326 that represents the link context. If present, this value MUST be 327 a URI Reference and SHOULD NOT be a relative reference as per 328 Section 4.1 of [RFC3986]. 330 * For each distinct relation type that the link context has with 331 link targets, a link context object MUST have an additional 332 member. This member is an array in which a distinct JSON object - 333 the "link target object" (see Section 4.2.3) - MUST be used for 334 each link target for which the relationship with the link context 335 (value of the encompassing anchor member) applies. The name of 336 this member expresses the relation type of the link as follows: 338 - For registered relation types (Section 2.1.1 of [RFC8288]), the 339 name of this member is the registered name of the relation 340 type. 342 - For extension relation types (Section 2.1.2 of [RFC8288]), the 343 name of this member is the URI that uniquely represents the 344 relation type. 346 * Even if there is only one link target object it MUST be wrapped in 347 an array. Members other than link target objects MUST NOT be 348 included in this array. 350 4.2.3. Link Target Object 352 In the JSON representation a link target is represented by a JSON 353 object, the link target object. A link target object adheres to the 354 following rules: 356 * Each link target object MUST have an "href" member with a value 357 that represents the link target. This value MUST be a URI 358 Reference and SHOULD NOT be a relative reference as per 359 Section 4.1 of [RFC3986]. Cases where the href member is present, 360 but no value is provided for it (i.e. the resource providing the 361 set of links is the target of the link in the link target object) 362 MUST be handled by providing an "href" member with an empty string 363 ("href": ""). 365 * In many cases, a link target is further qualified by target 366 attributes. Various types of attributes exist and they are 367 conveyed as additional members of the link target object as 368 detailed in Section 4.2.4. 370 The following example of a JSON-serialized set of links represents 371 one link with its core components: link context, link relation type, 372 and link target. 374 { 375 "linkset": 376 [ 377 { "anchor": "http://example.net/bar", 378 "next": [ 379 {"href": "http://example.com/foo"} 380 ] 381 } 382 ] 383 } 385 Figure 1 387 The following example of a JSON-serialized set of links represents 388 two links that share link context and relation type but have 389 different link targets. 391 { 392 "linkset": 393 [ 394 { "anchor": "http://example.net/bar", 395 "item": [ 396 {"href": "http://example.com/foo1"}, 397 {"href": "http://example.com/foo2"} 398 ] 399 } 400 ] 401 } 403 Figure 2 405 The following example shows a set of links that represents two links, 406 each with a different link context, link target, and relation type. 407 One relation type is registered, the other is an extension relation 408 type. 410 { 411 "linkset": 412 [ 413 { "anchor": "http://example.net/bar", 414 "next": [ 415 {"href": "http://example.com/foo1"} 416 ] 417 }, 418 { "anchor": "http://example.net/boo", 419 "http://example.com/relations/baz" : [ 420 {"href": "http://example.com/foo2"} 421 ] 422 } 423 ] 424 } 426 Figure 3 428 4.2.4. Link Target Attributes 430 A link may be further qualified by target attributes. Three types of 431 attributes exist: 433 * Attributes defined in Section 3.4.1 of Web Linking [RFC8288]. 435 * Extension attributes defined and used by communities as allowed by 436 Section 3.4.2 of [RFC8288]. 438 * Internationalized versions of the "title" attribute defined by 439 [RFC8288] and of extension attributes allowed by Section 3.4 of 440 [RFC8288]. 442 The handling of these different types of attributes is described in 443 the sections below. 445 4.2.4.1. Target Attributes Defined by Web Linking 447 Section 3.4.1 of [RFC8288] defines the following target attributes 448 that may be used to annotate links: "hreflang", "media", "title", 449 "title*", and "type"; these target attributes follow different 450 occurrence and value patterns. In the JSON representation, these 451 attributes MUST be conveyed as additional members of the link target 452 object as follows: 454 * "hreflang": The optional and repeatable "hreflang" target 455 attribute MUST be represented by an array (even if there only is 456 one value to be represented), and each value in that array MUST be 457 a string - representing one value of the "hreflang" target 458 attribute for a link - which follows the same model as in the 459 [RFC8288] syntax. 461 * "media": The optional and not repeatable "media" target attribute 462 MUST be represented by a "media" member in the link target object, 463 and its value MUST be a string that follows the same model as in 464 the [RFC8288] syntax. 466 * "type": The optional and not repeatable "type" target attribute 467 MUST be represented by a "type" member in the link target object, 468 and its value MUST be a string that follows the same model as in 469 the [RFC8288] syntax. 471 * "title": The optional and not repeatable "title" target attribute 472 MUST be represented by a "title" member in the link target object, 473 and its value MUST be a string that follows the same model as in 474 the [RFC8288] syntax. 476 * "title*": The optional and not repeatable "title*" target 477 attribute is motivated by character encoding and language issues 478 and follows the model defined in [RFC8187]. The details of the 479 JSON representation that applies to title* are described in 480 Section 4.2.4.2. 482 The following example illustrates how the repeatable "hreflang" and 483 the not repeatable "type" target attributes are represented in a link 484 target object. 486 { 487 "linkset": 488 [ 489 { "anchor": "http://example.net/bar", 490 "next": [ 491 {"href": "http://example.com/foo", 492 "type": "text/html", 493 "hreflang": [ "en" , "de" ] 494 } 495 ] 496 } 497 ] 498 } 500 Figure 4 502 4.2.4.2. Internationalized Target Attributes 504 In addition to the target attributes described in Section 4.2.4.1, 505 Section 3.4 of [RFC8288] also supports attributes that follow the 506 content model of [RFC8187]. In [RFC8288], these target attributes 507 are recognizable by the use of a trailing asterisk in the attribute 508 name, such as "title*". The content model of [RFC8187] uses a 509 string-based microsyntax that represents the character encoding, an 510 optional language tag, and the escaped attribute value encoded 511 according to the specified character encoding. 513 The JSON serialization for these target attributes MUST be as 514 follows: 516 * An internationalized target attribute is represented as a member 517 of the link context object with the same name (including the *) of 518 the attribute. 520 * The character encoding information as prescribed by [RFC8187] is 521 not preserved; instead, the content of the internationalized 522 attribute is represented in the character encoding used for the 523 JSON set of links. 525 * The value of the internationalized target attribute is an array 526 that contains one or more JSON objects. The name of one member of 527 such JSON object is "value" and its value is the actual content 528 (in its unescaped version) of the internationalized target 529 attribute, i.e. the value of the attribute from which the encoding 530 and language information are removed. The name of another, 531 optional, member of such JSON object is "language" and its value 532 is the language tag [RFC5646] for the language in which the 533 attribute content is conveyed. 535 The following example illustrates how the "title*" target attribute 536 defined by Section 3.4.1 of [RFC8288] is represented in a link target 537 object. 539 { 540 "linkset": 541 [ 542 { "anchor": "http://example.net/bar", 543 "next": [ 544 {"href": "http://example.com/foo", 545 "type": "text/html", 546 "hreflang": [ "en" , "de" ], 547 "title": "Next chapter", 548 "title*": [ { "value": "nächstes Kapitel" , 549 "language" : "de" } ] 550 } 551 ] 552 } 553 ] 554 } 556 Figure 5 558 The above example assumes that the German title contains an umlaut 559 character (in the native syntax it would be encoded as title*=UTF- 560 8'de'n%c3%a4chstes%20Kapitel), which gets encoded in its unescaped 561 form in the JSON representation. Implementations MUST properly 562 decode/encode internationalized target attributes that follow the 563 model of [RFC8187] when transcoding between the "application/linkset" 564 and the "application/linkset+json" formats. 566 4.2.4.3. Extension Target Attributes 568 Extension target attributes are attributes that are not defined by 569 Section 3.4.1 of [RFC8288] (as listed in Section 4.2.4.1), but are 570 nevertheless used to qualify links. They can be defined by 571 communities in any way deemed necessary, and it is up to them to make 572 sure their usage is understood by target applications. However, 573 lacking standardization, there is no interoperable understanding of 574 these extension attributes. One important consequence is that their 575 cardinality is unknown to generic applications. Therefore, in the 576 JSON serialization, all extension target attributes are treated as 577 repeatable. 579 The JSON serialization for these target attributes MUST be as 580 follows: 582 * An extension target attribute is represented as a member of the 583 link context object with the same name of the attribute, including 584 the * if applicable. 586 * The value of an extension attribute MUST be represented by an 587 array, even if there only is one value to be represented. 589 * If the extension target attribute does not have a name with a 590 trailing asterisk, then each value in that array MUST be a string 591 that represents one value of the attribute. 593 * If the extension attribute has a name with a trailing asterisk (it 594 follows the content model of [RFC8187]), then each value in that 595 array MUST be a JSON object. The value of each such JSON object 596 MUST be structured as described in Section 4.2.4.2. 598 The example shows a link target object with three extension target 599 attributes. The value for each extension target attribute is an 600 array. The two first are regular extension target attributes, with 601 the first one ("foo") having only one value and the second one 602 ("bar") having two. The last extension target attribute ("baz*") 603 follows the naming rule of [RFC8187] and therefore is encoded 604 according to the serialization described in Section 4.2.4.2. 606 { 607 "linkset": 608 [ 609 { "anchor": "http://example.net/bar", 610 "next": [ 611 { "href": "http://example.com/foo", 612 "type": "text/html", 613 "foo": [ "foovalue" ], 614 "bar": [ "barone", "bartwo" ], 615 "baz*": [ { "value": "bazvalue" , 616 "language" : "en" } ] 617 } 618 ] 619 } 620 ] 621 } 623 Figure 6 625 4.2.5. JSON Extensibility 627 The extensibility of the JSON document format for representing a set 628 of links is restricted to the extensibility provided by [RFC8288]. 629 The Web linking model provides for the use of extension target 630 attributes as discussed in Section 4.2.4.3. Extensions based on the 631 JSON syntax MUST NOT be used, and MUST be ignored when found in a 632 JSON linkset document. 634 This limitation of the JSON format allows to unambiguously round trip 635 between links provided in the HTTP "Link" header field, sets of links 636 serialized according to the "application/linkset" format, and sets of 637 links serialized according to the "application/linkset+json" format. 639 5. The "profile" attribute for media types to Represent Sets of Links 641 As a means to convey specific constraints or conventions (as per 642 [RFC6906]) that apply to a link set document, the "profile" attribute 643 MAY be used in conjunction with the media types "application/linkset" 644 and "application/linkset+json" detailed in Section 4.1 and 645 Section 4.2, respectively. For example, the attribute could be used 646 to indicate that a link set uses a specific, limited set of link 647 relation types. 649 The value of the "profile" attribute MUST be a non-empty list of 650 space-separated URIs, each of which identifies specific constraints 651 or conventions that apply to the link set document. Profile URIs MAY 652 be registered in the IANA Profile URI Registry in the manner 653 specified by [RFC7284]. 655 The presence of a "profile" attribute in conjunction with the 656 "application/linkset" and "application/linkset+json" media types does 657 not change the semantics of a link set. As such, clients with and 658 without knowledge of profile URIs can use the same representation. 660 6. The "linkset" Relation Type for Linking to a Set of Links 662 The target of a link with the "linkset" relation type provides a set 663 of links, including links in which the resource that is the link 664 context participates. 666 A link with the "linkset" relation type MAY be provided in the header 667 field and/or the body of a resource's representation. It may also be 668 discovered by other means, such as through client-side information. 670 A resource MAY provide more than one link with a "linkset" relation 671 type. Multiple such links can refer to the same set of links 672 expressed using different media types, or to different sets of links, 673 potentially provided by different third-party services. 675 A user agent that follows a "linkset" link MUST be aware that the set 676 of links provided by the resource that is the target of the link can 677 contain links in which the resource that is the context of the link 678 does not participate; it MAY decide to ignore those links. 680 A user agent that follows a "linkset" link and obtains links for 681 which anchors and targets are expressed as relative references (as 682 per Section 4.1 of [RFC3986]) MUST determine what the context is for 683 these links; it SHOULD ignore links for which it is unable to 684 unambiguously make that determination. 686 7. Examples 688 Section 7.1 and Section 7.2 show examples whereby a set of links is 689 provided as "application/linkset" and "application/linkset+json" 690 documents, respectively. Section 7.3 illustrates the use of the 691 "linkset" link relation type to support discovery of sets of links. 693 7.1. Set of Links Provided as application/linkset 695 Figure 7 shows a client issuing an HTTP GET request against resource 696 . 698 GET /links/resource1 HTTP/1.1 699 Host: example.org 701 Figure 7: Client HTTP GET request 703 Figure 8 shows the response to the GET request of Figure 7. The 704 response contains a Content-Type header field specifying that the 705 media type of the response is "application/linkset". A set of links, 706 revealing authorship and versioning related to resource 707 , is provided in the response body. 708 The HTTP "Link" header field indicates the availability of an 709 alternate representation of the set of links using media type 710 "application/linkset+json". 712 HTTP/1.1 200 OK 713 Date: Mon, 12 Aug 2019 10:35:51 GMT 714 Server: Apache-Coyote/1.1 715 Content-Length: 1023 716 Content-Type: application/linkset 717 Link: 718 ; rel="alternate" 719 ; type="application/linkset+json" 721 722 ; rel="author" 723 ; type="application/rdf+xml" 724 ; anchor="https://example.org/resource1", 725 726 ; rel="latest-version" 727 ; type="text/html" 728 ; anchor="https://example.org/resource1", 729 730 ; rel="predecessor-version" 731 ; type="text/html" 732 ; anchor="https://example.org/resource1?version=3", 733 734 ; rel="predecessor-version" 735 ; type="text/html" 736 ; anchor="https://example.org/resource1?version=2", 737 738 ; rel="memento" 739 ; type="text/html" 740 ; datetime="Thu, 13 Jun 2019 09:34:33 GMT" 741 ; anchor="https://example.org/resource1", 742 743 ; rel="memento" 744 ; type="text/html" 745 ; datetime="Sun, 21 Jul 2019 12:22:04 GMT" 746 ; anchor="https://example.org/resource1", 747 748 ; rel="author" 749 ; anchor="https://example.org/resource1#comment=1" 751 Figure 8: Response to HTTP GET includes a set of links 753 7.2. Set of Links Provided as application/linkset+json 755 Figure 9 shows the client issuing an HTTP GET request against 756 . In the request, the client 757 uses an "Accept" header field to indicate it prefers a response in 758 the "application/linkset+json" format. 760 GET links/resource1 HTTP/1.1 761 Host: example.org 762 Accept: application/linkset+json 764 Figure 9: Client HTTP GET request expressing preference for 765 "application/ linkset+json" response 767 Figure 10 shows the response to the HTTP GET request of Figure 9. 768 The set of links is serialized according to the media type 769 "application/linkset+json". 771 HTTP/1.1 200 OK 772 Date: Mon, 12 Aug 2019 10:46:22 GMT 773 Server: Apache-Coyote/1.1 774 Content-Type: application/linkset+json 775 Link: 776 ; rel="alternate" 777 ; type="application/linkset" 778 Content-Length: 1349 780 { 781 "linkset": [ 782 { 783 "anchor": "https://example.org/resource1", 784 "author": [ 785 { 786 "href": "https://authors.example.net/johndoe", 787 "type": "application/rdf+xml" 788 } 789 ], 790 "memento": [ 791 { 792 "href": "https://example.org/resource1?version=1", 793 "type": "text/html", 794 "datetime": "Thu, 13 Jun 2019 09:34:33 GMT" 795 }, 796 { 797 "href": "https://example.org/resource1?version=2", 798 "type": "text/html", 799 "datetime": "Sun, 21 Jul 2019 12:22:04 GMT" 800 } 801 ], 802 "latest-version": [ 803 { 804 "href": "https://example.org/resource1?version=3", 805 "type": "text/html" 806 } 807 ] 809 }, 810 { 811 "anchor": "https://example.org/resource1?version=3", 812 "predecessor-version": [ 813 { 814 "href": "https://example.org/resource1?version=2", 815 "type": "text/html" 816 } 817 ] 818 }, 819 { 820 "anchor": "https://example.org/resource1?version=2", 821 "predecessor-version": [ 822 { 823 "href": "https://example.org/resource1?version=1", 824 "type": "text/html" 825 } 826 ] 827 }, 828 { 829 "anchor": "https://example.org/resource1#comment=1", 830 "author": [ 831 { 832 "href": "https://authors.example.net/alice" 833 } 834 ] 835 } 836 ] 837 } 839 Figure 10: Response to the client's request for the set of links 841 7.3. Discovering a Link Set via the "linkset" Link Relation Type 843 Figure 11 shows a client issuing an HTTP HEAD request against 844 resource . 846 HEAD resource1 HTTP/1.1 847 Host: example.org 849 Figure 11: Client HTTP HEAD request 851 Figure 12 shows the response to the HEAD request of Figure 11. The 852 response contains an HTTP "Link" header field with a link that has 853 the "linkset" relation type. It indicates that a set of links is 854 provided by resource , which 855 provides a representation with media type "application/linkset+json". 857 HTTP/1.1 200 OK 858 Date: Mon, 12 Aug 2019 10:45:54 GMT 859 Server: Apache-Coyote/1.1 860 Link: 861 ; rel="linkset" 862 ; type="application/linkset+json" 863 Content-Length: 236 864 Content-Type: text/html;charset=utf-8 866 Figure 12: Response to HTTP HEAD request 868 Section 7.2 shows a client obtaining a set of links by issuing an 869 HTTP GET on the target of the link with the "linkset" relation type, 870 . 872 8. IANA Considerations 874 8.1. Link Relation Type: linkset 876 The link relation type below should be registered by IANA per 877 Section 6.2.1 of Web Linking [RFC8288]: 879 Relation Name: linkset 881 Description: The link target of a link with the "linkset" relation 882 type provides a set of links, including links in which the link 883 context of the link participates. 885 Reference: [[ This document ]] 887 8.2. Media Type: application/linkset 889 The Internet media type [RFC6838] for a natively encoded linkset is 890 application/linkset. 892 Type name: application 894 Subtype name: linkset 896 Required parameters: none 898 Optional parameters: profile 899 Encoding considerations: Linksets are encoded according to the 900 definition of [RFC8288]. The encoding of [RFC8288] is based on 901 the general encoding rules of [I-D.ietf-httpbis-semantics], with 902 the addition of allowing indicating character encoding and 903 language for specific parameters as defined by [RFC8187]. 905 Security considerations: The security considerations of [[ This 906 document ]] apply. 908 Interoperability considerations: N/A 910 Published specification: [[ This document ]] 912 Applications that use this media type: This media type is not 913 specific to any application, as it can be used by any application 914 that wants to interchange web links. 916 Additional information: 918 Magic number(s): N/A 920 File extension(s): This media type does not propose a specific 921 extension. 923 Macintosh file type code(s): TEXT 925 Person & email address to contact for further information: Erik 926 Wilde 928 Intended usage: COMMON 930 Restrictions on usage: none 932 Author: Erik Wilde 934 Change controller: IETF 936 8.3. Media Type: application/linkset+json 938 The Internet media type [RFC6838] for a JSON-encoded linkset is 939 application/linkset+json. 941 Type name: application 943 Subtype name: linkset+json 945 Required parameters: none 946 Optional parameters: profile 948 Encoding considerations: The encoding considerations of [RFC8259] 949 apply 951 Security considerations: The security considerations of [[ This 952 document ]] apply. 954 Interoperability considerations: The interoperability 955 considerations of [RFC8259] apply. 957 Published specification: [[ This document ]] 959 Applications that use this media type: This media type is not 960 specific to any application, as it can be used by any application 961 that wants to interchange web links. 963 Additional information: 965 Magic number(s): N/A 967 File extension(s): JSON documents often use ".json" as the file 968 extension, and this media type does not propose a specific 969 extension other than this generic one. 971 Macintosh file type code(s): TEXT 973 Person & email address to contact for further information: Erik 974 Wilde 976 Intended usage: COMMON 978 Restrictions on usage: none 980 Author: Erik Wilde 982 Change controller: IETF 984 9. Security Considerations 986 The security considerations of Web Linking [RFC8288] apply, as long 987 as they are not specifically discussing the risks of exposing 988 information in HTTP header fields. 990 In general, links may cause information leakage when they expose 991 information (such as URIs) that can be sensitive or private. Links 992 may expose "hidden URIs" that are not supposed to be openly shared, 993 and may not be sufficiently protected. Ideally, none of the URIs 994 exposed in links should be supposed to be "hidden"; instead, if these 995 URIs are supposed to be limited to certain users, then technical 996 measures should be put in place so that accidentally exposing them 997 does not cause any harm. 999 For the specific mechanisms defined in this specification, two 1000 security considerations should be taken into account: 1002 * The Web Linking model always has an "implicit context", which is 1003 the resource of the HTTP interaction. This original context can 1004 be lost or can change when self-contained link representations are 1005 moved. Changing the context can change the interpretation of 1006 links when they have no explicit anchor, or when they use relative 1007 URIs. Applications may choose to ignore links that have no 1008 explicit anchor or that use relative URIs when these are exchanged 1009 in stand-alone resources. 1011 * The model introduced in this specification supports "3rd party 1012 links", where one party can provide links that have another 1013 party's resource as an anchor. Depending on the link semantics 1014 and the application context, it is important to verify that there 1015 is sufficient trust in that 3rd party to allow it to provide these 1016 links. Applications may choose to treat 3rd party links 1017 differently than cases where a resource and the links for that 1018 resource are provided by the same party. 1020 10. Normative References 1022 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1023 Requirement Levels", BCP 14, RFC 2119, 1024 DOI 10.17487/RFC2119, March 1997, 1025 . 1027 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1028 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1029 May 2017, . 1031 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 1032 Interchange Format", STD 90, RFC 8259, 1033 DOI 10.17487/RFC8259, December 2017, 1034 . 1036 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 1037 DOI 10.17487/RFC8288, October 2017, 1038 . 1040 [RFC8187] Reschke, J., "Indicating Character Encoding and Language 1041 for HTTP Header Field Parameters", RFC 8187, 1042 DOI 10.17487/RFC8187, September 2017, 1043 . 1045 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1046 Resource Identifier (URI): Generic Syntax", STD 66, 1047 RFC 3986, DOI 10.17487/RFC3986, January 2005, 1048 . 1050 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1051 Specifications and Registration Procedures", BCP 13, 1052 RFC 6838, DOI 10.17487/RFC6838, January 2013, 1053 . 1055 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 1056 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 1057 September 2009, . 1059 [RFC6982] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1060 Code: The Implementation Status Section", RFC 6982, 1061 DOI 10.17487/RFC6982, July 2013, 1062 . 1064 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 1065 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 1066 . 1068 [RFC6906] Wilde, E., "The 'profile' Link Relation Type", RFC 6906, 1069 DOI 10.17487/RFC6906, March 2013, 1070 . 1072 [RFC7284] Lanthaler, M., "The Profile URI Registry", RFC 7284, 1073 DOI 10.17487/RFC7284, June 2014, 1074 . 1076 [I-D.ietf-httpbis-semantics] 1077 Fielding, R. T., Nottingham, M., and J. Reschke, "HTTP 1078 Semantics", Work in Progress, Internet-Draft, draft-ietf- 1079 httpbis-semantics-15, 30 March 2021, 1080 . 1083 11. Informative References 1085 [W3C.REC-json-ld-20140116] 1086 Sporny, M., Kellogg, G., and M. Lanthaler, "JSON-LD 1.0", 1087 World Wide Web Consortium Recommendation REC-json-ld- 1088 20140116, 16 January 2014, 1089 . 1091 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 1092 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 1093 December 2005, . 1095 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 1096 DOI 10.17487/RFC5988, October 2010, 1097 . 1099 Appendix A. JSON-LD Context 1101 A set of links rendered according to the JSON serialization defined 1102 in Section 4.2 can be interpreted as RDF triples by adding a JSON-LD 1103 context [W3C.REC-json-ld-20140116] that maps the JSON keys to 1104 corresponding Linked Data terms. And, as per 1105 [W3C.REC-json-ld-20140116] section 6.8 (https://www.w3.org/TR/2014/ 1106 REC-json-ld-20140116/#interpreting-json-as-json-ld), when delivering 1107 a link set that is rendered according to the "application/ 1108 linkset+json" media type to a user agent, a server can convey the 1109 availability of such a JSON-LD context by using a link with the 1110 relation type "http://www.w3.org/ns/json-ld#context" in the HTTP 1111 "Link" header. 1113 Using the latter approach to support discovery of a JSON-LD Context, 1114 the response to the GET request of Figure 9 against the URI of a set 1115 of links would be as shown in Figure 13. 1117 HTTP/1.1 200 OK 1118 Date: Mon, 12 Aug 2019 10:48:22 GMT 1119 Server: Apache-Coyote/1.1 1120 Content-Type: application/linkset+json 1121 Link: 1122 ; rel="http://www.w3.org/ns/json-ld#context" 1123 ; type="application/ld+json" 1124 Content-Length: 1349 1126 { 1127 "linkset": [ 1128 { 1129 "anchor": "https://example.org/resource1", 1130 "author": [ 1131 { 1132 "href": "https://authors.example.net/johndoe", 1133 "type": "application/rdf+xml" 1134 } 1135 ], 1136 "memento": [ 1137 { 1138 "href": "https://example.org/resource1?version=1", 1139 "type": "text/html", 1140 "datetime": "Thu, 13 Jun 2019 09:34:33 GMT" 1141 }, 1142 { 1143 "href": "https://example.org/resource1?version=2", 1144 "type": "text/html", 1145 "datetime": "Sun, 21 Jul 2019 12:22:04 GMT" 1146 } 1147 ], 1148 "latest-version": [ 1149 { 1150 "href": "https://example.org/resource1?version=3", 1151 "type": "text/html" 1152 } 1153 ] 1154 }, 1155 { 1156 "anchor": "https://example.org/resource1?version=3", 1157 "predecessor-version": [ 1158 { 1159 "href": "https://example.org/resource1?version=2", 1160 "type": "text/html" 1161 } 1162 ] 1163 }, 1164 { 1165 "anchor": "https://example.org/resource1?version=2", 1166 "predecessor-version": [ 1167 { 1168 "href": "https://example.org/resource1?version=1", 1169 "type": "text/html" 1170 } 1171 ] 1172 }, 1173 { 1174 "anchor": "https://example.org/resource1#comment=1", 1175 "author": [ 1176 { 1177 "href": "https://authors.example.net/alice" 1178 } 1179 ] 1180 } 1182 ] 1183 } 1185 Figure 13: Using a typed link to support discovery of a JSON-LD 1186 Context for a Set of Links 1188 In order to obtain the JSON-LD Context conveyed by the server, the 1189 user agent issues an HTTP GET against the link target of the link 1190 with the "http://www.w3.org/ns/json-ld#context" relation type. The 1191 response to this GET is shown in Figure 14. This particular JSON-LD 1192 context maps "application/linkset+json" representations of link sets 1193 to Dublin Core Terms. It also renders each link relation as a URI 1194 Reference, inspired by the same approach used for Atom [RFC4287] 1195 described in Appendix A.2 of [RFC8288]. 1197 HTTP/1.1 200 OK 1198 Content-Type: application/ld+json 1199 Content-Length: 708 1201 { 1202 "@context": [ 1203 { 1204 "@vocab": "http://www.iana.org/assignments/relation/", 1205 "anchor": "@id", 1206 "href": "@id", 1207 "linkset": "@graph", 1208 "_linkset": "@graph", 1209 "title": { 1210 "@id": "http://purl.org/dc/terms/title" 1211 }, 1212 "title*": { 1213 "@id": "http://purl.org/dc/terms/title" 1214 }, 1215 "type": { 1216 "@id": "http://purl.org/dc/terms/format" 1217 }, 1218 "datetime": { 1219 "@id": "http://purl.org/dc/terms/date" 1220 } 1221 }, 1222 { 1223 "language": "@language", 1224 "value": "@value", 1225 "hreflang": { 1226 "@id": "http://purl.org/dc/terms/language", 1227 "@container": "@set" 1228 } 1229 } 1230 ] 1231 } 1233 Figure 14: JSON-LD Context mapping to Dublin Core Terms and IANA 1234 assignments 1236 Applying the JSON-LD context of Figure 14 to the link set of 1237 Figure 13 allows transforming the "application/linkset+json" link set 1238 to an RDF link set. Figure 15 shows the latter represented by means 1239 of the "text/turtle" RDF serialization. 1241 1242 1243 "application/rdf+xml" . 1244 1245 1246 . 1247 1248 1249 . 1250 1251 1252 . 1253 1254 1255 . 1256 1257 1258 . 1259 1260 1261 "Thu, 13 Jun 2019 09:34:33 GMT" . 1262 1263 1264 "text/html" . 1265 1266 1267 "Sun, 21 Jul 2019 12:22:04 GMT" . 1268 1269 1270 "text/html" . 1271 1272 1273 . 1274 1275 1276 "text/html" . 1277 1278 1279 . 1281 Figure 15: RDF serialization of the link set resulting from 1282 applying the JSON-LD context 1284 Note that the JSON-LD context of Figure 14 does not handle (meta)link 1285 relations of type ""linkset"" as they are in conflict with the top- 1286 level JSON key. A workaround is to rename the top-level key to 1287 ""_linkset"" in the "application/linkset+json" before transforming a 1288 link set to JSON-LD. 1290 Appendix B. Implementation Status 1292 This section is to be removed before publishing as an RFC. 1294 This section records the status of known implementations of the 1295 protocol defined by this specification at the time of posting of this 1296 Internet-Draft, and is based on a proposal described in RFC 6982 1297 [RFC6982]. The description of implementations in this section is 1298 intended to assist the IETF in its decision processes in progressing 1299 drafts to RFCs. Please note that the listing of any individual 1300 implementation here does not imply endorsement by the IETF. 1301 Furthermore, no effort has been spent to verify the information 1302 presented here that was supplied by IETF contributors. This is not 1303 intended as, and must not be construed to be, a catalog of available 1304 implementations or their features. Readers are advised to note that 1305 other implementations may exist. 1307 According to RFC 6982, "this will allow reviewers and working groups 1308 to assign due consideration to documents that have the benefit of 1309 running code, which may serve as evidence of valuable experimentation 1310 and feedback that have made the implemented protocols more mature. 1311 It is up to the individual working groups to use this information as 1312 they see fit". 1314 B.1. GS1 1316 GS1 is a provider of barcodes (GS1 GTINs and EAN/UPC) for retail 1317 products and manages an ecology of services and standards to leverage 1318 them at a global scale. GS1 has indicated that it will implement 1319 this "linkset" specification as a means to allow requesting and 1320 representing links pertaining to products from various retailers. 1321 Currently, the GS1 Digital Link specification makes an informative 1322 reference to version 03 of the "linkset" I-D. GS1 expresses 1323 confidence that this will become a normative reference in the next 1324 iteration of that specification, likely to be ratified as a GS1 1325 standard around February 2021. 1327 B.2. FAIR Signposting Profile 1329 The FAIR Signposting Profile is a community specification aimed at 1330 improving machine navigation of scholarly objects on the web through 1331 the use of typed web links pointing at e.g. web resources that are 1332 part of a specific object, persistent identifiers for the object and 1333 its authors, license information pertaining to the object. The 1334 specification encourages the use of Linksets and initial 1335 implementations are ongoing, for example, for the open source 1336 Dataverse data repository platform that was initiated by Harvard 1337 University and is meanwhile used by research institutions, worldwide. 1339 B.3. Open Journal Systems (OJS) 1341 Open Journal Systems (OJS) is an open-source software for the 1342 management of peer-reviewed academic journals, and is created by the 1343 Public Knowledge Project (PKP), released under the GNU General Public 1344 License. Open Journal Systems (OJS) is a journal management and 1345 publishing system that has been developed by PKP through its 1346 federally funded efforts to expand and improve access to research. 1348 The OJS platform has implemented "linkset" support as an alternative 1349 way to provide links when there are more than a configured limit 1350 (they consider using about 10 as a good default, for testing purpose 1351 it is currently set to 8). 1353 Acknowledgements 1355 Thanks for comments and suggestions provided by Phil Archer, 1356 Dominique Guinard, Mark Nottingham, Julian Reschke, Stian Soiland- 1357 Reyes, and Sarven Capadisli. 1359 Authors' Addresses 1361 Erik Wilde 1362 Axway 1364 Email: erik.wilde@dret.net 1365 URI: http://dret.net/netdret/ 1367 Herbert Van de Sompel 1368 Data Archiving and Networked Services 1370 Email: herbert.van.de.sompel@dans.knaw.nl 1371 URI: https://orcid.org/0000-0002-0715-6126