Atom Publishing Protocol (AtomPub)

Web-Based Publishing (INFO 290-19)

Erik Wilde, UC Berkeley School of Information
2008-02-28
Creative Commons License

This work is licensed under a CC
Attribution 3.0 Unported License

Abstract

Atom is a read-only format for publishing entries and entry metadata in a feed. The Atom Publishing Protocol (AtomPub) is built on top of Atom for providing a protocol for submitting new entries to feeds. AtomPub introduces the concept of a collection, which is the set of entries which are managed through AtomPub and can be published as an Atom feed. AtomPub clients can add new entries to a collection using HTTP interactions, and AtomPub supports entries which are based on some XML format, as well as any other type of entry (such as images).

Content Feeds

Outline (Atom Publishing Protocol)

  1. Atom Publishing Protocol [10]
  2. AtomPub Add-Ons [8]
    1. GData [2]
    2. LocAtomPub [3]
  3. Conclusions [1]

Syndication Format Protocols

RESTified Syndication

AtomPub Data Model

AtomPub Data Model

Workspaces, Collections, Resources

Creating Media Resources

POST /edit/ HTTP/1.1
Host: media.example.org
Content-Type: image/png
Slug: The Beach
Content-Length: nnn

...binary data...
HTTP/1.1 201 Created
Date: Fri, 7 Oct 2005 17:17:11 GMT
Content-Length: nnn
Content-Type: application/atom+xml;type=entry;charset="utf-8"
Location: http://example.org/media/edit/the_beach.atom

<?xml version="1.0"?>
<entry xmlns="http://www.w3.org/2005/Atom">
  <title>The Beach</title>
  <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
  <updated>2005-10-07T17:17:08Z</updated>
  <author><name>Daffy</name></author>
  <content type="image/png" src="http://media.example.org/the_beach.png"/>
  <link rel="edit-media" href="http://media.example.org/edit/the_beach.png" />
  <link rel="edit" href="http://example.org/media/edit/the_beach.atom" />
</entry>

Protocol Summary

Resource HTTP Method Representation Description
Introspection GET Atom Service Document Enumerates a set of collections and lists their URIs and other information about the collections
Collection GET Atom Feed A list of member of the collection (this may be a subset of all entries in the collection)
Collection POST Atom Entry Create a new entry in the collection
Member GET Atom Entry Get the Atom Entry
Member PUT Atom Entry Update the Atom Entry
Member DELETE n/a Delete the Atom Entry from the collection

Service Documents

Service Documents represent server-defined groups of Collections, and are used to initialize the process of creating and editing resources.

Service Document Example

