cs 891 2rev b

31
Atom: The Atom Syndication Format RFC 4287 - M. Nottingham and R. Sayre (editors) and hAtom 0.1 David Janes, Benjamin Carlyle, and Tantek Celik Presented by: Chuck Cartledge and Carlton Northern

Upload: carlton-northern

Post on 05-Dec-2014

1.965 views

Category:

Technology


3 download

DESCRIPTION

Presents the Atom 1.0 and hAtom 0.1 specifications for the ODU CS891 Web Syndication Formats course.

TRANSCRIPT

Page 1: Cs 891 2rev B

Atom: The Atom Syndication Format

RFC 4287 - M. Nottingham and R. Sayre (editors)and

hAtom 0.1David Janes, Benjamin Carlyle, and Tantek Celik

Presented by:

Chuck Cartledge and

Carlton Northern

Page 2: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 2

Trying to set the tone.“In the Developer’s Bars of the world – those

dark, sordid places filled with grizzled coders and their clans – a special corner is always reserved for the developers of content-syndication standards. There, weeping in their beer, you’ll find veterans of a long and difficult process. Most likely, they will have the Thousand Yard Stare of those who have seen more than they should. The standards you read about in the this book were not born fresh and innocent, of a streamlined process overseen by the Wise and Good. Rather the following chapters have been dragged into the world and tempered through brawls, knife fights, and the occasional riot.”

Ben Hammersley, “Developing Feeds with RSS and Atom,” O’Reilly Media, Inc., 2005, ISBN 0-596-0081-3

Page 3: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 3

What we will cover and how

• What are RFCs and why should we care

• Where Atom fits in the Grand Scheme of things

• How Atom compares with RSS• How Atom compares with RSS 2.0• Atom, the RFC• Atom, the Simplest Feed• Demonstration of Atom Feeds• Atom compared to hAtom?• Our conclusions• Questions for you

Page 4: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 4

What is an RFC and why should we care?

• Request for Comments (RFCs) are the glue that allows the I’net to work

• Draft RFCs (Internet Drafts) are submitted to the Internet Engineering Task Force (IETF) for review and comments

• IDs are assigned a sequential number and released for comment

• RFCs are the standards that anyone wanting to “play” on the I’net have to adhere to

• RFCs that we have addressed in class – 4287, 5005, 4685, 4946, 5023,

• RFCs that it would be nice to address in class – 1149 and 2549

• The I’net works because people do things IAW the RFCs. It is the “law.”

www.ipv6style.jp/jp/20061220/ietf1.html

Page 5: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 5

How does Atom fit into the Grand Scheme of

Things?

“… in 2003, it became painfully clear that the RSS world was not going to declare a truce and agree to sort things out … a large group of developers split off to design a new format from the ground up. After much tooing, foring, cogitating, and argument, not the least over the name of the thing, a format has arisen: the Atom Syndication Format.”

Ben Hammersley, “Developing Feeds with RSS and Atom,” O’Reilly Media, Inc., 2005, ISBN 0-596-0081-3

http://en.wikipedia.org/wiki/Syndication_format_family_tree

Page 6: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 6

How does Atom compare with RSS?“So, there are now two basic formats for

syndicating a web site. RSS is older with many different versions, Atom is newer, more standard, and only beginning to be adopted. Atom was constructed to work across a wide variety of platforms and devices.”

http://www.commoncraft.com/archives/000592.html

• Atom is documented in RFCs

– 4287 The Atom Syndication Format, Dec. 2005

– 4685 Atom Threading Extensions, Sept 2006

– 5023 The Atom Publishing Protocol , Oct. 2007

• RSS has various flavors and mutually incompatible implementations

Page 7: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 7

How does Atom compare to RSS 2.0?

• RSS– Content model – plain text or escaped HTML, no way to distinguish– Date formats – based on RFC 822– Internationalization – can identify feed, but not items– Modularity/reuse – not part of the design

• Atom– Content model – explicitly and unambiguously labels the type of content being

