idnits 2.17.1 draft-ietf-httpapi-linkset-01.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: ---------------------------------------------------------------------------- No issues found here. 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 (May 31, 2021) is 1061 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 1131 -- Looks like a reference, but probably isn't: '2' on line 1197 ** Obsolete normative reference: RFC 822 (Obsoleted by RFC 2822) ** Obsolete normative reference: RFC 6982 (Obsoleted by RFC 7942) ** Obsolete normative reference: RFC 7230 (Obsoleted by RFC 9110, RFC 9112) ** Obsolete normative reference: RFC 7231 (Obsoleted by RFC 9110) -- Obsolete informational reference (is this intentional?): RFC 5988 (Obsoleted by RFC 8288) Summary: 4 errors (**), 0 flaws (~~), 1 warning (==), 4 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: December 2, 2021 Data Archiving and Networked Services 6 May 31, 2021 8 Linkset: Media Types and a Link Relation Type for Link Sets 9 draft-ietf-httpapi-linkset-01 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 (). 25 Online access to all versions and files is available on GitHub 26 (). 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 December 2, 2021. 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 52 (https://trustee.ietf.org/license-info) in effect on the date of 53 publication of this document. Please review these documents 54 carefully, as they describe your rights and restrictions with respect 55 to this document. Code Components extracted from this document must 56 include Simplified BSD License text as described in Section 4.e of 57 the Trust Legal Provisions and are provided without warranty as 58 described in the Simplified BSD License. 60 Table of Contents 62 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 3 63 2. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . 3 64 3. Scenarios . . . . . . . . . . . . . . . . . . . . . . . . . . 3 65 3.1. Third-Party Links . . . . . . . . . . . . . . . . . . . . 4 66 3.2. Challenges Writing to HTTP Link Header Field . . . . . . 5 67 3.3. Large Number of Links . . . . . . . . . . . . . . . . . . 5 68 4. Document Formats for Sets of Links . . . . . . . . . . . . . 5 69 4.1. HTTP Link Document Format: application/linkset . . . . . 6 70 4.2. JSON Document Format: application/linkset+json . . . . . 6 71 4.2.1. Set of Links . . . . . . . . . . . . . . . . . . . . 7 72 4.2.2. Link Context Object . . . . . . . . . . . . . . . . . 8 73 4.2.3. Link Target Object . . . . . . . . . . . . . . . . . 8 74 4.2.4. Link Target Attributes . . . . . . . . . . . . . . . 10 75 4.2.5. JSON Extensibility . . . . . . . . . . . . . . . . . 14 76 5. The "linkset" Relation Type for Linking to a Set of Links . . 14 77 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 15 78 6.1. Set of Links Provided as application/linkset . . . . . . 15 79 6.2. Set of Links Provided as application/linkset+json . . . . 16 80 6.3. Discovering a Link Set via the "linkset" Link Relation 81 Type . . . . . . . . . . . . . . . . . . . . . . . . . . 19 82 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 19 83 7.1. GS1 . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 84 7.2. FAIR Signposting Profile . . . . . . . . . . . . . . . . 20 85 7.3. Open Journal Systems (OJS) . . . . . . . . . . . . . . . 20 86 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 21 87 8.1. Link Relation Type: linkset . . . . . . . . . . . . . . . 21 88 8.2. Media Type: application/linkset . . . . . . . . . . . . . 21 89 8.2.1. IANA Considerations . . . . . . . . . . . . . . . . . 21 90 8.3. Media Type: application/linkset+json . . . . . . . . . . 22 91 9. Security Considerations . . . . . . . . . . . . . . . . . . . 23 92 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 24 93 10.1. Normative References . . . . . . . . . . . . . . . . . . 24 94 10.2. Informative References . . . . . . . . . . . . . . . . . 25 95 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 26 96 Appendix B. JSON-LD Context . . . . . . . . . . . . . . . . . . 26 97 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 99 1. Introduction 101 Resources on the Web often use typed Web Links [RFC8288], either 102 embedded in resource representations, for example using the 103 element for HTML documents, or conveyed in the HTTP "Link" header for 104 documents of any media type. In some cases, however, providing links 105 in this manner is impractical or impossible and delivering a set of 106 links as a stand-alone document is preferable. 108 Therefore, this specification defines two document formats and 109 associated media types to represent sets of links. It also defines 110 the "linkset" relation type that supports discovery of any resource 111 that conveys a set of links as a stand-alone document. 113 2. Terminology 115 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 116 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 117 "OPTIONAL" in this document are to be interpreted as described in BCP 118 14 [RFC2119] [RFC8174] when, and only when, they appear in all 119 capitals, as shown here. 121 This specification uses the terms "link context" and "link target" as 122 defined in [RFC8288]. These terms respectively correspond with 123 "Context IRI" and "Target IRI" as used in [RFC5988]. Although 124 defined as IRIs, in common scenarios they are also URIs. 126 In the examples provided in this document, links in the HTTP "Link" 127 header are shown on separate lines in order to improve readability. 128 Note, however, that as per Section 3.2 of [RFC7230], line breaks are 129 not allowed in values for HTTP headers; only whitespaces and tabs are 130 supported as seperators. 132 3. Scenarios 134 The following sections outline scenarios in which providing links by 135 means of a standalone document instead of in an HTTP "Link" header 136 field or as links embedded in the resource representation is 137 advantageous or necessary. 139 For all scenarios, links could be provided by means of a stand-alone 140 document that is formatted according to the JSON-based serialization, 141 the serialization aligned with the HTTP "Link" header format, or 142 both. The former serialization is motivated by the widespread use of 143 JSON and related tools, which suggests that handling sets of links 144 expressed as JSON documents should be attractive to developers. The 145 latter serialization is provided for compatibility with the existing 146 serialization used in the HTTP "Link" header and to allow reuse of 147 tools created to handle it. 149 It is important to keep in mind that when providing links by means of 150 a standalone representation, other links can still be provided using 151 other approaches, i.e. it is possible combine various mechanisms to 152 convey links. 154 3.1. Third-Party Links 156 In some cases it is useful that links pertaining to a resource are 157 provided by a server other than the one that hosts the resource. For 158 example, this allows: 160 o Providing links in which the resource is involved not just as link 161 context but also as link target. 163 o Providing links pertaining to the resource that the server hosting 164 that resource is not aware of. 166 o External management of links pertaining to the resource in a 167 special-purpose link management service. 169 In such cases, links pertaining to a resource can be provided by 170 another, specific resource. That specific resource may be managed by 171 the same or by another custodian as the resource to which the links 172 pertain. For clients intent on consuming links provided in that 173 manner, it would be beneficial if the following conditions were met: 175 o Links are provided in a document that uses a well-defined media 176 type. 178 o The resource to which the provided links pertain is able to link 179 to the resource that provides these links using a well-known link 180 relation type. 182 These requirements are addressed in this specification through the 183 definition of two media types and a link relation type, respectively. 185 3.2. Challenges Writing to HTTP Link Header Field 187 In some cases, it is not straightforward to write links to the HTTP 188 "Link" header field from an application. This can, for example, be 189 the case because not all required link information is available to 190 the application or because the application does not have the 191 capability to directly write HTTP headers. In such cases, providing 192 links by means of a standalone document can be a solution. Making 193 the resource that provides these links discoverable can be achieved 194 by means of a typed link. 196 3.3. Large Number of Links 198 When conveying links in an HTTP "Link" header field, it is possible 199 for the size of the HTTP response header to become unpredictable. 200 This can be the case when links are determined dynamically dependent 201 on a range of contextual factors. It is possible to statically 202 configure a web server to correctly handle large HTTP response 203 headers by specifying an upper bound for their size. But when the 204 number of links is unpredictable, estimating a reliable upper bound 205 is challenging. 207 HTTP [RFC7231] defines error codes related to excess communication by 208 the user agent ("413 Request Entity Too Large" and "414 Request-URI 209 Too Long"), but no specific error codes are defined to indicate that 210 response header content exceeds the upper bound that can be handled 211 by the server, and thus it has been truncated. As a result, 212 applications take counter measures aimed at controlling the size of 213 the HTTP "Link" header field, for example by limiting the links they 214 provide to those with select relation types, thereby limiting the 215 value of the HTTP "Link" header field to clients. Providing links by 216 means of a standalone document overcomes challenges related to the 217 unpredictable nature of the size of HTTP "Link" header fields. 219 4. Document Formats for Sets of Links 221 This section specifies two document formats to convey a set of links. 222 Both are based on the abstract model specified in Section 2 of Web 223 Linking [RFC8288] that defines a link as consisting of a "link 224 context", a "link relation type", a "link target", and optional 225 "target attributes": 227 o The format defined in Section 4.1 is identical to the payload of 228 the HTTP "Link" header field as specified in Web Linking 229 [RFC8288]. 231 o The format defined in Section 4.2 is based on JSON [RFC8259]. 233 Note that [RFC8288] deprecates the "rev" construct that was provided 234 by [RFC5988] as a means to express links with a directionality that 235 is the inverse of direct links that use the "rel" construct. In both 236 serializations for link sets defined here, inverse links SHOULD be 237 represented as direct links using the "rel" construct and by 238 switching the position of the resources involved in 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. Whereas 245 the HTTP "Link" Header field depends on HTTP and hence on [RFC0822] 246 for its encoding, the format specified here is encoded as UTF-8 247 [RFC3629]. 249 The assigned media type for this format is "application/linkset". 251 In order to support use cases where "application/linkset" documents 252 are re-used outside the context of an HTTP interaction, it is 253 RECOMMENDED to make them self-contained by adhering to the following 254 guidelines: 256 o For every link provided in the set of links, explicitly provide 257 the link context using the "anchor" attribute. 259 o For link context ("anchor" attribute) and link target ("href" 260 attribute), use absolute URIs (as defined in Section 4.3 of 261 [RFC3986]). 263 If these recommendations are not followed, interpretation of links in 264 "application/linkset" documents will depend on which URI is used as 265 context. 267 It should be noted that the "application/linkset" format specified 268 here is different than the "application/link-format" format specified 269 in [RFC6690] in that the former fully matches the payload of the HTTP 270 "Link" header as defined in Section 3 of [RFC8288], whereas the 271 latter introduces constraints on that definition to meet requirements 272 for Constrained RESTful Environments. 274 4.2. JSON Document Format: application/linkset+json 276 This document format uses JSON [RFC8259] as the syntax to represent a 277 set of links. The set of links follows the abstract model defined by 278 Web Linking [RFC8288]. 280 The assigned media type for this format is "application/ 281 linkset+json". 283 In order to support use cases where "application/linkset+json" 284 documents are re-used outside the context of an HTTP interaction, it 285 is RECOMMENDED to make them self-contained by adhering to the 286 following guidelines: 288 o For every link provided in the set of links, explicitly provide 289 the link context using the "anchor" member. 291 o For link context ("anchor" member) and link target ("href" 292 member), use absolute URIs (as defined in Section 4.3 of 293 [RFC3986]). 295 If these recommendations are not followed, interpretation of 296 "application/linkset+json" will depend on which URI is used as 297 context URI. 299 The "application/linkset+json" serialization is designed such that it 300 can directly be used as the content of a JSON-LD serialization by 301 adding an appropriate context. Appendix B shows an example of a 302 possible context that, when added to a JSON serialization, allows it 303 to be interpreted as RDF. 305 4.2.1. Set of Links 307 In the JSON representation of a set of links: 309 o A set of links MUST be represented as a JSON object which MUST 310 have "linkset" as its sole member. 312 o The "linkset" member is an array in which a distinct JSON object - 313 the "link context object" (see Section 4.2.2) - MUST be used to 314 represent links that have the same link context. 316 o If necessary, the "linkset" member MAY contain information in 317 addition to link context objects, in which case that information 318 MUST NOT change the semantics of the links provided by those link 319 context objects. 321 o Even if there is only one link context object, it MUST be wrapped 322 in an array. Members other than link context objects MUST NOT be 323 included in this array. 325 4.2.2. Link Context Object 327 In the JSON representation one or more links that have the same link 328 context are represented by a JSON object, the link context object. A 329 link context object adheres to the following rules: 331 o Each link context object MAY have an "anchor" member with a value 332 that represents the link context. If present, this value SHOULD 333 be an absolute URI as defined in Section 4.3 of [RFC3986]. Cases 334 where the anchor member is present, but no value is provided for 335 it (i.e. the resource providing the set of links is the link 336 context for each link in the link context object) MUST be handled 337 by providing an "anchor" member with empty string ("anchor": ""). 339 o For each distinct relation type that the link context has with 340 link targets, a link context object MUST have an additional 341 member. This member is an array in which a distinct JSON object - 342 the "link target object" (see Section 4.2.3) - MUST be used for 343 each link target for which the relationship with the link context 344 (value of the encompassing anchor member) applies. The name of 345 this member expresses the relation type of the link as follows: 347 o 349 * For registered relation types [RFC8288], the name of this 350 member is the registered name of the relation type. 352 * For extension relation types [RFC8288], the name of this member 353 is the URI that uniquely represents the relation type. 355 o Even if there is only one link target object it MUST be wrapped in 356 an array. Members other than link target objects MUST NOT be 357 included in this array. 359 4.2.3. Link Target Object 361 In the JSON representation a link target is represented by a JSON 362 object, the link target object. A link target object adheres to the 363 following rules: 365 o Each link target object MUST have an "href" member with a value 366 that represents the link target. This value SHOULD be an absolute 367 URI as defined in Section 4.3 of [RFC3986]. Cases where the href 368 member is present, but no value is provided for it (i.e. the 369 resource providing the set of links is the target of the link in 370 the link target object) MUST be handled by providing an "href" 371 member with an empty string ("href": ""). 373 o In many cases, a link target is further qualified by target 374 attributes. Various types of attributes exist and they are 375 conveyed as additional members of the link target object as 376 detailed in Section 4.2.4. 378 The following example of a JSON-serialized set of links represents 379 one link with its core components: link context, link relation type, 380 and link target. 382 { 383 "linkset": 384 [ 385 { "anchor": "http://example.net/bar", 386 "next": [ 387 {"href": "http://example.com/foo"} 388 ] 389 } 390 ] 391 } 393 The following example of a JSON-serialized set of links represents 394 two links that share link context and relation type but have 395 different link targets. 397 { 398 "linkset": 399 [ 400 { "anchor": "http://example.net/bar", 401 "item": [ 402 {"href": "http://example.com/foo1"}, 403 {"href": "http://example.com/foo2"} 404 ] 405 } 406 ] 407 } 409 The following example shows a set of links that represents two links, 410 each with a different link context, link target, and relation type. 411 One relation type is registered, the other is an extension relation 412 type. 414 { 415 "linkset": 416 [ 417 { "anchor": "http://example.net/bar", 418 "next": [ 419 {"href": "http://example.com/foo1"} 420 ] 421 }, 422 { "anchor": "http://example.net/boo", 423 "http://example.com/relations/baz" : [ 424 {"href": "http://example.com/foo2"} 425 ] 426 } 427 ] 428 } 430 4.2.4. Link Target Attributes 432 A link may be further qualified by target attributes. Three types of 433 attributes exist: 435 o Attributes defined by the serialization of Web Linking [RFC8288]. 437 o Extension attributes defined and used by communities as allowed by 438 [RFC8288]. 440 o Internationalized versions of the "title" attribute defined by 441 [RFC8288] and of extension attributes allowed by [RFC8288]. 443 The handling of these different types of attributes is described in 444 the sections below. 446 4.2.4.1. Target Attributes Defined by Web Linking 448 RFC 8288 defines the following target attributes that may be used to 449 annotate links: "hreflang", "media", "title", "title*", and "type"; 450 these target attributes follow different occurrence and value 451 patterns. In the JSON representation, these attributes MUST be 452 conveyed as additional members of the link target object as follows: 454 o "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 o "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 o "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 o "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 o "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 4.2.4.2. Internationalized Target Attributes 502 In addition to the target attributes described in Section 4.2.4.1, 503 [RFC8288] also supports attributes that follow the content model of 504 [RFC8187]. In [RFC8288], these target attributes are recognizable by 505 the use of a trailing asterisk in the attribute name, such as 506 "title*". The content model of [RFC8187] uses a string-based 507 microsyntax that represents the character encoding, an optional 508 language tag, and the escaped attribute value encoded according to 509 the specified character encoding. 511 The JSON serialization for these target attributes MUST be as 512 follows: 514 o An internationalized target attribute is represented as a member 515 of the link context object with the same name (including the *) of 516 the attribute. 518 o The character encoding information as prescribed by [RFC8187] is 519 not preserved; instead, the content of the internationalized 520 attribute is represented in the character encoding used for the 521 JSON set of links. 523 o The value of the internationalized target attribute is an array 524 that contains one or more JSON objects. The name of one member of 525 such JSON object is "value" and its value is the actual content 526 (in its unescaped version) of the internationalized target 527 attribute, i.e. the value of the attribute from which the encoding 528 and language information are removed. The name of another, 529 optional, member of such JSON object is "language" and its value 530 is the language tag [RFC5646] for the language in which the 531 attribute content is conveyed. 533 The following example illustrates how the "title*" target attribute 534 defined by [RFC8288] is represented in a link target object. 536 { 537 "linkset": 538 [ 539 { "anchor": "http://example.net/bar", 540 "next": [ 541 {"href": "http://example.com/foo", 542 "type": "text/html", 543 "hreflang": [ "en" , "de" ], 544 "title": "Next chapter", 545 "title*": [ { "value": "nachstes Kapitel" , 546 "language" : "de" } ] 547 } 548 ] 549 } 550 ] 551 } 553 The above example assumes that the German title contains an umlaut 554 character (in the native syntax it would be encoded as title*=UTF- 555 8'de'n%c3%a4chstes%20Kapitel), which gets encoded in its unescaped 556 form in the JSON representation. This is not shown in the above 557 example due to the limitations of RFC publication. Implementations 558 MUST properly decode/encode internationalized target attributes that 559 follow the model of [RFC8187] when transcoding between the 560 "application/linkset" and the "application/linkset+json" formats. 562 4.2.4.3. Extension Target Attributes 564 Extension target attributes are attributes that are not defined by 565 [RFC8288] (as listed in Section 4.2.4.1), but are nevertheless used 566 to qualify links. They can be defined by communities in any way 567 deemed necessary, and it is up to them to make sure their usage is 568 understood by target applications. However, lacking standardization, 569 there is no interoperable understanding of these extension 570 attributes. One important consequence is that their cardinality is 571 unknown to generic applications. Therefore, in the JSON 572 serialization, all extension target attributes are treated as 573 repeatable. 575 The JSON serialization for these target attributes MUST be as 576 follows: 578 o An extension target attribute is represented as a member of the 579 link context object with the same name of the attribute, including 580 the * if applicable. 582 o The value of an extension attribute MUST be represented by an 583 array, even if there only is one value to be represented. 585 o If the extension target attribute does not have a name with a 586 trailing asterisk, then each value in that array MUST be a string 587 that represents one value of the attribute. 589 o If the extension attribute has a name with a trailing asterisk (it 590 follows the content model of [RFC8187]), then each value in that 591 array MUST be a JSON object. The value of each such JSON object 592 MUST be structured as described in Section 4.2.4.2. 594 The example shows a link target object with three extension target 595 attributes. The value for each extension target attribute is an 596 array. The two first are regular extension target attributes, with 597 the first one ("foo") having only one value and the second one 598 ("bar") having two. The last extension target attribute ("baz*") 599 follows the naming rule of [RFC8187] and therefore is encoded 600 according to the serialization described in Section 4.2.4.2. 602 { 603 "linkset": 604 [ 605 { "anchor": "http://example.net/bar", 606 "next": [ 607 { "href": "http://example.com/foo", 608 "type": "text/html", 609 "foo": [ "foovalue" ], 610 "bar": [ "barone", "bartwo" ], 611 "baz*": [ { "value": "bazvalue" , 612 "language" : "en" } ] 613 } 614 ] 615 } 616 ] 617 } 619 4.2.5. JSON Extensibility 621 The extensibility of the JSON document format for representing a set 622 of links is restricted to the extensibility provided by [RFC8288]. 623 The Web linking model provides for the use of extension target 624 attributes as discussed in Section 4.2.4.3. Extensions based on the 625 JSON syntax MUST NOT be used, and MUST be ignored when found in a 626 JSON linkset document. 628 This limitation of the JSON format allows to unambiguously round trip 629 between links provided in the HTTP "Link" header, sets of links 630 serialized according to the "application/linkset" format, and sets of 631 links serialized according to the "application/linkset+json" format. 633 5. The "linkset" Relation Type for Linking to a Set of Links 635 The target of a link with the "linkset" relation type provides a set 636 of links, including links in which the resource that is the link 637 context participates. 639 A link with the "linkset" relation type MAY be provided in the header 640 and/or the body of a resource's representation. It may also be 641 discovered by other means, such as through client-side information. 643 A resource MAY provide more than one link with a "linkset" relation 644 type. Multiple such links can refer to the same set of links 645 expressed using different media types, or to different sets of links, 646 potentially provided by different third-party services. 648 A user agent that follows a "linkset" link MUST be aware that the set 649 of links provided by the resource that is the target of the link can 650 contain links in which the resource that is the context of the link 651 does not participate; it MAY decide to ignore those links. 653 A user agent that follows a "linkset" link and obtains links for 654 which anchors and targets are not expressed as absolute URIs MUST 655 properly determine what the context is for these links; it SHOULD 656 ignore links for which it is unable to unambiguously make that 657 determination. 659 6. Examples 661 Section 6.1 and Section 6.2 show examples whereby the set of links 662 are provided as "application/linkset" and "application/linkset+json" 663 documents, respectively. Section 6.3 illustrates the use of the 664 "linkset" link relation type to support discovery of sets of links. 666 6.1. Set of Links Provided as application/linkset 668 Figure 1 shows a client issuing an HTTP GET request against resource 669 . 671 GET /resource1 HTTP/1.1 672 Host: example.org 673 Connection: close 675 Figure 1: Client HTTP GET request 677 Figure 2 shows the response to the GET request of Figure 1. The 678 response contains a Content-Type header specifying that the media 679 type of the response is "application/linkset". A set of links, 680 including links that pertain to the responding resource, is provided 681 in the response body. 683 HTTP/1.1 200 OK 684 Date: Mon, 12 Aug 2019 10:35:51 GMT 685 Server: Apache-Coyote/1.1 686 Content-Length: 855 687 Content-Type: application/linkset; charset=UTF-8 688 Connection: close 689 690 ; rel="author" 691 ; type="application/rdf+xml" 692 ; anchor="http://example.org/resource1", 693 694 ; rel="author" 695 ; type="application/rdf+xml" 696 ; anchor="http://example.org/resource1", 697 698 ; rel="item" 699 ; type="application/pdf" 700 ; anchor="http://example.org/resource1", 701 702 ; rel="item" 703 ; type="text/html" 704 ; anchor="http://example.org/resource1", 705 706 ; rel="latest-version" 707 ; anchor="http://example.org/resource41/", 708 709 ; rel="prev" 710 ; anchor="http://example.org/resource41/", 711 712 ; rel="author" 713 ; anchor="http://example.org/resource1/items/CB63DA.html#cmt-1" 715 Figure 2: Response to HTTP GET includes a set of links 717 6.2. Set of Links Provided as application/linkset+json 719 Figure 3 shows the client issuing an HTTP GET request against 720 . In the request, the client 721 uses an "Accept" header to indicate it prefers a response in the 722 "application/linkset+json" format. 724 GET links/article/7507 HTTP/1.1 725 Host: example.com 726 Accept: application/linkset+json 727 Connection: close 729 Figure 3: Client HTTP GET request expressing preference for 730 "application/linkset+json" response 732 Figure 4 shows the response to the HTTP GET request of Figure 3. The 733 set of links is serialized according to the media type "application/ 734 linkset+json". 736 HTTP/1.1 200 OK 737 Date: Mon, 12 Aug 2019 10:46:22 GMT 738 Server: Apache-Coyote/1.1 739 Content-Type: application/linkset+json 740 Content-Length: 802 741 { 742 "linkset": [ 743 { 744 "anchor": "https://example.org/article/view/7507", 745 "author": [ 746 { 747 "href": "https://orcid.org/0000-0002-1825-0097" 748 } 749 ], 750 "item": [ 751 { 752 "href": "https://example.org/article/7507/item/1", 753 "type": "application/pdf" 754 }, 755 { 756 "href": "https://example.org/article/7507/item/2", 757 "type": "text/csv" 758 } 759 ], 760 "cite-as": [ 761 { 762 "href": "https://doi.org/10.5555/12345680", 763 "title": "A Methodology for the Emulation of Architecture" 764 } 765 ] 766 }, 767 { 768 "anchor": "https://example.com/links/article/7507", 769 "alternate": [ 770 { 771 "href": "https://mirror.example.com/links/article/7507", 772 "type": "application/linkset" 773 } 774 ] 775 } 776 ] 777 } 779 Figure 4: Response to the client's request for the set of links 781 6.3. Discovering a Link Set via the "linkset" Link Relation Type 783 Figure 5 shows a client issuing an HTTP HEAD request against resource 784 . 786 HEAD article/view/7507 HTTP/1.1 787 Host: example.org 788 Connection: close 790 Figure 5: Client HTTP HEAD request 792 Figure 6 shows the response to the HEAD request of Figure 5. The 793 response contains a "Link" header with a link that has the "linkset" 794 relation type. It indicates that a set of links is provided by 795 resource , which provides a 796 representation with media type "application/linkset+json". 798 HTTP/1.1 200 OK 799 Date: Mon, 12 Aug 2019 10:45:54 GMT 800 Server: Apache-Coyote/1.1 801 Link: 802 ; rel="linkset" 803 ; type="application/linkset+json" 804 Content-Length: 236 805 Content-Type: text/html;charset=utf-8 806 Connection: close 808 Figure 6: Response to HTTP HEAD request 810 Section 6.2 shows a client obtaining a set of links by issuing an 811 HTTP GET on the target of the link with the "linkset" relation type, 812 . 814 7. Implementation Status 816 Note to RFC Editor: Please remove this section before publication. 818 This section records the status of known implementations of the 819 protocol defined by this specification at the time of posting of this 820 Internet-Draft, and is based on a proposal described in RFC 6982 821 [RFC6982]. The description of implementations in this section is 822 intended to assist the IETF in its decision processes in progressing 823 drafts to RFCs. Please note that the listing of any individual 824 implementation here does not imply endorsement by the IETF. 825 Furthermore, no effort has been spent to verify the information 826 presented here that was supplied by IETF contributors. This is not 827 intended as, and must not be construed to be, a catalog of available 828 implementations or their features. Readers are advised to note that 829 other implementations may exist. 831 According to RFC 6982, "this will allow reviewers and working groups 832 to assign due consideration to documents that have the benefit of 833 running code, which may serve as evidence of valuable experimentation 834 and feedback that have made the implemented protocols more mature. 835 It is up to the individual working groups to use this information as 836 they see fit". 838 7.1. GS1 840 GS1 is a provider of barcodes (GS1 GTINs and EAN/UPC) for retail 841 products and manages an ecology of services and standards to leverage 842 them at a global scale. GS1 has indicated that it will implement 843 this "linkset" specification as a means to allow requesting and 844 representing links pertaining to products from various retailers. 845 Currently, the GS1 Digital Link specification makes an informative 846 reference to version 03 of the "linkset" I-D. GS1 expresses 847 confidence that this will become a normative reference in the next 848 iteration of that specification, likely to be ratified as a GS1 849 standard around February 2021. 851 7.2. FAIR Signposting Profile 853 The FAIR Signposting Profile is a community specification aimed at 854 improving machine navigation of scholarly objects on the web through 855 the use of typed web links pointing at e.g. web resources that are 856 part of a specific object, persistent identifiers for the object and 857 its authors, license information pertaining to the object. The 858 specification encourages the use of Linksets and initial 859 implementations are ongoing, for example, for the open source 860 Dataverse data repository platform that was initiated by Harvard 861 University and is meanwhile used by research institutions, worldwide. 863 7.3. Open Journal Systems (OJS) 865 Open Journal Systems (OJS) is an open-source software for the 866 management of peer-reviewed academic journals, and is created by the 867 Public Knowledge Project (PKP), released under the GNU General Public 868 License. Open Journal Systems (OJS) is a journal management and 869 publishing system that has been developed by PKP through its 870 federally funded efforts to expand and improve access to research. 872 The OJS platform has implemented "linkset" support as an alternative 873 way to provide links when there are more than a configured limit 874 (they consider using about 10 as a good default, for testing purpose 875 it is currently set to 8). 877 8. IANA Considerations 879 8.1. Link Relation Type: linkset 881 The link relation type below has been registered by IANA per 882 Section 6.2.1 of Web Linking [RFC8288]: 884 Relation Name: linkset 886 Description: The Target IRI of a link with the "linkset" relation 887 type provides a set of links, including links in which the Context 888 IRI of the link participates. 890 Reference: [[ This document ]] 892 8.2. Media Type: application/linkset 894 8.2.1. IANA Considerations 896 The Internet media type [RFC6838] for a natively encoded linkset is 897 application/linkset. 899 Type name: application 901 Subtype name: linkset 903 Required parameters: none 905 Optional parameters: none 907 Encoding considerations: Linksets are encoded according to the 908 definition of [RFC8288]. The encoding of [RFC8288] is based on 909 the general encoding rules of [RFC7230], with the addition of 910 allowing indicating character encoding and language for specific 911 parameters as defined by [RFC8187]. 913 Security considerations: The security considerations of [[ This 914 document ]] apply. 916 Interoperability considerations: The interoperability 917 considerations of [RFC7230] apply. 919 Published specification: [[ This document ]] 920 Applications that use this media type: This media type is not 921 specific to any application, as it can be used by any application 922 that wants to interchange web links. 924 Additional information: 926 Magic number(s): N/A 928 File extension(s): This media type does not propose a specific 929 extension. 931 Macintosh file type code(s): TEXT 933 Person & email address to contact for further information: Erik 934 Wilde 936 Intended usage: COMMON 938 Restrictions on usage: none 940 Author: Erik Wilde 942 Change controller: IETF 944 8.3. Media Type: application/linkset+json 946 The Internet media type [RFC6838] for a JSON-encoded linkset is 947 application/linkset+json. 949 Type name: application 951 Subtype name: linkset+json 953 Required parameters: none 955 Optional parameters: none 957 Encoding considerations: The encoding considerations of [RFC8259] 958 apply 960 Security considerations: The security considerations of [[ This 961 document ]] apply. 963 Interoperability considerations: The interoperability 964 considerations of [RFC8259] apply. 966 Published specification: [[ This document ]] 967 Applications that use this media type: This media type is not 968 specific to any application, as it can be used by any application 969 that wants to interchange web links. 971 Additional information: 973 Magic number(s): N/A 975 File extension(s): JSON documents often use ".json" as the file 976 extension, and this media type does not propose a specific 977 extension other than this generic one. 979 Macintosh file type code(s): TEXT 981 Person & email address to contact for further information: Erik 982 Wilde 984 Intended usage: COMMON 986 Restrictions on usage: none 988 Author: Erik Wilde 990 Change controller: IETF 992 9. Security Considerations 994 The security considerations of Web Linking [RFC8288] apply, as long 995 as they are not specifically discussing the risks of exposing 996 information in HTTP header fields. 998 In general, links may cause information leakage when they expose 999 information (such as URIs) that can be sensitive or private. Links 1000 may expose "hidden URIs" that are not supposed to be openly shared, 1001 and may not be sufficiently protected. Ideally, none of the URIs 1002 exposed in links should be supposed to be "hidden"; instead, if these 1003 URIs are supposed to be limited to certain users, then technical 1004 measures should be put in place so that accidentally exposing them 1005 does not cause any harm. 1007 For the specific mechanisms defined in this specification, two 1008 security considerations should be taken into account: 1010 o The Web Linking model always has an "implicit context", which is 1011 the resource of the HTTP interaction. This original context can 1012 be lost or can change when self-contained link representations are 1013 moved. Changing the context can change the interpretation of 1014 links when they have no explicit anchor, or when they use relative 1015 URIs. Applications may choose to ignore links that have no 1016 explicit anchor or that use relative URIs when these are exchanged 1017 in stand-alone resources. 1019 o The model introduced in this specification supports "3rd party 1020 links", where one party can provide links that have another 1021 party's resource as an anchor. Depending on the link semantics 1022 and the application context, it is important to verify that there 1023 is sufficient trust in that 3rd party to allow it to provide these 1024 links. Applications may choose to treat 3rd party links 1025 differently than cases where a resource and the links for that 1026 resource are provided by the same party. 1028 10. References 1030 10.1. Normative References 1032 [RFC0822] Crocker, D., "STANDARD FOR THE FORMAT OF ARPA INTERNET 1033 TEXT MESSAGES", STD 11, RFC 822, DOI 10.17487/RFC0822, 1034 August 1982, . 1036 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1037 Requirement Levels", BCP 14, RFC 2119, 1038 DOI 10.17487/RFC2119, March 1997, 1039 . 1041 [RFC3629] Yergeau, F., "UTF-8, a transformation format of ISO 1042 10646", STD 63, RFC 3629, DOI 10.17487/RFC3629, November 1043 2003, . 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 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 1051 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 1052 September 2009, . 1054 [RFC6690] Shelby, Z., "Constrained RESTful Environments (CoRE) Link 1055 Format", RFC 6690, DOI 10.17487/RFC6690, August 2012, 1056 . 1058 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1059 Specifications and Registration Procedures", BCP 13, 1060 RFC 6838, DOI 10.17487/RFC6838, January 2013, 1061 . 1063 [RFC6982] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1064 Code: The Implementation Status Section", RFC 6982, 1065 DOI 10.17487/RFC6982, July 2013, 1066 . 1068 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1069 Protocol (HTTP/1.1): Message Syntax and Routing", 1070 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1071 . 1073 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1074 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1075 DOI 10.17487/RFC7231, June 2014, 1076 . 1078 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1079 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1080 May 2017, . 1082 [RFC8187] Reschke, J., "Indicating Character Encoding and Language 1083 for HTTP Header Field Parameters", RFC 8187, 1084 DOI 10.17487/RFC8187, September 2017, 1085 . 1087 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 1088 Interchange Format", STD 90, RFC 8259, 1089 DOI 10.17487/RFC8259, December 2017, 1090 . 1092 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 1093 DOI 10.17487/RFC8288, October 2017, 1094 . 1096 10.2. Informative References 1098 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 1099 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 1100 December 2005, . 1102 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 1103 DOI 10.17487/RFC5988, October 2010, 1104 . 1106 [W3C.REC-json-ld-20140116] 1107 Sporny, M., Kellogg, G., and M. Lanthaler, "JSON-LD 1.0", 1108 World Wide Web Consortium Recommendation REC-json-ld- 1109 20140116, January 2014, 1110 . 1112 10.3. URIs 1114 [1] https://www.w3.org/TR/2014/REC-json-ld-20140116/#interpreting- 1115 json-as-json-ld 1117 [2] https://tools.ietf.org/html/rfc8288#appendix-A.2 1119 Appendix A. Acknowledgements 1121 Thanks for comments and suggestions provided by Phil Archer, 1122 Dominique Guinard, Mark Nottingham, Stian Soiland-Reyes, and Sarven 1123 Capadisli. 1125 Appendix B. JSON-LD Context 1127 A set of links rendered according to the JSON serialization defined 1128 in Section 4.2 can be interpreted as RDF triples by adding a JSON-LD 1129 context [W3C.REC-json-ld-20140116] that maps the JSON keys to 1130 corresponding Linked Data terms. And, as per 1131 [W3C.REC-json-ld-20140116] section 6.8 [1], when delivering a link 1132 set that is rendered according to the "application/linkset+json" 1133 media type to a user agent, a server can convey the availability of 1134 such a JSON-LD context by using a link with the relation type 1135 "http://www.w3.org/ns/json-ld#context" in the HTTP "Link" header. 1137 Using the latter approach to support discovery of a JSON-LD Context, 1138 the response to the GET request of Figure 3 against the URI of a set 1139 of links would be as shown in Figure 7. 1141 HTTP/1.1 200 OK 1142 Date: Mon, 12 Aug 2019 10:48:22 GMT 1143 Server: Apache-Coyote/1.1 1144 Content-Type: application/linkset+json 1145 Link: 1146 ; rel="http://www.w3.org/ns/json-ld#context" 1147 ; type="application/ld+json" 1148 Content-Length: 846 1149 { 1150 "linkset": [ 1151 { 1152 "anchor": "https://example.org/article/view/7507", 1153 "author": [ 1154 { 1155 "href": "https://orcid.org/0000-0002-1825-0097" 1156 } 1157 ], 1158 "item": [ 1159 { 1160 "href": "https://example.org/article/7507/item/1", 1161 "type": "application/pdf" 1162 }, 1163 { 1164 "href": "https://example.org/article/7507/item/2", 1165 "type": "text/csv" 1166 } 1167 ], 1168 "cite-as": [ 1169 { 1170 "href": "https://doi.org/10.5555/12345680", 1171 "title": "A Methodology for the Emulation of Architecture" 1172 } 1173 ] 1174 }, 1175 { 1176 "anchor": "https://example.com/links/article/7507", 1177 "alternate": [ 1178 { 1179 "href": "https://mirror.example.com/links/article/7507", 1180 "type": "application/linkset" 1181 } 1182 ] 1183 } 1184 ] 1185 } 1187 Figure 7: Using a typed link to support discovery of a JSON-LD 1188 Context for a Set of Links 1190 In order to obtain the JSON-LD Context conveyed by the server, the 1191 user agent issues an HTTP GET against the link target of the link 1192 with the "http://www.w3.org/ns/json-ld#context" relation type. The 1193 response to this GET is shown in Figure 8. This particular JSON-LD 1194 context maps "application/linkset+json" representations of link sets 1195 to Dublin Core Terms. It also renders each link relation as an 1196 absolute URI, inspired by the same approach used for Atom [RFC4287] 1197 described in [RFC8288] appendix A.2 [2]. 1199 HTTP/1.1 200 OK 1200 Content-Type: application/ld+json 1201 Content-Length: 638 1202 { 1203 "@context": [ 1204 { 1205 "@vocab": "http://www.iana.org/assignments/relation/", 1206 "anchor": "@id", 1207 "href": "@id", 1208 "linkset": "@graph", 1209 "_linkset": "@graph", 1210 "title": { 1211 "@id": "http://purl.org/dc/terms/title" 1212 }, 1213 "title*": { 1214 "@id": "http://purl.org/dc/terms/title" 1215 }, 1216 "type": { 1217 "@id": "http://purl.org/dc/terms/format" 1218 } 1219 }, 1220 { 1221 "language": "@language", 1222 "value": "@value", 1223 "hreflang": { 1224 "@id": "http://purl.org/dc/terms/language", 1225 "@container": "@set" 1226 } 1227 } 1228 ] 1229 } 1231 Figure 8: JSON-LD Context mapping to schema.org and IANA assignments 1233 Applying the JSON-LD context of Figure 8 to the link set of Figure 7 1234 allows transforming the "application/linkset+json" link set to an RDF 1235 link set. Figure 9 shows the latter represented by means of the 1236 "text/turtle" RDF serialization. 1238 1239 1240 . 1241 1242 1243 . 1244 1245 1246 "application/pdf" . 1247 1248 1249 . 1250 1251 1252 "text/csv" . 1253 1254 1255 . 1256 1257 1258 "A Methodology for the Emulation of Architecture" . 1259 1260 1261 . 1262 1263 1264 "application/linkset" . 1266 Figure 9: RDF serialization of the link set resulting from applying 1267 the JSON-LD context 1269 Note that the JSON-LD context of Figure 8 does not handle (meta)link 1270 relations of type ""linkset"" as they are in conflict with the top- 1271 level JSON key. A workaround is to rename the top-level key to 1272 ""_linkset"" in the "application/linkset+json" before transforming a 1273 link set to JSON-LD. 1275 Authors' Addresses 1277 Erik Wilde 1278 Axway 1280 Email: erik.wilde@dret.net 1281 URI: http://dret.net/netdret/ 1282 Herbert Van de Sompel 1283 Data Archiving and Networked Services 1285 Email: herbert.van.de.sompel@dans.knaw.nl 1286 URI: https://orcid.org/0000-0002-0715-6126