<service xmlns="http://purl.org/atom/app#" xmlns:atom="http://www.w3.org/2005/Atom">
 <workspace>
  <atom:title>Main Site</atom:title>
  <collection href="http://example.org/reilly/main">
   <atom:title>My Blog Entries</atom:title>
   <categories href="http://example.com/cats/forMain.cats"/>
  </collection>
  <collection href="http://example.org/reilly/pic">
   <atom:title>Pictures</atom:title>
   <accept>image/*</accept>
  </collection>
 </workspace>
 <workspace>
  <atom:title>Side Bar Blog</atom:title>
  <collection href="http://example.org/reilly/list">
   <atom:title>Remaindered Links</atom:title>
   <accept>entry</accept>
   <categories fixed="yes">
    <atom:category scheme="http://example.org/extra-cats/" term="joke"/>
    <atom:category scheme="http://example.org/extra-cats/" term="serious"/>
   </categories>
  </collection>
 </workspace>
</service>

Category Documents

Category Document Example

<app:categories xmlns:app="http://purl.org/atom/app#" xmlns="http://www.w3.org/2005/Atom" fixed="yes" scheme="http://example.com/cats/big3">
 <category term="animal"/>
 <category term="vegetable"/>
 <category term="mineral"/>
</app:categories>

Outline (AtomPub Add-Ons)

  1. Atom Publishing Protocol [10]
  2. AtomPub Add-Ons [8]
    1. GData [2]
    2. LocAtomPub [3]
  3. Conclusions [1]

Extensibility

Atom Publishing Protocol Feature Discovery

Atom Syndication Format Tombstones

Outline (GData)

  1. Atom Publishing Protocol [10]
  2. AtomPub Add-Ons [8]
    1. GData [2]
    2. LocAtomPub [3]
  3. Conclusions [1]

GData & AtomPub

http://www.example.com/feeds/jo/-/Fritz
http://www.example.com/feeds/jo/-/Fritz/Laurie
http://www.example.com/feeds/jo/-/Fritz%7CLaurie
http://www.example.com/feeds/jo/-/Fritz/-Laurie

GData Contact entry

<entry xmlns:gd="http://schemas.google.com/g/2005">
 <category scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/g/2005#contact"/>
 <category term="user-tag" label="Colleague"/>
 <id>http://contacts.example.com/jo/Jo</id>
 <published>2005-01-18T21:00:00Z</published>
 <updated>2006-01-01T00:00:00Z</updated>
 <title>Jo March</title>
 <content/>
 <gd:im protocol="AIM" address="hcc@example.com"/>
 <gd:phoneNumber rel="http://schemas.google.com/g/2005#mobile">(206) 555-1212</gd:phoneNumber>
 <gd:phoneNumber rel="http://schemas.google.com/g/2005#car">(206) 555-1213</gd:phoneNumber>
 <gd:email rel="http://schemas.google.com/g/2005#work" address="jo@example.com"/>
 <gd:phoneNumber rel="http://schemas.google.com/g/2005#work">(650) 555-1212</gd:phoneNumber>
 <gd:phoneNumber rel="http://schemas.google.com/g/2005#pager">(650) 555-1214</gd:phoneNumber>
 <gd:postalAddress rel="http://schemas.google.com/g/2005#work">1600 Amphitheatre Pkwy, Mountain View, CA 94043
 </gd:postalAddress>
 <gd:geoPt lat="37.423269" lon="-122.082667"/>
 <gd:email address="estor@example.org" rel="http://schemas.google.com/g/2005#home"/>
 <gd:phoneNumber rel="http://schemas.google.com/g/2005#home">(206) 555-1212</gd:phoneNumber>
 <gd:postalAddress rel="http://schemas.google.com/g/2005#home">800 Main Street, Mountain View, CA 94041
 </gd:postalAddress>
</entry>

Outline (LocAtomPub)

  1. Atom Publishing Protocol [10]
  2. AtomPub Add-Ons [8]
    1. GData [2]
    2. LocAtomPub [3]
  3. Conclusions [1]

Location-Aware AtomPub

LocAtom Entry

 <entry xml:base="trees/2008/02/28/" xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
  <title>South Hall Dead Oak</title>
  <id>http://www.oaks.org/trees/2008/02/28/</id>
  <published>2008-02-28T08:00:00-07:00</published>
  <updated>2008-02-28T08:15:00-07:00</updated>
  <category scheme="http://www.oaks.org/categories" term="missingleaves"/>
  <category scheme="http://www.oaks.org/categories" term="blackbark"/>
  <category scheme="http://www.oaks.org/categories" term="nobranches"/>
  <location lat="37.87152" long="-122.257852"/>
  <location scheme="http://dret.net/myplaces" term="ucb-campus"/>
  <content type="xhtml">
   <div xmlns="http://www.w3.org/1999/xhtml">
    <p>...</p>
   </div>
  </content>
 </entry>

UCB PlaceML

<placeml xml:lang="en">
 <name>UC Berkeley Campuses</name>
 <place id="ucb-campus">
  <name>UCB Main Campus</name>
  <description>The main campus has all important buildings and starts right in downtown Berkeley. It can be easily reached by BART from San Francisco and other bay area locations.</description>
  <location>
   <convexPolygon>
    <point long="-122.266182" lat="37.874039"/>
    <point long="-122.265602" lat="37.869637"/>
    <point long="-122.266098" lat="37.868755"/>
    <point long="-122.265770" lat="37.867943"/>
    <point long="-122.252556" lat="37.869686"/>
    <point long="-122.252937" lat="37.871075"/>
    <point long="-122.252876" lat="37.871670"/>
    <point long="-122.253967" lat="37.872620"/>
    <point long="-122.255516" lat="37.873787"/>
    <point long="-122.256844" lat="37.875397"/>
    <point long="-122.266182" lat="37.874039"/>
   </convexPolygon>
  </location>
 </place>

Outline (Conclusions)

  1. Atom Publishing Protocol [10]
  2. AtomPub Add-Ons [8]
    1. GData [2]
    2. LocAtomPub [3]
  3. Conclusions [1]

Writeable Atom