Network Working Group | J. Montoya |
Internet-Draft | Mountain State Software Solutions |
Intended status: Informational | February 26, 2019 |
Expires: August 30, 2019 |
Extended Link Relationships
draft-montoya-xrel-00
This document defines XREL, a data format for describing extended hypermedia relationships identified by Uniform Resource Locators.
This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79.
Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet-Drafts is at https://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress."
This Internet-Draft will expire on August 30, 2019.
Copyright (c) 2019 IETF Trust and the persons identified as the document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Simplified BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Simplified BSD License.
This document defines XREL, a data format for describing extended hypermedia relationships identified by Uniform Resource Locators.
This document registers a media-type identifier with the IANA: application/xrel. This registration is for community review and will be submitted to the IESG for review, approval, and registration with IANA.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “NOT RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here.
Representational State Transfer, or REST, is an architectural style for distributed hypermedia systems. Introduced and first defined in 2000 in Chapter 5, REST, of the doctoral dissertation “Architectural Styles and the Design of Network-based Software Architecture” by Roy Fielding.
Hypermedia, or hypertext, is defined by the presence of application control information embedded within, or as a layer above, the presentation of information. Hypermedia allows for a virtually unbound network of resources while also guiding users through an application as they navigate said relationships.
A hypermedia relationship, also known as a link relation, describes the semantics behind a virtual uni-directional association between two resources.
A hypermedia relationship name is an identifier for a hypermedia relationship.
A resource is the intended conceptual target of a hypertext reference.
Representational state indicates the current state of the requested resource, the desired state for the requested resource, or the value of some other resource, such as a representation of the input data within a client’s query form, or a representation of some error condition for a response.
Application state is the state of the user’s application of computing to a given task, controlled and stored by the user agent and can be composed of representations from multiple servers.
This document and the specification documented in it are heavily influenced by the RAML 1.0 Spec.
A trailing question mark, for example description?, indicates an optional property.
Throughout this specification, markdown means GitHub-Flavored Markdown. Tooling MAY choose to ignore some Markdown features to address security concerns.
The Uniform Interface constraint of the REST architectural style dictates that hypermedia be the engine of application state. This means that the state of the application and its potential transitions are dictated by the presence of hypermedia relationships in-band and by the navigation of those relationships by an user (human or automated). In order for users to evaluate and select the appropriate relationships to navigate they must rely on an out-band understanding of relationships by their names.
While humans can derive meaning from relationship names in natural language, automated agents have relied on a central repository of standard names maintained by the Internet Assigned Numbers Authority (IANA). Instead of creating and registering entirely new link relations (i.e. patient, appointment, schedulingService, etc.) with a central repository, authors can choose to create an XREL document; one that explains the vital, perhaps domain-specific, semantics of the relationship and which is identified by an URL controlled by the author.
This decentralization allows for a much lower entry barrier, which is not inconsistent with the general concept of the web, and enables different use cases. For example, a private organization is fully capable of defining their own repository of XREL definitions outside of the open Internet, after all standards are a byproduct of authority. Conversely, public XREL definitions would allow for serendipitous reuse, where useful relationships backed by stable URLs might be discovered and possibly become de facto standard.
Following RAML conventions, XREL documents are YAML documents. The file extension .yaml SHALL be used to designate files containing XREL documents.
This specification uses YAML 1.2 as its underlying format. YAML is a human-readable data format that aligns well with the design goals of this specification. As in YAML, all nodes such as keys, values, and tags, are case-sensitive.
To facilitate the automated processing of XREL documents, XREL imposes the following restrictions and requirements in addition to the core YAML 1.2 specification:
Explains the semantics of a hypermedia relationship.
Name | Type | Description |
---|---|---|
description | string | Describes the semantics of a hypermedia relationship. The semantics SHOULD describe the relationship of the target resource to the context resource, and not any particular representation formats. Markdown MAY be used for rich text representation. |
Defines a single Relationship Object.
The first line of a XREL document MUST begin with the text #%XREL 1.0 followed by nothing but the end of the line.
#%XREL 1.0 description: Refers to an event scheduling service resource related to the context resource.
Defines a map where the keys are the document scoped relationship names and the values are Relationship Objects. XREL Collections can be used to combine any collection of Relationship Objects.
The first line of a collection document MUST begin with the text #%XREL 1.0 Collection followed by nothing but the end of the line.
#%XREL 1.0 Collection schedulingService: description: Refers to an event scheduling service resource related to the context resource. patient: description: Refers to a patient resource related to the context resource.
XREL documents are identified by unique URLs, this URL SHOULD be dereferenceable.
In order to reduce load on servers responding to XREL document requests, it is RECOMMENDED that servers use cache control directives that instruct client apps to locally cache the results. Clients making these XREL document requests SHOULD honor the server’s caching directives.
When applied to an XREL document, a URI fragment identifier MUST be a JSON Pointer and be computed as such.
In the case of XREL Documents as specified in Section 2.3, the URL that identifies that document also identifies the hypermedia relationship described in that document. For example, if the document example in Section 2.3.1 is served at http://docs.example.org/xrels/shedulingService then this URL is the identifier for the relationship described in that document.
In the case of XREL Collection Documents as specified in Section 2.4, fragment identifiers MUST be used for the relationships objects described in that document. For example, if the document example in Section 2.4.1 is served at http://docs.example.org/xrels/clinical then http://docs.example.org/xrels/clinical#/shedulingService and http://docs.example.org/xrels/clinical#/patient identify the first and second Relationship Object, respectively.
This specification establishes the media type application/xrel for community review and will be submitted to the IESG for review, approval, and registration with IANA.
Type name: application
Subtype name: xrel
Required parameters: none
Optional parameters:
Encoding considerations:
Security considerations:
Interoperability considerations: none
Fragment identifier considerations:
Published specification: This Document
Applications that use this media type: Various
Additional information:
Person to contact for further information:
Intended usage: Common
Author/change controller: Jose Montoya
Many thanks to Mike Amundsen, Jeff Michaud, Stu Charlton, Eric Wilde and Darrel Miller for their contributions in this space, even if not directly related to XREL documents.
The issues list for this draft can be found at https://github.com/phtal-org/internet-draft-xrel/issues. For additional information, see https://phtal-org.github.io/internet-draft-xrel/.
To provide feedback, use this issue tracker, the communication methods listed on the homepage, or email the document editors.
Link relations are universal, they describe an association to a conceptual target and not the targets themselves nor their representations. It is the responsibility of the application authors to communicate to their clients what data types are necessary to navigate a relationship and/or the data types that might be expected as a result.
This level of abstraction has value because it’s easier to standardize representations (HTML Microformats, RAML data types, etc.) and link relations than it is to standardize objects and object-specific interfaces. Application servers are free to combine representations and link relations in any way they wish and to provide them in any order, all while remaining understandable to the client.
[github.md] | McFarlane, J., "GitHub Flavored Markdown Spec", n.d.. |
[RFC1738] | Berners-Lee, T., Masinter, L. and M. McCahill, "Uniform Resource Locators (URL)", RFC 1738, DOI 10.17487/RFC1738, December 1994. |
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997. |
[RFC3986] | Berners-Lee, T., Fielding, R. and L. Masinter, "Uniform Resource Identifier (URI): Generic Syntax", STD 66, RFC 3986, DOI 10.17487/RFC3986, January 2005. |
[RFC6901] | Bryan, P., Zyp, K. and M. Nottingham, "JavaScript Object Notation (JSON) Pointer", RFC 6901, DOI 10.17487/RFC6901, April 2013. |
[RFC7320] | Nottingham, M., "URI Design and Ownership", BCP 190, RFC 7320, DOI 10.17487/RFC7320, July 2014. |
[RFC8174] | Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017. |
[W3C.yaml] | Ben Kiki, O, ., Evans, C, . and I. Net, "YAML Aint Markup Language", 2009. |
[RAML] | The RAML Workgroup, "RAML Specification", n.d.. |
[REST] | Fielding, R., "Architectural Styles and the Design of Network-based Software Architectures", Ph.D. Dissertation, University of California, Irvine, 2000. |
[RFC8288] | Nottingham, M., "Web Linking", RFC 8288, DOI 10.17487/RFC8288, October 2017. |
[untangled] | Fielding, R., "Untangled, musings of Roy T. Fielding", n.d.. |
[yahoo.rest] | "The REST Architectural Style List", n.d.. |