idnits 2.17.1 draft-wilde-linkset-06.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 : ---------------------------------------------------------------------------- ** There is 1 instance of too long lines in the document, the longest one being 10 characters in excess of 72. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (May 1, 2020) is 1428 days in the past. Is this intentional? Checking references for intended status: Informational ---------------------------------------------------------------------------- -- Looks like a reference, but probably isn't: '1' on line 1110 -- Looks like a reference, but probably isn't: '2' on line 1177 == Outdated reference: A later version (-03) exists of draft-nottingham-link-hint-02 ** 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 (~~), 2 warnings (==), 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: November 2, 2020 Data Archiving and Networked Services 6 May 1, 2020 8 Linkset: Media Types and a Link Relation Type for Link Sets 9 draft-wilde-linkset-06 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 ART mailing list 23 (). 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 November 2, 2020. 45 Copyright Notice 47 Copyright (c) 2020 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 . . . . . . 4 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 . . . . . . . . . . . . . . . . . 7 73 4.2.3. Link Target Object . . . . . . . . . . . . . . . . . 8 74 4.2.4. Link Target Attributes . . . . . . . . . . . . . . . 10 75 5. The "linkset" Relation Type for Linking to a Set of Links . . 15 76 6. Examples . . . . . . . . . . . . . . . . . . . . . . . . . . 15 77 6.1. Set of Links Provided as application/linkset . . . . . . 15 78 6.2. Set of Links Provided as application/linkset+json . . . . 16 79 6.3. Discovering a Link Set via the "linkset" Link Relation 80 Type . . . . . . . . . . . . . . . . . . . . . . . . . . 19 81 7. Implementation Status . . . . . . . . . . . . . . . . . . . . 19 82 7.1. Open Journal Systems (OJS) . . . . . . . . . . . . . . . 20 83 8. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 20 84 8.1. Link Relation Type: linkset . . . . . . . . . . . . . . . 20 85 8.2. Media Type: application/linkset . . . . . . . . . . . . . 20 86 8.2.1. IANA Considerations . . . . . . . . . . . . . . . . . 20 87 8.3. Media Type: application/linkset+json . . . . . . . . . . 21 88 9. Security Considerations . . . . . . . . . . . . . . . . . . . 22 89 10. References . . . . . . . . . . . . . . . . . . . . . . . . . 23 90 10.1. Normative References . . . . . . . . . . . . . . . . . . 23 91 10.2. Informative References . . . . . . . . . . . . . . . . . 24 92 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 25 93 Appendix B. JSON-LD Context . . . . . . . . . . . . . . . . . . 25 94 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 29 96 1. Introduction 98 Resources on the Web often use typed Web Links [RFC8288], either 99 embedded in resource representations, for example using the 100 element for HTML documents, or conveyed in the HTTP "Link" header for 101 documents of any media type. In some cases, however, providing links 102 in this manner is impractical or impossible and delivering a set of 103 links as a stand-alone document is preferable. 105 Therefor, this specification defines two document formats and 106 associated media types to represent sets of links. It also defines 107 the "linkset" relation type that supports discovery of any resource 108 that conveys a set of links as a stand-alone document. 110 2. Terminology 112 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 113 "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and 114 "OPTIONAL" in this document are to be interpreted as described in BCP 115 14 [RFC2119] [RFC8174] when, and only when, they appear in all 116 capitals, as shown here. 118 This specification uses the terms "link context" and "link target" as 119 defined in [RFC8288]. These terms respectively correspond with 120 "Context IRI" and "Target IRI" as used in [RFC5988]. Although 121 defined as IRIs, in common scenarios they are also URIs. 123 In the examples provided in this document, links in the HTTP "Link" 124 header are shown on separate lines in order to improve readability. 125 Note, however, that as per Section 3.2 of [RFC7230], line breaks are 126 not allowed in values for HTTP headers; only whitespaces and tabs are 127 supported as seperators. 129 3. Scenarios 131 The following sections outline scenarios in which providing links by 132 means of a standalone document instead of in an HTTP "Link" header 133 field or as links embedded in the resource representation is 134 advantageous or necessary. 136 For all scenarios, links could be provided by means of a stand-alone 137 document that is formatted according to the JSON-based serialization, 138 the serialization aligned with the HTTP "Link" header format, or 139 both. The former serialization is motivated by the widespread use of 140 JSON and related tools, which suggests that handling sets of links 141 expressed as JSON documents should be attractive to developers. The 142 latter serialization is provided for compatibility with the existing 143 serialization used in the HTTP "Link" header and to allow reuse of 144 tools created to handle it. 146 It is important to keep in mind that when providing links by means of 147 a standalone representation, other links can still be provided using 148 other approaches, i.e. it is possible combine various mechanisms to 149 convey links. 151 3.1. Third-Party Links 153 In some cases it is useful that links pertaining to a resource are 154 provided by a server other than the one that hosts the resource. For 155 example, this allows: 157 o Providing links in which the resource is involved not just as link 158 context but also as link target. 160 o Providing links pertaining to the resource that the server hosting 161 that resource is not aware of. 163 o External management of links pertaining to the resource in a 164 special-purpose link management service. 166 In such cases, links pertaining to a resource can be provided by 167 another, specific resource. That specific resource may be managed by 168 the same or by another custodian as the resource to which the links 169 pertain. For clients intent on consuming links provided in that 170 manner, it would be beneficial if the following conditions were met: 172 o Links are provided in a document that uses a well-defined media 173 type. 175 o The resource to which the provided links pertain is able to link 176 to the resource that provides these links using a well-known link 177 relation type. 179 These requirements are addressed in this specification through the 180 definition of two media types and a link relation type, respectively. 182 3.2. Challenges Writing to HTTP Link Header Field 184 In some cases, it is not straightforward to write links to the HTTP 185 "Link" header field from an application. This can, for example, be 186 the case because not all required link information is available to 187 the application or because the application does not have the 188 capability to directly write HTTP headers. In such cases, providing 189 links by means of a standalone document can be a solution. Making 190 the resource that provides these links discoverable can be achieved 191 by means of a typed link. 193 3.3. Large Number of Links 195 When conveying links in an HTTP "Link" header field, it is possible 196 for the size of the HTTP response header to become unpredictable. 197 This can be the case when links are determined dynamically dependent 198 on a range of contextual factors. It is possible to statically 199 configure a web server to correctly handle large HTTP response 200 headers by specifying an upper bound for their size. But when the 201 number of links is unpredictable, estimating a reliable upper bound 202 is challenging. 204 HTTP [RFC7231] defines error codes related to excess communication by 205 the user agent ("413 Request Entity Too Large" and "414 Request-URI 206 Too Long"), but no specific error codes are defined to indicate that 207 response header content exceeds the upper bound that can be handled 208 by the server, and thus it has been truncated. As a result, 209 applications take counter measures aimed at controlling the size of 210 the HTTP "Link" header field, for example by limiting the links they 211 provide to those with select relation types, thereby limiting the 212 value of the HTTP "Link" header field to clients. Providing links by 213 means of a standalone document overcomes challenges related to the 214 unpredictable nature of the size of HTTP "Link" header fields. 216 In more extreme scenarios it is conceivable that the number of links 217 to be conveyed becomes so large that even a standalone document would 218 become too large. For example, this could be the case for highly 219 interlinked resources and when links are provided in which such 220 resources participates as both link context and link target. In such 221 cases, the links could be delivered incrementally, for example, by 222 means of a paged resource model. 224 4. Document Formats for Sets of Links 226 This section specifies two document formats to convey a set of links. 227 Both are based on the abstract model specified in Section 2 of Web 228 Linking [RFC8288] that defines a link as consisting of a "link 229 context", a "link relation type", a "link target", and optional 230 "target attributes": 232 o The format defined in Section 4.1 is identical to the payload of 233 the HTTP "Link" header field as specified in Web Linking 234 [RFC8288]. 236 o The format defined in Section 4.2 is based on JSON [RFC8259]. 238 Note that [RFC8288] deprecates the "rev" construct that was provided 239 by [RFC5988] as a means to express links with a directionality that 240 is the inverse of direct links that use the "rel" construct. In both 241 serializations for link sets defined here, inverse links are handled 242 as direct links by switching the position of the resources involved 243 in the link. 245 4.1. HTTP Link Document Format: application/linkset 247 This document format is identical to the payload of the HTTP "Link" 248 header field as defined in Section 3 of [RFC8288], more specifically 249 by its ABNF production rule for "Link" and subsequent ones. 251 The assigned media type for this format is "application/linkset". 253 In order to support use cases where "application/linkset" documents 254 are re-used outside the context of an HTTP interaction, it is 255 RECOMMENDED to make them self-contained by adhering to the following 256 guidelines: 258 o For every link provided in the set of links, explicitly provide 259 the link context using the "anchor" attribute. 261 o For link context ("anchor" attribute) and link target ("href" 262 attribute), use absolute URIs (as defined in Section 4.3 of 263 [RFC3986]). 265 If these recommendations are not followed, interpretation of links in 266 "application/linkset" documents will depend on which URI is used as 267 context. 269 4.2. JSON Document Format: application/linkset+json 271 This document format uses JSON [RFC8259] as the syntax to represent a 272 set of links. The set of links follows the abstract model defined by 273 Web Linking [RFC8288]. 275 The assigned media type for this format is "application/ 276 linkset+json". 278 In order to support use cases where "application/linkset+json" 279 documents are re-used outside the context of an HTTP interaction, it 280 is RECOMMENDED to make them self-contained by adhering to the 281 following guidelines: 283 o For every link provided in the set of links, explicitly provide 284 the link context using the "anchor" member. 286 o For link context ("anchor" member) and link target ("href" 287 member), use absolute URIs (as defined in Section 4.3 of 288 [RFC3986]). 290 If these recommendations are not followed, interpretation of 291 "application/linkset+json" will depend on which URI is used as 292 context URI. 294 The "application/linkset+json" serialization is designed such that it 295 can directly be used as the content of a JSON-LD serialization by 296 adding an appropriate context. Appendix B shows an example of a 297 possible context that, when added to a JSON serialization, allows it 298 to be interpreted as RDF. 300 4.2.1. Set of Links 302 In the JSON representation of a set of links: 304 o A set of links MUST be represented as a JSON object which MUST 305 have "linkset" as its sole member. 307 o The "linkset" member is an array in which a distinct JSON object - 308 the "link context object" (see Section 4.2.2) - MUST be used to 309 represent links that have the same link context. 311 o If necessary, the "linkset" member MAY contain information in 312 addition to link context objects, in which case that information 313 MUST NOT change the semantics of the links provided by those link 314 context objects. 316 o Even if there is only one link context object, it MUST be wrapped 317 in an array. Members other than link context objects MUST NOT be 318 included in this array. 320 4.2.2. Link Context Object 322 In the JSON representation one or more links that have the same link 323 context are represented by a JSON object, the link context object. A 324 link context object adheres to the following rules: 326 o Each link context object MUST have an "anchor" member with a value 327 that represents the link context. This value SHOULD be an 328 absolute URI as defined in Section 4.3 of [RFC3986]. Cases 329 whereby no value is to be provided for the "anchor" member (i.e. 330 the resource providing the set of links is the link context for 331 each link in the link context object) MUST be handled by providing 332 an "anchor" member with null value ("anchor": ""). 334 o For each distinct relation type that the link context has with 335 link targets, a link context object MUST have an additional 336 member. This member is an array in which a distinct JSON object - 337 the "link target object" (see Section 4.2.3) - MUST be used for 338 each link target for which the relationship with the link context 339 (value of the encompassing anchor member) applies. The name of 340 this member expresses the relation type of the link as follows: 342 o 344 * For registered relation types [RFC8288], the name of this 345 member is the registered name of the relation type. 347 * For extension relation types [RFC8288], the name of this member 348 is the URI that uniquely represents the relation type. 350 o Even if there is only one link target object it MUST be wrapped in 351 an array. Members other than link target objects MUST NOT be 352 included in this array. 354 4.2.3. Link Target Object 356 In the JSON representation a link target is represented by a JSON 357 object, the link target object. A link target object adheres to the 358 following rules: 360 o Each link target object MUST have an "href" member with a value 361 that represents the link target. This value SHOULD be an absolute 362 URI as defined in Section 4.3 of [RFC3986]. Cases whereby no 363 value is to be provided for the "href" member (i.e. the resource 364 providing the set of links is the target of the link in the link 365 target object) MUST be handled by providing an "href" member with 366 null value ("href": ""). 368 o In many cases, a link target is further qualified by target 369 attributes. Various types of attributes exist and they are 370 conveyed as additional members of the link target object as 371 detailed in Section 4.2.4. 373 The following example of a JSON-serialized set of links represents 374 one link with its core components: link context, link relation type, 375 and link target. 377 { 378 "linkset": 379 [ 380 { "anchor": "http://example.net/bar", 381 "next": [ 382 {"href": "http://example.com/foo"} 383 ] 384 } 385 ] 386 } 388 The following example of a JSON-serialized set of links represents 389 two links that share link context and relation type but have 390 different link targets. 392 { 393 "linkset": 394 [ 395 { "anchor": "http://example.net/bar", 396 "item": [ 397 {"href": "http://example.com/foo1"}, 398 {"href": "http://example.com/foo2"} 399 ] 400 } 401 ] 402 } 404 The following example shows a set of links that represents two links, 405 each with a different link context, link target, and relation type. 406 One relation type is registered, the other is an extension relation 407 type. 409 { 410 "linkset": 411 [ 412 { "anchor": "http://example.net/bar", 413 "next": [ 414 {"href": "http://example.com/foo1"} 415 ] 416 }, 417 { "anchor": "http://example.net/boo", 418 "http://example.com/relations/baz" : [ 419 {"href": "http://example.com/foo2"} 420 ] 421 } 422 ] 423 } 425 4.2.4. Link Target Attributes 427 A link may be further qualified by target attributes. Four types of 428 attributes exist: 430 o Attributes defined by the serialization of Web Linking [RFC8288]. 432 o Extension attributes defined and used by communities as allowed by 433 [RFC8288]. 435 o Internationalized versions of the "title" attribute defined by 436 [RFC8288] and of extension attributes allowed by [RFC8288]. 438 o Attributes defined by Link Hints [I-D.nottingham-link-hint] and 439 the associated HTTP Link Hint Registry. 441 The handling of these different types of attributes is described in 442 the sections below. 444 4.2.4.1. Target Attributes Defined by Web Linking 446 RFC 8288 defines the following target attributes that may be used to 447 annotate links: "hreflang", "media", "title", "title*", and "type"; 448 these target attributes follow different occurrence and value 449 patterns. In the JSON representation, these attributes MUST be 450 conveyed as additional members of the link target object as follows: 452 o "hreflang": The optional and repeatable "hreflang" target 453 attribute MUST be represented by an array (even if there only is 454 one value to be represented), and each value in that array MUST be 455 a string - representing one value of the "hreflang" target 456 attribute for a link - which follows the same model as in the 457 [RFC8288] syntax. 459 o "media": The optional and not repeatable "media" target attribute 460 MUST be represented by a "media" member in the link target object, 461 and its value MUST be a string that follows the same model as in 462 the [RFC8288] syntax. 464 o "type": The optional and not repeatable "type" target attribute 465 MUST be represented by a "type" member in the link target object, 466 and its value MUST be a string that follows the same model as in 467 the [RFC8288] syntax. 469 o "title": The optional and not repeatable "title" target attribute 470 MUST be represented by a "title" member in the link target object, 471 and its value MUST be a string that follows the same model as in 472 the [RFC8288] syntax. 474 o "title*": The optional and not repeatable "title*" target 475 attribute is motivated by character encoding and language issues 476 and follows the model defined in [RFC8187]. The details of the 477 JSON representation that applies to title* are described in 478 Section 4.2.4.2. 480 The following example illustrates how the repeatable "hreflang" and 481 the not repeatable "type" target attributes are represented in a link 482 target object. 484 { 485 "linkset": 486 [ 487 { "anchor": "http://example.net/bar", 488 "next": [ 489 {"href": "http://example.com/foo", 490 "type": "text/html", 491 "hreflang": [ "en" , "de" ] 492 } 493 ] 494 } 495 ] 496 } 498 4.2.4.2. Internationalized Target Attributes 500 In addition to the target attributes described in Section 4.2.4.1, 501 [RFC8288] also supports attributes that follow the content model of 502 [RFC8187]. In [RFC8288], these target attributes are recognizable by 503 the use of a trailing asterisk in the attribute name, such as 504 "title*". The content model of [RFC8187] uses a string-based 505 microsyntax that represents the character encoding, an optional 506 language tag, and the escaped attribute value encoded according to 507 the specified character encoding. 509 The JSON serialization for these target attributes MUST be as 510 follows: 512 o An internationalized target attribute is represented as a member 513 of the link context object with the same name (including the *) of 514 the attribute. 516 o The character encoding information as prescribed by [RFC8187] is 517 not preserved; instead, the content of the internationalized 518 attribute is represented in the character encoding used for the 519 JSON set of links. 521 o The value of the internationalized target attribute is an array 522 that contains one or more JSON objects. The name of the first 523 member of such JSON object is "value" and its value is the actual 524 content (in its unescaped version) of the internationalized target 525 attribute, i.e. the value of the attribute from which the encoding 526 and language information are removed. The name of the optional 527 second member of such JSON object is "language" and its value is 528 the language tag [RFC5646] for the language in which the attribute 529 content is conveyed. 531 The following example illustrates how the "title*" target attribute 532 defined by [RFC8288] is represented in a link target object. 534 { 535 "linkset": 536 [ 537 { "anchor": "http://example.net/bar", 538 "next": [ 539 {"href": "http://example.com/foo", 540 "type": "text/html", 541 "hreflang": [ "en" , "de" ], 542 "title": "Next chapter", 543 "title*": [ { "value": "nachstes Kapitel" , "language" : "de" } ] 544 } 545 ] 546 } 547 ] 548 } 550 The above example assumes that the German title contains an umlaut 551 character (in the native syntax it would be encoded as title*=UTF- 552 8'de'n%c3%a4chstes%20Kapitel), which gets encoded in its unescaped 553 form in the JSON representation. This is not shown in the above 554 example due to the limitations of RFC publication. Implementations 555 MUST properly decode/encode internationalized target attributes that 556 follow the model of [RFC8187] when transcoding between the 557 "application/linkset" and the "application/linkset+json" formats. 559 4.2.4.3. Extension Target Attributes 561 Extension target attributes are attributes that are not defined by 562 RFC 8288 (as listed in Section 4.2.4.1), but are nevertheless used to 563 qualify links. They can be defined by communities in any way deemed 564 necessary, and it is up to them to make sure their usage is 565 understood by target applications. However, lacking standardization, 566 there is no interoperable understanding of these extension 567 attributes. One important consequence is that their cardinality is 568 unknown to generic applications. Therefore, in the JSON 569 serialization, all extension target attributes are treated as 570 repeatable. 572 The JSON serialization for these target attributes MUST be as 573 follows: 575 o An extension target attribute is represented as a member of the 576 link context object with the same name of the attribute, including 577 the * if applicable. 579 o The value of an extension attribute MUST be represented by an 580 array, even if there only is one value to be represented. 582 o If the extension target attribute does not have a name with a 583 trailing asterisk, then each value in that array MUST be a string 584 that represents one value of the attribute. 586 o If the extension attribute has a name with a trailing asterisk (it 587 follows the content model of [RFC8187]), then each value in that 588 array MUST be a JSON object. The value of each such JSON object 589 MUST be structured as described in Section 4.2.4.2. 591 The example shows a link target object with three extension target 592 attributes. The value for each extension target attribute is an 593 array. The two first are regular extension target attributes, with 594 the first one ("foo") having only one value and the second one 595 ("bar") having two. The last extension target attribute ("baz*") 596 follows the naming rule of [RFC8187] and therefore is encoded 597 according to the serialization described in Section 4.2.4.2. 599 { 600 "linkset": 601 [ 602 { "anchor": "http://example.net/bar", 603 "next": [ 604 { "href": "http://example.com/foo", 605 "type": "text/html", 606 "foo": [ "foovalue" ], 607 "bar": [ "barone", "bartwo" ], 608 "baz*": [ { "value": "bazvalue" , "language" : "en" } ] 609 } 610 ] 611 } 612 ] 613 } 615 4.2.4.4. Target Attributes in the HTTP Link Hints Registry 617 In order to augment interoperability regarding target attributes, 618 Link Hints [I-D.nottingham-link-hint] defines a registration 619 mechanism for target attributes, an associated HTTP Link Hint 620 Registry, and a set of attributes to initially populate that 621 registry. The initial registry, for example, includes the "allow" 622 attribute that can be used to convey the HTTP methods that are 623 supported to interact with the target resource. 625 The JSON serialization for these target attributes MUST be as 626 follows: 628 o A Link Hint target attribute is represented as a member of the 629 link context object with the same name of the attribute as 630 registered in the HTTP Link Hint Registry. 632 o The value of a Link Hint target attribute MUST adhere to the 633 content model specified for the attribute in the HTTP Link Hint 634 Registry. 636 o Internationalization of Link Hint target attributes is not 637 applicable. 639 The example shows a link target object with the "Type" attribute 640 defined by [RFC8187] and the "allow" attribute that is registered in 641 the HTTP Link Hint Registry. The registry specifies the content 642 model for this attribute as an array of strings. Therefor, that same 643 content model is used in the "application/linkset+json" serialization 644 of sets of links. 646 { 647 "linkset": 648 [ 649 { "anchor": "http://example.net/bar", 650 "next": [ 651 { "href": "http://example.com/foo", 652 "type": "text/html", 653 "allow": [ "GET", "POST" ]] 654 } 655 ] 656 } 657 ] 658 } 660 5. 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 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 not expressed as absolute URIs MUST 682 properly determine what the context is for these links; it SHOULD 683 ignore links for which it is unable to unambiguously make that 684 determination. 686 6. Examples 688 Section 6.1 and Section 6.2 show examples whereby the set of links 689 are provided as "application/linkset" and "application/linkset+json" 690 documents, respectively. Section 6.3 illustrates the use of the 691 "linkset" link relation type to support discovery of sets of links. 693 6.1. Set of Links Provided as application/linkset 695 Figure 1 shows a client issuing an HTTP GET request against resource 696 . 698 GET /resource1 HTTP/1.1 699 Host: example.org 700 Connection: close 702 Figure 1: Client HTTP GET request 704 Figure 2 shows the response to the GET request of Figure 1. The 705 response contains a Content-Type header specifying that the media 706 type of the response is "application/linkset". A set of links, 707 including links that pertain to the responding resource, is provided 708 in the response body. 710 HTTP/1.1 200 OK 711 Date: Mon, 12 Aug 2019 10:35:51 GMT 712 Server: Apache-Coyote/1.1 713 Content-Length: 729 714 Content-Type: application/linkset 715 Connection: close 717 718 ; rel="author" 719 ; type="application/rdf+xml" 720 ; anchor="http://example.org/resource1", 721 722 ; rel="author" 723 ; type="application/rdf+xml" 724 ; anchor="http://example.org/resource1", 725 726 ; rel="item" 727 ; type="application/pdf" 728 ; anchor="http://example.org/resource1", 729 730 ; rel="item" 731 ; type="text/html" 732 ; anchor="http://example.org/resource1", 733 734 ; rel="latest-version" 735 ; anchor="http://example.org/resource41/", 736 737 ; rel="prev" 738 ; anchor="http://example.org/resource41/" 740 Figure 2: Response to HTTP GET includes a set of links 742 6.2. Set of Links Provided as application/linkset+json 744 Figure 3 shows the client issuing an HTTP GET request against 745 . In the request, the client 746 uses an "Accept" header to indicate it prefers a response in the 747 "application/linkset+json" format. 749 GET links/article/7507 HTTP/1.1 750 Host: example.com 751 Accept: application/linkset+json 752 Connection: close 754 Figure 3: Client HTTP GET request expressing preference for 755 "application/linkset+json" response 757 Figure 4 shows the response to the HTTP GET request of Figure 3. The 758 set of links is serialized according to the media type "application/ 759 linkset+json". 761 HTTP/1.1 200 OK 762 Date: Mon, 12 Aug 2019 10:46:22 GMT 763 Server: Apache-Coyote/1.1 764 Content-Type: application/linkset+json 765 Content-Length: 802 767 { 768 "linkset": [ 769 { 770 "anchor": "https://example.org/article/view/7507", 771 "author": [ 772 { 773 "href": "https://orcid.org/0000-0002-1825-0097", 774 } 775 ], 776 "item": [ 777 { 778 "href": "https://example.org/article/7507/item/1", 779 "type": "application/pdf" 780 }, 781 { 782 "href": "https://example.org/article/7507/item/2", 783 "type": "text/csv" 784 } 785 ], 786 "cite-as": [ 787 { 788 "href": "https://doi.org/10.5555/12345680", 789 "title": "A Methodology for the Emulation of Architecture" 790 } 791 ] 792 }, 793 { 794 "anchor": "https://example.com/links/article/7507", 795 "alternate": [ 796 { 797 "href": "https://mirror.example.com/links/article/7507", 798 "type": "application/linkset" 799 } 800 ] 801 } 802 ] 803 } 805 Figure 4: Response to the client's request for the set of links 807 6.3. Discovering a Link Set via the "linkset" Link Relation Type 809 Figure 5 shows a client issuing an HTTP HEAD request against resource 810 . 812 HEAD article/view/7507 HTTP/1.1 813 Host: example.org 814 Connection: close 816 Figure 5: Client HTTP HEAD request 818 Figure 6 shows the response to the HEAD request of Figure 5. The 819 response contains a "Link" header with a link that has the "linkset" 820 relation type. It indicates that a set of links is provided by 821 resource , which provides a 822 representation with media type "application/linkset+json". 824 HTTP/1.1 200 OK 825 Date: Mon, 12 Aug 2019 10:45:54 GMT 826 Server: Apache-Coyote/1.1 827 Link: 828 ; rel="linkset" 829 ; type="application/linkset+json" 830 Content-Length: 236 831 Content-Type: text/html;charset=utf-8 832 Connection: close 834 Figure 6: Response to HTTP HEAD request 836 Section 6.2 shows a client obtaining a set of links by issuing an 837 HTTP GET on the target of the link with the "linkset" relation type, 838 . 840 7. Implementation Status 842 Note to RFC Editor: Please remove this section before publication. 844 This section records the status of known implementations of the 845 protocol defined by this specification at the time of posting of this 846 Internet-Draft, and is based on a proposal described in RFC 6982 847 [RFC6982]. The description of implementations in this section is 848 intended to assist the IETF in its decision processes in progressing 849 drafts to RFCs. Please note that the listing of any individual 850 implementation here does not imply endorsement by the IETF. 851 Furthermore, no effort has been spent to verify the information 852 presented here that was supplied by IETF contributors. This is not 853 intended as, and must not be construed to be, a catalog of available 854 implementations or their features. Readers are advised to note that 855 other implementations may exist. 857 According to RFC 6982, "this will allow reviewers and working groups 858 to assign due consideration to documents that have the benefit of 859 running code, which may serve as evidence of valuable experimentation 860 and feedback that have made the implemented protocols more mature. 861 It is up to the individual working groups to use this information as 862 they see fit". 864 7.1. Open Journal Systems (OJS) 866 Open Journal Systems (OJS) is an open-source software for the 867 management of peer-reviewed academic journals, and is created by the 868 Public Knowledge Project (PKP), released under the GNU General Public 869 License. Open Journal Systems (OJS) is a journal management and 870 publishing system that has been developed by PKP through its 871 federally funded efforts to expand and improve access to research. 873 The OJS platform has implemented "linkset" support as an alternative 874 way to provide links when there are more than a configured limit 875 (they consider using about 10 as a good default, for testing purpose 876 it is currently set to 8). 878 8. IANA Considerations 880 8.1. Link Relation Type: linkset 882 The link relation type below has been registered by IANA per 883 Section 6.2.1 of Web Linking [RFC8288]: 885 Relation Name: linkset 887 Description: The Target IRI of a link with the "linkset" relation 888 type provides a set of links, including links in which the Context 889 IRI of the link participates. 891 Reference: [[ This document ]] 893 8.2. Media Type: application/linkset 895 8.2.1. IANA Considerations 897 The Internet media type [RFC6838] for a natively encoded linkset is 898 application/linkset. 900 Type name: application 901 Subtype name: linkset 903 Required parameters: none 905 Optional parameters: none 907 Encoding considerations: ... 909 Security considerations: ... 911 Interoperability considerations: ... 913 Published specification: [[ This document ]] 915 Applications that use this media type: ... 917 Additional information: 919 Magic number(s): N/A 921 File extension(s): This media type does not propose a specific 922 extension. 924 Macintosh file type code(s): TEXT 926 Person & email address to contact for further information: Erik 927 Wilde 929 Intended usage: COMMON 931 Restrictions on usage: none 933 Author: Erik Wilde 935 Change controller: IETF 937 8.3. Media Type: application/linkset+json 939 The Internet media type [RFC6838] for a JSON-encoded linkset is 940 application/linkset+json. 942 Type name: application 944 Subtype name: linkset+json 946 Required parameters: none 948 Optional parameters: none 949 Encoding considerations: ... 951 Security considerations: ... 953 Interoperability considerations: ... 955 Published specification: [[ This document ]] 957 Applications that use this media type: ... 959 Additional information: 961 Magic number(s): N/A 963 File extension(s): JSON documents often use ".json" as the file 964 extension, and this media type does not propose a specific 965 extension other than this generic one. 967 Macintosh file type code(s): TEXT 969 Person & email address to contact for further information: Erik 970 Wilde 972 Intended usage: COMMON 974 Restrictions on usage: none 976 Author: Erik Wilde 978 Change controller: IETF 980 9. Security Considerations 982 The security considerations of Web Linking [RFC8288] apply, as long 983 as they are not specifically discussing the risks of exposing 984 information in HTTP header fields. 986 In general, links may cause information leakage when they expose 987 information (such as URIs) that can be sensitive or private. Links 988 may expose "hidden URIs" that are not supposed to be openly shared, 989 and may not be sufficiently protected. Ideally, none of the URIs 990 exposed in links should be supposed to be "hidden"; instead, if these 991 URIs are supposed to be limited to certain users, then technical 992 measures should be put in place so that accidentally exposing them 993 does not cause any harm. 995 For the specific mechanisms defined in this specification, two 996 security considerations should be taken into account: 998 o The original model of Web Linking always has an "implicit 999 context", which is the resource of the HTTP interaction. This 1000 context can be lost or can change when using self-contained link 1001 representations. Changing the context can change the 1002 interpretation of links when they have no explicit anchor, or when 1003 they use relative URIs. Applications may choose to ignore links 1004 that have no explicit anchor or that use relative URIs when these 1005 are exchanged in stand-alone resources. 1007 o The model introduced in this specification supports "3rd party 1008 links", where one party can provide links that have another 1009 party's resource as an anchor. Depending on the link semantics 1010 and the application context, it is important to verify that there 1011 is sufficient trust in that 3rd party to allow it to provide these 1012 links. Applications may choose to treat 3rd party links 1013 differently than cases where a resource and the links for that 1014 resource are provided by the same party. 1016 10. References 1018 10.1. Normative References 1020 [I-D.nottingham-link-hint] 1021 Nottingham, M., "HTTP Link Hints", draft-nottingham-link- 1022 hint-02 (work in progress), March 2020. 1024 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1025 Requirement Levels", BCP 14, RFC 2119, 1026 DOI 10.17487/RFC2119, March 1997, 1027 . 1029 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 1030 Resource Identifier (URI): Generic Syntax", STD 66, 1031 RFC 3986, DOI 10.17487/RFC3986, January 2005, 1032 . 1034 [RFC5646] Phillips, A., Ed. and M. Davis, Ed., "Tags for Identifying 1035 Languages", BCP 47, RFC 5646, DOI 10.17487/RFC5646, 1036 September 2009, . 1038 [RFC6838] Freed, N., Klensin, J., and T. Hansen, "Media Type 1039 Specifications and Registration Procedures", BCP 13, 1040 RFC 6838, DOI 10.17487/RFC6838, January 2013, 1041 . 1043 [RFC6982] Sheffer, Y. and A. Farrel, "Improving Awareness of Running 1044 Code: The Implementation Status Section", RFC 6982, 1045 DOI 10.17487/RFC6982, July 2013, 1046 . 1048 [RFC7230] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1049 Protocol (HTTP/1.1): Message Syntax and Routing", 1050 RFC 7230, DOI 10.17487/RFC7230, June 2014, 1051 . 1053 [RFC7231] Fielding, R., Ed. and J. Reschke, Ed., "Hypertext Transfer 1054 Protocol (HTTP/1.1): Semantics and Content", RFC 7231, 1055 DOI 10.17487/RFC7231, June 2014, 1056 . 1058 [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 1059 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, 1060 May 2017, . 1062 [RFC8187] Reschke, J., "Indicating Character Encoding and Language 1063 for HTTP Header Field Parameters", RFC 8187, 1064 DOI 10.17487/RFC8187, September 2017, 1065 . 1067 [RFC8259] Bray, T., Ed., "The JavaScript Object Notation (JSON) Data 1068 Interchange Format", STD 90, RFC 8259, 1069 DOI 10.17487/RFC8259, December 2017, 1070 . 1072 [RFC8288] Nottingham, M., "Web Linking", RFC 8288, 1073 DOI 10.17487/RFC8288, October 2017, 1074 . 1076 10.2. Informative References 1078 [RFC4287] Nottingham, M., Ed. and R. Sayre, Ed., "The Atom 1079 Syndication Format", RFC 4287, DOI 10.17487/RFC4287, 1080 December 2005, . 1082 [RFC5988] Nottingham, M., "Web Linking", RFC 5988, 1083 DOI 10.17487/RFC5988, October 2010, 1084 . 1086 [W3C.REC-json-ld-20140116] 1087 Sporny, M., Kellogg, G., and M. Lanthaler, "JSON-LD 1.0", 1088 World Wide Web Consortium Recommendation REC-json-ld- 1089 20140116, January 2014, 1090 . 1092 10.3. URIs 1094 [1] https://www.w3.org/TR/2014/REC-json-ld-20140116/#interpreting- 1095 json-as-json-ld 1097 [2] https://tools.ietf.org/html/rfc8288#appendix-A.2 1099 Appendix A. Acknowledgements 1101 Thanks for comments and suggestions provided by Mark Nottingham, 1102 Stian Soiland-Reyes, Sarven Capadisli, ... 1104 Appendix B. JSON-LD Context 1106 A set of links rendered according to the JSON serialization defined 1107 in Section 4.2 can be interpreted as RDF triples by adding a JSON-LD 1108 context [W3C.REC-json-ld-20140116] that maps the JSON keys to 1109 corresponding Linked Data terms. And, as per 1110 [W3C.REC-json-ld-20140116] section 6.8 [1], when delivering a link 1111 set that is rendered according to the "application/linkset+json" 1112 media type to a user agent, a server can convey the availability of 1113 such a JSON-LD context by using a link with the relation type 1114 "http://www.w3.org/ns/json-ld#context" in the HTTP "Link" header. 1116 Using the latter approach to support discovery of a JSON-LD Context, 1117 the response to the GET request of Figure 3 against the URI of a set 1118 of links would be as shown in Figure 7. 1120 HTTP/1.1 200 OK 1121 Date: Mon, 12 Aug 2019 10:48:22 GMT 1122 Server: Apache-Coyote/1.1 1123 Content-Type: application/linkset+json 1124 Link: 1125 ; rel="http://www.w3.org/ns/json-ld#context" 1126 ; type="application/ld+json" 1127 Content-Length: 846 1129 { 1130 "linkset": [ 1131 { 1132 "anchor": "https://example.org/article/view/7507", 1133 "author": [ 1134 { 1135 "href": "https://orcid.org/0000-0002-1825-0097" 1136 } 1137 ], 1138 "item": [ 1139 { 1140 "href": "https://example.org/article/7507/item/1", 1141 "type": "application/pdf" 1142 }, 1143 { 1144 "href": "https://example.org/article/7507/item/2", 1145 "type": "text/csv" 1146 } 1147 ], 1148 "cite-as": [ 1149 { 1150 "href": "https://doi.org/10.5555/12345680", 1151 "title": "A Methodology for the Emulation of Architecture" 1152 } 1153 ] 1154 }, 1155 { 1156 "anchor": "https://example.com/links/article/7507", 1157 "alternate": [ 1158 { 1159 "href": "https://mirror.example.com/links/article/7507", 1160 "type": "application/linkset" 1161 } 1162 ] 1163 } 1164 ] 1165 } 1167 Figure 7: Using a typed link to support discovery of a JSON-LD 1168 Context for a Set of Links 1170 In order to obtain the JSON-LD Context conveyed by the server, the 1171 user agent issues an HTTP GET against the link target of the link 1172 with the "http://www.w3.org/ns/json-ld#context" relation type. The 1173 response to this GET is shown in Figure 8. This particular JSON-LD 1174 context maps "application/linkset+json" representations of link sets 1175 to Dublin Core Terms. It also renders each link relation as an 1176 absolute URI, inspired by the same approach used for Atom [RFC4287] 1177 described in [RFC8288] appendix A.2 [2]. 1179 HTTP/1.1 200 OK 1180 Content-Type: application/ld+json 1181 Content-Length: 638 1183 { 1184 "@context": [ 1185 { 1186 "@vocab": "http://www.iana.org/assignments/relation/", 1187 "anchor": "@id", 1188 "href": "@id", 1189 "linkset": "@graph", 1190 "_linkset": "@graph", 1191 "title": { 1192 "@id": "http://purl.org/dc/terms/title" 1193 }, 1194 "title*": { 1195 "@id": "http://purl.org/dc/terms/title" 1196 }, 1197 "type": { 1198 "@id": "http://purl.org/dc/terms/format" 1199 } 1200 }, 1201 { 1202 "language": "@language", 1203 "value": "@value", 1204 "hreflang": { 1205 "@id": "https://www.w3.org/ns/activitystreams#hreflang", 1206 "@container": "@set" 1207 } 1208 } 1209 ] 1210 } 1212 Figure 8: JSON-LD Context mapping to schema.org and IANA assignments 1214 Applying the JSON-LD context of Figure 8 to the link set of Figure 7 1215 allows transforming the "application/linkset+json" link set to an RDF 1216 link set. Figure 9 shows the latter represented by means of the 1217 "text/turtle" RDF serialization. 1219 1220 1221 . 1223 1224 1225 . 1227 1228 1229 "application/pdf" . 1231 1232 1233 . 1235 1236 1237 "text/csv" . 1239 1240 1241 . 1243 1244 1245 "A Methodology for the Emulation of Architecture" . 1247 1248 1249 . 1251 1252 1253 "application/linkset" . 1255 Figure 9: RDF serialization of the link set resulting from applying 1256 the JSON-LD context 1258 Note that the JSON-LD context of Figure 8 does not handle (meta)link 1259 relations of type ""linkset"" as they are in conflict with the top- 1260 level JSON key. A workaround is to rename the top-level key to 1261 ""_linkset"" in the "application/linkset+json" before transforming a 1262 link set to JSON-LD. 1264 Authors' Addresses 1266 Erik Wilde 1267 Axway 1269 Email: erik.wilde@dret.net 1270 URI: http://dret.net/netdret/ 1272 Herbert Van de Sompel 1273 Data Archiving and Networked Services 1275 Email: herbert.van.de.sompel@dans.knaw.nl 1276 URI: https://orcid.org/0000-0002-0715-6126