Atom Syndication Format

XML Foundations [./]
Fall 2013 — INFO 242 (CCN 41613)

Erik Wilde, UC Berkeley School of Information
2013-11-18

Creative Commons License [http://creativecommons.org/licenses/by/3.0/]

This work is licensed under a CC
Attribution 3.0 Unported License
[http://creativecommons.org/licenses/by/3.0/]

Contents E. Wilde: Atom Syndication Format

Contents

E. Wilde: Atom Syndication Format

(2) Abstract

REST's level of abstraction and its simplicity as a small set of constraints can make it hard to get a grasp on how it can be applied for real-world projects. This presentations introduces real-world REST by looking at how REST can be used by reusing existing RESTful designs in terms of representations and interaction protocols; Atom and the Atom Publishing Protocol (AtomPub) are used as examples for existing RESTful designs. In addition, we take a brief look at how to go beyond using these canned REST approaches, and how existing programming framework provide support for designing and implementing RESTful services.



E. Wilde: Atom Syndication Format

(3) Precious Snowflakes

snowflakes.jpg

E. Wilde: Atom Syndication Format

(4) Feeds!

feedbot.jpg

E. Wilde: Atom Syndication Format

(5) Syndication



Atom

Outline (Atom)

  1. Atom [6]
  2. Atom Publishing Protocol (AtomPub) [9]
  3. Extending Atom/AtomPub [3]
  4. Conclusions [1]
Atom E. Wilde: Atom Syndication Format

(7) Atom History

atom-logo.png

Atom E. Wilde: Atom Syndication Format

(8) Atom vs. RSS



Atom E. Wilde: Atom Syndication Format

(9) Atom Example

<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-us">
 <title>ongoing</title>
 <id>http://www.tbray.org/ongoing/</id>
 <link rel='self' href="http://www.tbray.org/ongoing/ongoing.atom"/>
 <updated>2007-04-11T12:55:09-07:00</updated>
 <author>
  <name>Tim Bray</name>
 </author>
 <subtitle>ongoing fragmented essay by Tim Bray</subtitle>
 <entry xml:base="When/200x/2007/04/02/">
  <title>Atom Publishing Protocol Interop!</title>
  <id>http://www.tbray.org/ongoing/When/200x/2007/04/02/APP-Interop</id>
  <published>2007-04-02T13:00:00-07:00</published>
  <updated>2007-04-10T14:24:00-07:00</updated>
  <category scheme="http://www.tbray.org/ongoing/What/" term="Technology/Atom"/>
  <category scheme="http://www.tbray.org/ongoing/What/" term="Technology"/>
  <category scheme="http://www.tbray.org/ongoing/What/" term="Atom"/>
  <content type="xhtml">
   <div xmlns="http://www.w3.org/1999/xhtml">
    <p>Mark your calendar: <a href="http://www.intertwingly.net/wiki/pie/April2007Interop">April 16-17 at Google</a>. <em>Everybody</em> is invited, provided they bring along an APP implementation, client or server. This was just announced a couple of days ago, and as I write this there are already <s>six</s> twelve client and <s>seven</s> fourteen server implementations signed up to be there and try to <a href="http://www.intertwingly.net/wiki/pie/InteropGrid">fill in the grid</a>. Let’s drop some names, in alphabetical order: AOL, Flock, Google, IBM, Lotus, Microsoft, Oracle, O’Reilly, Six Apart, Sun, WordPress. Um, have I mentioned that the APP is going to be huge?</p>
   </div>
  </content>
 </entry>
</feed>


Atom E. Wilde: Atom Syndication Format

(10) Atom Content



Atom E. Wilde: Atom Syndication Format

(11) Atom Content Examples

<content type="xhtml">
  <div xmlns="http://www.w3.org/1999/xhtml">
    One <strong>bold</strong> foot forward
  </div>
</content>
[http://www.xml.com/lpt/a/1633]
<content>The "atom:content" element either contains or links to the content of the entry. The content of atom:content is Language-Sensitive.</content>
[http://www.xml.com/lpt/a/1633]
<content type="html">The &lt;code>atom:content&lt;/code> element either contains or links to the content of the entry. The content of &lt;code>atom:content&lt;/code> is &lt;a href="http://www.ietf.org/rfc/rfc3066.txt">Language-Sensitive&lt;/a>.</content>
[http://www.xml.com/lpt/a/1633]
<content type="image/png">
iVBORw0KGgoA … TAAAAAElFTkSuQmCC
</content>
[http://www.xml.com/lpt/a/1633]
<content src="image.png" type="image/png"/>
[http://www.xml.com/lpt/a/1633]

Atom E. Wilde: Atom Syndication Format

(12) Atom Categories



Atom Publishing Protocol (AtomPub)

Outline (Atom Publishing Protocol (AtomPub))

  1. Atom [6]
  2. Atom Publishing Protocol (AtomPub) [9]
  3. Extending Atom/AtomPub [3]
  4. Conclusions [1]
Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(14) RESTful Syndication



Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(15) Collections, Members, Entries, Media



Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(16) Atom/AtomPub Data Model

Atom/AtomPub Data Model

Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(17) Protocol Summary

Resource HTTP Method Representation Description
Introspection GET Atom Service Document [Service Documents (1)] 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


Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(18) Collection Management



Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(19) Service Documents

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


Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(20) 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>


Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(21) Category Documents



Atom Publishing Protocol (AtomPub) E. Wilde: Atom Syndication Format

(22) 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>


Extending Atom/AtomPub

Outline (Extending Atom/AtomPub)

  1. Atom [6]
  2. Atom Publishing Protocol (AtomPub) [9]
  3. Extending Atom/AtomPub [3]
  4. Conclusions [1]
Extending Atom/AtomPub E. Wilde: Atom Syndication Format

(24) Atom/AtomPub as Foundation



Extending Atom/AtomPub E. Wilde: Atom Syndication Format

(25) RESTful Web Service Design



Extending Atom/AtomPub E. Wilde: Atom Syndication Format

(26) RESTful Web Service Design Procedure

  1. Figure out the data set
  2. Split the data set into resources
  3. Name the resources with URIs [Representational State Transfer (REST); Resource Identification (1)]
  4. Expose a subset of the uniform interface [Representational State Transfer (REST); Uniform Interface (1)]
  5. Design the representation(s) [Representational State Transfer (REST); Self-Describing Messages (1)] accepted from the client
  6. Design the representation(s) [Representational State Transfer (REST); Self-Describing Messages (1)] served to the client
  7. Design hypermedia integration [Representational State Transfer (REST); Hypermedia Driving Application State (1)] with other resources
  8. Figure out the normal control flow [Representational State Transfer (REST); Stateless Interactions (1)]
  9. Figure out error conditions


Conclusions

Outline (Conclusions)

  1. Atom [6]
  2. Atom Publishing Protocol (AtomPub) [9]
  3. Extending Atom/AtomPub [3]
  4. Conclusions [1]
Conclusions E. Wilde: Atom Syndication Format

(28) Simple Syndication



2013-11-18 XML Foundations [./]
Fall 2013 — INFO 242 (CCN 41613)