Network Working Group | E. Hamnaberg |
Internet-Draft | January 17, 2014 |
Intended status: Informational | |
Expires: July 21, 2014 |
The 'publish' Link Relation Type
draft-hamnaberg-publish-link-relation-01
This memo defines a ‘publish’ link relation and provides a number of examples.
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 http://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 July 21, 2014.
Copyright (c) 2014 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 (http://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 specification outlines the publish link relation and what it means to publish something. The specification will register the relation according to [RFC5988].
No assumptions will be made about which media type the target IRI will accept, but some examples and guidelines will be given.
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in [RFC2119].
Please discuss this draft on the apps-discuss@ietf.org mailing list.
What does it mean to publish something? In effect it can be interpreted as making something available for general consumption.
A newspaper can publish an article, then it can be read by ‘everyone’.
A publisher can publish a book, so it can be read.
A video can be submitted to youtube so it can be watched.
The publish link relation allows a resource to be published using the target IRI.
Clients SHOULD use an appropriate write method of the target IRI protocol uniform interface.
Servers MAY ignore the request to publish something if the resource URI is already published.
Examples can be found in Appendix A
IANA is asked to register the link relation publish, as per [RFC5988]
Relation Name:
publish
Description:
Allows resources to be published using the target IRI.
Reference:
[ this document ]
TBD
Thanks to Jan Algermissen, Peter Rushforth and Darrel Miller for their valuable feedback and comments.
[RFC2119] | Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, March 1997. |
[RFC5988] | Nottingham, M., "Web Linking", RFC 5988, October 2010. |
[RFC2169] | Daniel, R., "A Trivial Convention for using HTTP in URN Resolution", RFC 2169, June 1997. |
[RFC5023] | Gregorio, J. and B. de hOra, "The Atom Publishing Protocol", RFC 5023, October 2007. |
Let’s say you have an atom feed like the one below
<?xml version="1.0" encoding="utf-8"?> <feed xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"> <title>Content feed</title> <updated>2005-07-31T12:29:29Z</updated> <id>tag:example.org,2003:3</id> <link rel="self" type="application/atom+xml" href="http://example.org/feed"/> <link rel="publish" href="http://example.org/publish"/> <entry> <title>Item 1</title> <link rel="edit" href="http://example.org/item/1"/> <id>urn:id:1</id> <app:control> <app:draft>yes</app:draft> <app:control> <updated>2012-05-04T12:00:29Z</updated> <author> <name>Erlend Hamnaberg</name> </author> <content type="text"> Some Content here. </content> </entry> <entry> <title>Item 2</title> <link rel="edit" href="http://example.org/item/2"/> <id>urn:id:1</id> <app:control> <app:draft>yes</app:draft> <app:control> <updated>2012-05-04T12:29:29Z</updated> <author> <name>Erlend Hamnaberg</name> </author> <content type="text"> Some Content here. </content> </entry> </feed>
Using Atompub ([RFC5023]), a Client would have to GET each entry using it’s edit relation and PUT each back with
<app:draft>no</app:draft>
being the only change in both entries.
This is highly inefficient. So let us find a better way.
To be able to publish many resources at once we need a representation which allows this.
Appendix A in [RFC2169] defines the text/uri-list media type.
Extra linefeeds are for display purposes only.
POST /publish Host: example.org Content-Type: text/uri-list http://example.org/item/1\r\n http://example.org/item/2\r\n
The problem with this approach is that is is a separate resource, and will not invalidate the caches of the feed. This problem is also apparent in the single item approach.
One might mediate this by making the feed resource also accept text/uri-list for publishing.
We could then change the request to this:
POST /feed Host: example.org Content-Type: text/uri-list http://example.org/item/1\r\n http://example.org/item/2\r\n