provided by the entry– Date formats – based on RFC 3339 (a subset of ISO 8601)– Internationalization – uses xml:lang to make it possible to specify a language for every

piece of human readable content– Modularity/reuse – specifically designed to allow elements to be reused

• Atom gives a good deal of info about the resource and the content, but leaves the meaning of the content to RSS

• http://en.wikipedia.org/wiki/Atom_(standard)

Page 8: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 8

Atom: The RFC• Two kinds of Atom Documents

– Feeds – represents an Atom Feed• Metadata about the feed• Some or all entries associated with the feed

– Entries• Exactly one entry• Outside of an Atom feed

• Atom documents MUST be well-formed XML

• Atom is extensible

Page 9: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 9

Atom: The RFC – Verbose or Concise

• RFC Specification in two different formats– Verbose (words, words, lots of words)

– Concise Relax NG schema

• Verbose:3.1.1. The "type" Attribute Text constructs MAY have a "type"

attribute. When present, the value MUST be one of "text", "html", or "xhtml". If the "type" attribute is not provided, Atom Processors MUST behave as though it were present with a value of "text". Unlike the atom:content element defined in Section 4.1.3, MIME media types [MIMEREG] MUST NOT be used as values for the "type" attribute on Text constructs.

• ConciseatomPlainTextConstruct = atomCommonAttributes,

attribute type { "text" | "html" }?,

text atomXHTMLTextConstruct = atomCommonAttributes,

attribute type { "xhtml" },

xhtmlDiv

• Verbose has implementation guidance as well as semantic information

Page 10: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 10

Atom: The RFC – Relaxed NG

Symbols• A schema language for XML• On track to become ISO Standard

19757-2• A language agnostic schema that can be

processed language specific parsers• For our purposes limited XML-tag

following operators are of interest:* => 1 or more occurrences? => less than or equal to 1 occurrencenull => exactly one occurrence• http://www.relaxng.org/

• http://books.xmlschemata.org/relaxng/

Page 11: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 11

Atom: The RFC – Example of Relaxed NG

Common Attributes

atomCommonAttributes =

attribute xml:base { atomUri }?,

attribute xml:lang { atomLanguageTag }?, undefinedAttribute*

Page 12: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 12

Atom: The RFC Partial Relaxed NG atom:feed

• start = atomFeed | atomEntry• atomPersonConsruct =

