XML technologies / RSS & Atom / Atom / Structure of an Atom feed / Additional metadata

(Excerpt from "Newsfeeds with RSS and Atom" by Heinz Wittenbrink, published by Galileo Press, 2005)

Characterising a feed with atom:subtitle, atom:icon and atom:logo

Unlike RSS documents, where channel must contain an element of type description, an Atom document need not contain an element subtitle corresponding in function to description. The content of subtitle briefly characterises the feed. subtitle is allowed only as a direct child of feed, not inside entry. There, the element summary serves different purposes instead. In Atom documents, elements share a name only if they have the same meaning and the same kind of content. For subtitle, see the page atom:subtitle in the Atom element reference.

In addition, the elements logo (called image in Atom 0.8) and icon specify a logo or image and a small icon. These visually characterise a feed, for example by displaying an image in a newsreader. Both elements contain a URI. For images referenced by URIs in logo and icon, the specification requests a height-to-width ratio of 1:2, but does not require it. icon points to an image whose size and function match the favicon of an HTML page (but unlike a typical favicon, it is not square). For logo and icon, see the pages atom:logo and atom:icon in the Atom element reference.

 

The following fragment shows the start of the Atom example after adding the elements subtitle, icon and logo.

<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
   <title>Webtrends</title>
   <subtitle>Nachrichten über kommerzielle Websites und Online-Werbung</subtitle>
   <icon>http://www.celawi.com/webtrends/images/feed_icon.png </icon>
   <logo>http://www.celawi.com/webtrends/images/feed_icon.png </logo> 
   ...
</feed>

Code example: start of an Atom document with title, subtitle, icon and logo elements

atom:author and atom:contributor

The Atom specification requires an entry’s author to be identified. It uses the element author, which may be a child of feed and entry. feed and entry can have only one author. The author of an entry may be omitted only if the author specified for a feed is the author of all entries. For author, see also the page atom:author in the Atom element reference.

This element contains a person construct (see the page Atom constructs in the reference), characteristic of Atom. Person constructs consist of a name and, optionally, an email address, a URI and extension elements. The name is language-sensitive.

Although an entry or feed can have only one author, there is no limit on other contributors. They are listed in the element contributor, which also contains a person construct. For contributor, see the page atom:contributor in the Atom element reference.

 

Identification with atom:id

One of the elements required for every feed and entry is id. Correct use of this element guarantees unambiguous, unique identification of its resource. Its value is a URI (more precisely, an IRI) generated to guarantee uniqueness. Relative URIs are not allowed. Whether two URIs resolve to the same resource when dereferenced is irrelevant to their identity: only character-for-character equality counts. The specification’s examples include "http://www.example.org/thing" and "http://www.example.org/Thing", which are different identifiers even though they currently resolve to the same resource.

To avoid confusing URIs that dereference to the same resource but differ in characters, the specification lists rules, such as always using lowercase for the scheme and host. For id, see the page atom:id in the Atom element reference.

Rights information with atom:rights

The Atom element rights (called copyright in Atom 0.8) contains only human-readable copyright information. Machine-readable rights and licensing information must use extension elements! If an entry has no copyright statement of its own, the feed’s statement applies, if present. For rights, see also the page atom:rights in the Atom element reference.

Publication dates with atom:updated and atom:published

The element updated refers to the last date an entry changed in a way considered significant by its publisher. It therefore does not change with every modification or simply when the feed is regenerated. This element contains a date construct. For updated, see also the page atom:updated in the Atom element reference.

published, by contrast, roughly indicates when an entry was first published. The specification describes it rather floridly as a date associated with an early event in the entry’s life cycle. For published, see also the page atom:published in the Atom element reference.

Source metadata: atom:source

Atom goes far beyond other feed formats by allowing an entry to be copied from one feed to another while carrying the original feed’s metadata in a separate element source. In Atom, the element source contains more than the original feed’s name and URI, unlike RSS 2.0. It may contain all elements that were descendants of the element feed in the original feed, except elements named entry.

The specification recommends always copying the elements author, category, rights and contributor from the original to the destination feed, if present. Here too, Atom follows the principle of always retaining a minimum of metadata.

By allowing metadata to be copied between feeds, Atom enables aggregated feeds, which collect entries from multiple feeds into a new feed according to defined criteria. In the coming years, these aggregated feeds will probably become increasingly important for organising current information from heterogeneous sources. A topic-specific feed can, for example, be generated from different weblogs; a weblog such as Planet RDF could be produced as a synthesised feed. Feeds from "prospective search engines" such as PubSub will also use this capability. For source, see also the page atom:source in the Atom element reference.

Categorising content with atom:category

Atom is also more precise than RSS 2.0 when categorising content. category is an empty Atom element with three attributes: term, scheme and label. The attribute term is required and identifies the category assigned to an entry or feed. scheme defines the categorisation scheme. It is optional, as is the language-sensitive attribute label, which may hold a human-readable category label. The category identifier thus differs from the reader-facing label. This allows, for example, the English category system of the Open Directory Project (DMOZ) to be used while giving a category a German name. For category, see also the page atom:category in the Atom element reference.

Identifying generating software with atom:generator

The element generator serves the same purpose in Atom as in RSS. It identifies the software used to generate a feed so its producers can be informed of errors. The software’s URI and version are supplied. For generator, see also the page atom:generator in the Atom element reference.

   

 

 

 

Creative Commons license
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.

back to top