XML technologies / RSS & Atom / RSS 1.0 and RSS 1.1 / The core vocabulary of RSS 1.0

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

structure

RSS 1.0 also distinguishes structural and descriptive elements. This distinction is even better founded here than in RSS 2.0 and its predecessors because element semantics are clearly defined. Structural elements represent, in an RDF graph, either nodes (resources) or properties whose value is a node. Descriptive elements represent literal-valued properties, where a literal is a string. RSS 1.0’s core vocabulary has exactly three: title, link and description.

The document element rdf:RDF has as children one element channel and any number of elements, but at least one, of type item. Unlike RSS 2.0, RSS 1.0 also allows the elements image and textinput as direct children of the document element. channel, item, image and textinput must each carry an attribute of type rdf:about. Its value is the URI of the resource described by the element.

Less formally: channel, item, image and textinput represent objects existing independently of the RSS 1.0 document and therefore identifiable by URI.

On the web, the URI gives access to these objects independently of the RSS document describing them. They could also be offline objects, including physical ones. Each feed entry can, for example, be retrieved through the URI supplied as the value of rdf:about.

The children of the element channel are only the elements link, description and items. Other element content is permitted in different namespaces. Extensions marked as "external vocabulary" do not change the document’s architecture: information about channel and item embedded in a document element.

RSS 1.0 generally follows XML 1.0 and XML namespace rules. The default encoding is UTF-8. Quoted markup must be escaped using entity references.

Element order in an RSS 1.0 document does not matter.

The RSS 1.0 element channel has an attribute rdf:about whose value is a URI. This may identify the RSS document itself or the described homepage; RSS 1.0 is as ambiguous here as other versions. The attribute rdf:about identifies an RDF statement’s subject.

  • rdf:about
    The value of the attribute rdf:about defines the containing element’s URI and identifies the subject of statements derived from its RDF contents. Child elements are interpreted as descriptions of that element. Every described resource must have this attribute.

  • rdf:resource
    This attribute specifies resources used as property values in RDF documents. It is used whenever a resource supplies a property’s value.

The rdf:RDF element

A valid RSS 1.0 document has the document element RDF. The URI "http://www.w3.org/1999/02/22-rdf-syntax-ns#" binds this name to the namespace of the Resource Description Framework. The RSS element namespace is defined by the URI "http://purl.org/rss/1.0/".

RSS 1.0 documents therefore usually begin like the example:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/">

XML namespaces rules allow a different prefix instead of rdf. RDF nevertheless recommends treating this prefix as normative, so rdf may be interpreted as part of a local identifier. This makes RDF 1.0 compatible with RSS 0.9 and lets programs without namespace support process the document. Such programs see the element name rdf:RDF as an ordinary identifier containing a permitted colon.

The example’s first element also declares the prefix dc. It is bound to a third namespace, defined for the so-called Dublin Core elements:

<rdf:RDF xmlns="http://purl.org/rss/1.0/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">

With namespaces declared as in the example, all unprefixed names—without letters separated from the rest of the name by a colon—denote RSS 1.0 elements. All elements prefixed with rdf: are RDF elements. Individual attributes may also carry the prefix rdf to assign them to RDF, necessary when their containing element is in another namespace. The document element thus indicates that its content uses three XML vocabularies.

The children of rdf:RDF, namely channel, items, image and textinput must not have repeated immediate children; repetition is allowed only deeper down. This restriction only supports constructing RSS triples with technologies available when the standard was adopted.

For rdf:RDF, see also the page rdf:RDF in the RSS 1.0 element reference.

The rss:channel element

The element channel, unlike RSS 2.0, does not contain all document data. It describes the feed’s properties as a whole.

The only required attribute is rdf:about. All top-level elements, children of rdf:RDF, must have it. The value of rdf:about on channel is the URI of the channel.

The URI supplied as the value of rdf:about here ("http://www.celawi.eu/webtrends/"; see the example under Basic structure of an RSS 1.0 document) is the starting point for determining the semantics of the rest of the document. It identifies the first node in the graph built by an RSS parser.

In RDF syntax, channel is a typed node or typed node. The node therefore has a property type whose value is channel. In other words, the resource identified by the URI in rdf:about has an edge for the property type ending at channel.

channel must contain the elements title, rss:link, description and items. Further namespace-qualified children from RSS 1.0 modules are allowed.

The element names title, link and description denote properties of the resource identified by the URI in rdf:about. The elements title, link and description are property elements or property elements. RDF/XML syntax rules state that elements inside one describing a subject node are property elements.

The elements description and link are also literal-valued property elements. The element items is different: it is a property element, but its value describes a resource rather than a literal.