– (element atom:name {text}– & element atom:uri { atomUri }?– …

• atomFeed = [ … various rules …]– Element atomFeed { …– atomAuthor*– …}

• atomAuthor = element atom:author { atomPersonConstruct }

Page 13: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 13

Atom: The Simplest Feed

<?xml version="1.0" encoding="utf-8"?><feed version="draft-ietf-atompub-format-03: do not deploy" xmlns="http://purl.org/atom/ns#draft-ietf-atompub-format-03">

<head><title>The Simplest Feed</title><link rel="alternate" type="text/html" href="http://example.org/index.html"/><author><name>Ben Hammersley</name></author><updated>2004-10-25T15:07:02Z</updated></head>

<entry><title>The Simplest Entry Document</title><link rel="alternate" type="text/html" href="http://example.org/example_entry"/><author><name>Ben Hammersley</name></author><id>http://example.org/2004/12345679</id><updated>2004-10-25T15:07:02Z</updated><content type="TEXT">Simple Simple Simple</content></entry>

</feed>Ben Hammersley, “Developing Feeds

with RSS and Atom,” O’Reilly Media, Inc., 2005, ISBN 0-596-0081-3

Page 14: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 14

An example of an Atom client application

• Perl code from O’Reily’s book

Page 15: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 15

An example of an Atom consolidator

• Expand Perl code to pull data periodically and put into a standard file

Page 16: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 16

An example of a web client

• Basic HTML that does a periodically does a refresh of the file from the previous slide.

Page 17: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 17

Google Reader Demo

• http://carrotrevolution.blogspot.com/

Page 18: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 18

What is hAtom?

• A microformat conceptually based on the Atom Syndication Format.

• Identifies semantic information in weblog posts, news feeds or similarly formatted content.

• hAtom is not intended to replace RSS or Atom.

Page 19: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 19

Why hAtom?

• Provides a simple way to markup blog posts in the actual (X)HTML, eliminating the need of creating a separate file for RSS or Atom.

• Use cases:– Make your web page your feed.– Provide a more semantic meaning to a blog without

adding the overhead of implementing everything needed for an Atom or RSS feed.

– For articles that were created before structuring syndication formats such as RSS and Atom, convert them to hAtom to give them structure and semantic meaning.

Page 20: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 20

What is a Microformat?

• A simple, open data format used to structure and represent very specific types of content on the web.

• Microformats: real world semantics, AKA lowercase semantic web.¹

• Example: hCard is a microformat for representing people, companies, organizations, and places, using vCard.

• Demo: http://microformats.org/code/hcard/creator

¹ http://www.tantek.com/presentations/2004etech/realworldsemanticspres.html

Page 21: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 21

List of Microformats

• hCalendar – for marking up calendar events.• hCard – for marking up people, companies, organizations, and places.• hAtom – for marking up primarily blog posts.• hResume – for marking up resumes.• hReview – for marking up reviews.• xFolk – for marking up bookmarks.• VoteLinks – for marking up polls/votes.• XFN – for marking up relationships between people.• XMDP – for marking up metadata profiles.• adr – for marking up addresses.• geo – for marking up geographical coordinates.

• There are more that are not listed here, and many more to come!

Page 22: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 22

Microformats Demo

• Using Firefox and the extension “Operator” we can see some pretty interesting stuff.

• http://www.w3.org/People/Connolly/events/

Page 23: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 23

How to Use hAtom?

• Use the hAtom2Atom XSLT to convert hAtom to Atom.

• Demo: http://lukearno.com/projects/hatom2atom/ using this input http://placenamehere.com/

Page 24: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 24

Semantic XHTML Design Principles

• hAtom and other microformats conform to semantic XHTML design principles.

• Semantic XHTML, as opposed to presentational XHTML, deals with the identification of relationships and information.

• Rules:1. Reuse, Reuse, Reuse!!!2. Be precise.3. Use similar or same naming conventions as the original

schema.

Page 25: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 25

hAtom Schema Elements

• hfeed - optional. • feed category – optional, keywords or phrases, using rel

-tag. • hentry - required

– entry-title – required, text. – entry-content – optional, text.– entry-summary - optional, text. – updated - required using datetime-design-pattern. – published - optional using datetime-design-pattern. – author - required using hCard.– bookmark (permalink) - optional, using rel-bookmark. – tags - optional, keywords or phrases, using rel-tag.

Page 26: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 26

hAtom Example

• Canned example: http://microformats.org/wiki/hatom-examples

• Example in the wild: http://placenamehere.com/

Page 27: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 27

What is the relationship between Atom and hAtom?

• hAtom is derived from Atom.• Atom can be used to syndicate any kind of content that is

frequently updated.• hAtom can technically be used to markup any content that

can be syndicated by Atom, but is generally used for blog posts.

• Atom can be constructed from hAtom. This is how documents that use hAtom are usually syndicated.

• hAtom uses very similar, or exactly the same attributes as Atom.

Page 28: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 28

hAtom and Atom Schema Comparison

Page 29: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 29

Conclusion• Recap Atom versus RSS

– Multiple non-standard formats– Syntax and recommended processing

in the public domain– Designed based on lessons learned

from RSS• Atom

– Pure XML– Moderate, but limited defined tag set– Describes feeds and entries– Extensibility built in

• Differences between Atom and hAtom

Page 30: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 30

Our Questions for You

• What is the purpose of an RFC? And, how do we know that an RFC has done its job?

• When is hAtom a better choice than Atom?

• What kinds of problems are unique to providing feeds to handheld devices?

Page 31: Cs 891 2rev B

CS-791/891 Web Syndication Formats, ODU, Sping 2008 31

Sources

• http://microformatique.com/?page_id=138

• http://www.tantek.com/presentations/2004etech/realworldsemanticspres.html