For channel, see also the page rss:channel in the RSS 1.0 element reference.

The rss:items element

RSS 1.0 requires a channel-level table of contents linking the channel to its items and, optionally, an image and text input field. The document thus explicitly identifies the parts belonging to a channel.

The element items contains the table of contents. As we have seen, RSS terminology calls it a property element. items links the element channel to the entries forming the content of the channel.

For items, see also the page rss:items in the RSS 1.0 element reference.

The rdf:Seq element

The content of items is a resource of type rdf:Seq, not identified by URI but forming a blank node. Each entry is the value of a sequence property, such as "first element", "second element", and so on. In the RDF graph these properties are named rdf:_1, rdf:_2 and so on. Their order matters; rearranging them loses information.

For rdf:Seq, see also the page rdf:Seq in the RSS 1.0 element reference.

The rdf:li element

Elements of type rdf:li have an attribute rdf:resource whose value equals that of the attribute rdf:about on one of the item elements in the document. Using rdf:resource allows statements about that resource elsewhere. They appear inside an element item identified by the value of the attribute rdf:about as a resource associated with the channel.

For rdf:li, see also the page rdf:li in the RSS 1.0 element reference.

The rss:image element

The element image corresponds in function to the element image in RSS 2.0. No size is required, but the specification recommends a format supported by most applications. Its children are title, link and url. url specifies the image’s URI. title supplies the value of the attribute alt when RSS is converted to HTML.

An image used in RSS 1.0 must also be listed inside channel. There it is an empty element with an attribute rdf:resource. Its value is the image’s URI, the URI given on the element image outside channel as the value of rdf:about.

The element image therefore occurs twice with different functions. To clarify RDF/XML syntax, here are the meanings explicitly: as a descendant of channel it is a property element whose value is the resource identified by the URI in rdf:resource. As a child of rdf:RDF it identifies the same resource as being of type image; here it also contains the image’s other properties.

For image, see also the page rss:image in the RSS 1.0 element reference.

The rss:textinput element

The element textinput is mentioned only for completeness. It is no longer used and is already absent from RSS 1.1.

An element textinput contains the descriptive elements title, link and description. The element name names the input field, as in HTML, and is passed to a CGI script processing the input. Like image, textinput would also have to be listed inside channel if actually used.

The rss:item element

Every item represents a separate resource and therefore has its own URI. item elements are typed nodes, interpreted by a parser as demonstrated for the type channel. In the RDF graph, the parser attaches statements about an item element to the endpoint of the properties rdf_1, rdf_2 and so on, constructed from the value of the attribute rdf:resource. The URIs of the individual item elements must therefore equal the URIs given inside elements of type rdf:li.

The specification explicitly says an item can be "just about anything": "With RSS 1.0's modular extensibility, this can be just about anything: discussion posting, job listing, software patch – any object with a URI." (see RSS 1.0 modules; for item, see also the page rss:item in the RSS 1.0 element reference).

Descriptive elements

RSS 1.0’s descriptive core elements have the same local names as their RSS 2.0 counterparts: title, link and description. These are three property elements —named properties or predicates in an RDF graph. Their values are literals, strings describing the associated resource. All subject nodes with their own URI, of types channel, item, image and textinput have the properties title and link; chanel, item and textinput also have the property description. image also has the property url.

The rss:link element

The element link is a descendant of channel and item, image and textinput. It contains a URI used as the link target when RSS is transformed into HTML. The link’s starting point is usually the content of title. For an image, the file at the URL is used instead.

The content of link need not equal the URI supplied as the value of the attribute rdf:about on the element channel or item. For item, the specification recommends using the same URI, as is usually done in practice.

For RSS 0.9 compatibility, the specification limits the content of link to 500 characters.

For link, see also the page rss:link in the RSS 1.0 element reference.

The rss:title element

The element title serves the same purpose in RSS 1.0 as in RSS 2.0: the title of a feed, item, image or text input field. Inherited from older versions, RSS 1.0 recommends a 40-character limit for the title of a channel and 100 characters for the title of an item. Markup is strictly prohibited inside this element!

A parser understanding the RDF schema at the namespace URI can recognise title as a specialisation of the element title from Dublin Core metadata. In its graph, the parser can replace the property element title with dc:title.

For title, see also the page rss:title in the RSS 1.0 element reference.

The rss:description element

description contains the description of the channel or item. The value of description is also a literal, a string. It must have no descendants and therefore no HTML markup. (To insert HTML into RSS 1.0, use the content module.) A maximum of 500 characters is recommended. description, like title, is defined as a subset or "subproperty" of description.

For description, see also the page rss:description in the RSS 1.0 element reference.

   

 

 

 

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

back to top