Atom+RDFa 1.1

A formulation for embedding RDFa 1.1 in Atom 1.0 feeds.

Unofficial Draft 03 February 2011

Editor:
Toby Inkster, Invited Expert

Abstract

This is the abstract for your specification.

Status of This Document

This document is merely a public working draft of a potential specification. It has no official standing of any kind and does not represent the support or consensus of any standards organisation.

Table of Contents

1. Introduction

This section is non-normative.

@@TODO - gist is that we want to retain compatibility with Yahoo's DataRSS [DATARSS]; also be compatible with Atom 1.0 syntax and semantics.

<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
  xmlns:rdfa="http://www.w3.org/ns/rdfa#"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:foaf="http://xmlns.com/foaf/0.1/">

  <title>Example Feed</title>
  <link rel="self" href="http://example.org/"/>
  <updated>2003-12-13T18:30:02Z</updated>
  <author>
    <name>John Doe</name>
  </author>
  <id>urn:uuid:60a76c80-d399-11d9-b93C-0003939e0af6</id>

  <entry>
    <title>Atom-Powered Robots Run Amok</title>
    <link rel="self" href="http://example.org/2003/12/13/atom03"/>
    <id>urn:uuid:1225c695-cfb8-4ebb-aaaa-80da344efa6a</id>
    <updated>2003-12-13T18:30:02Z</updated>
    <summary>Some text.</summary>
    <rdfa:meta property="dc:dateCopyrighted" content="2003-12-11" datatype="xsd:date" />
    <rdfa:meta rel="dc:rightsHolder">
      <rdfa:meta typeof="foaf:Person" property="foaf:name" content="John Doe" />
    </rdfa:meta>
  </entry>

</feed>

This is equivalent to the following RDF data, shown in Turtle [TURTLE]:

@prefix dc:   <http://purl.org/dc/terms/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix rel:  <http://www.iana.org/assignments/relation/> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .

_:feed rel:self <http://example.org/> .

_:entry rel:self <http://example.org/2003/12/13/atom03> ;
    dc:dateCopyrighted "2003-12-11"^^xsd:date ;
    dc:rightsHolder _:r .

_:r a foaf:Person ;
    foaf:name "John Doe" .

2. Conformance Requirements

2.1 Conformance

As well as sections marked as non-normative, all authoring guidelines, diagrams, examples, and notes in this specification are non-normative. Everything else in this specification is normative.

The key words must, must not, required, should, should not, recommended, may, and optional in this specification are to be interpreted as described in [RFC2119].

2.2 Document Conformance

Atom 1.0 [RFC4287] offers a number of places for extensions to slot in without disrupting existing Atom parsing tools. However, this specification only allows RDFa attributes in a conservative set of places:

  1. On extension elements (non-Atom namespace) which are the direct children of <feed> or <entry>, or the descendants of any such extension elements; and
  2. On elements that are descendants of Atom <content> elements which do not have a type attribute with value text or html.

For the first case, this specification defines a namespaced element <rdfa:meta> allows any RDFa attribute to be used, as well as xml:base and xml:lang. <rdfa:meta> is allowed as a child element of <feed> or <entry> or of <rdfa:meta> itself. (That is, they may be nested to an aribtrary depth.) This element is defined for convenience — RDFa is not limited to being used on this element only, and may also be used on other elements.

Additionally, the Atom <link> element has rel and href attributes which can be interpreted as RDFa. Publishers must not use RDFa features on <link> elements which are not compatible with Atom 1.0's definition of the element — in particular, rel must be a term from the default profile, or otherwise a full, absolute URI.

2.3 User Agent Conformance

@@TODO - gist should be that RDFa should be processed wherever it's found, even if it would be non-conforming according to section above.

3. Additional RDFa Processing Rules

Documents conforming to the rules in this specification are processed according to RDFa Core 1.1 [RDFA-CORE] with the following extensions:

@@TODO - maybe mention the <?profile ?> processing instruction from DataRSS?

4. Default Profile

RDFa Working Group has decided to have a single default profile for all host languages. That means that Atom+RDFa needs to adopt that profile. But is it also allowed to specify its own default profile that will be used in addition to the RDFa Core default profile? Atom+RDFa needs to be able to do so for compatibility with native Atom semantics.

The default profile is obtained by processing the XML version [REL-REG] of the IETF Link Registry [RFC5988] with the following XSL Transformation:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
  xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:reg="http://www.iana.org/assignments"
  xmlns:dc="http://purl.org/dc/terms/"
  xmlns:rel="http://www.iana.org/assignments/relation/"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
  xmlns:rdfa="http://www.w3.org/ns/rdfa#">
  
  <xsl:output method="xml" indent="yes"/> 
 
  <xsl:template match="//reg:registry[@id]">
    <reg:registry id="{@id}" about="#{@id}">
      <xsl:apply-templates select="reg:title"/>
      <xsl:apply-templates select="reg:updated"/>
      <xsl:apply-templates select="reg:registry"/>
      <xsl:apply-templates select="reg:record"/>
    </reg:registry>
  </xsl:template> 

  <xsl:template match="reg:title">
    <reg:title property="dc:title" xml:lang="en">
      <xsl:value-of select="."/>
    </reg:title>
  </xsl:template>

  <xsl:template match="reg:updated">
    <reg:updated property="dc:modified" datatype="xsd:date">
      <xsl:value-of select="."/>
    </reg:updated>
  </xsl:template>
  
  <xsl:template match="reg:record">
    <reg:record typeof="rdfa:TermMapping"
      property="rdfa:uri"
      content="http://www.iana.org/assignments/relation/{reg:value}">
      <xsl:apply-templates select="reg:value"/>
      <xsl:apply-templates select="reg:description"/>
      <xsl:apply-templates select="reg:xref[@type='uri']"/>
    </reg:record>
  </xsl:template>

  <xsl:template match="reg:value">
    <reg:value property="rdfa:term">
      <xsl:value-of select="."/>
    </reg:value>
  </xsl:template>

  <xsl:template match="reg:description">
    <reg:description
      about="[rel:{ancestor::reg:record/reg:value}]"
      property="rdfs:comment"
      xml:lang="en">
      <xsl:value-of select="."/>
    </reg:description>
  </xsl:template>

  <xsl:template match="reg:xref[@type='uri']">
    <reg:xref
      about="[rel:{ancestor::reg:record/reg:value}]"
      rel="rdfs:seeAlso"
      resource="{./@data}">
      <xsl:value-of select="."/>
    </reg:xref>
  </xsl:template>

</xsl:stylesheet>

Implementations are not required to implement XSLT. Other techniques that result in an equivalent profile are allowed.

5. Native Atom Semantics

This section is non-normative.

@@TODO - gist is that Atom's native semantics can be uplifted to an RDF graph via AtomOWL [AWOL]; describe how to merge this graph with the default RDFa graph.

6. Relax NG Compact Schema

@@TODO - provide a schema for Atom+RDFa

A. Acknowledgements

Many thanks to Robin Berjon for making our lives so much easier with his cool tool.

B. References

B.1 Normative references

[RDFA-CORE]
Shane McCarron; et al. RDFa Core 1.1: Syntax and processing rules for embedding RDF through attributes.26 October 2010. W3C Working Draft. URL: http://www.w3.org/TR/2010/WD-rdfa-core-20101026
[REL-REG]
Internet Assigned Numbers Authority. Link Relation Types. Registry under expert review. URL: http://www.iana.org/assignments/link-relations/link-relations.xml#link-relations-1
[RFC2119]
S. Bradner. Key words for use in RFCs to Indicate Requirement Levels. March 1997. Internet RFC 2119. URL: http://www.ietf.org/rfc/rfc2119.txt
[RFC4287]
M. Nottingham, R. Sayre. The Atom Syndication Format December 2005. Internet RFC 4287. URL: http://www.ietf.org/rfc/rfc4287.txt
[XML10-4e]
C. M. Sperberg-McQueen; et al. Extensible Markup Language (XML) 1.0 (Fourth Edition). 16 August 2006. W3C Recommendation. URL: http://www.w3.org/TR/2006/REC-xml-20060816/
[XMLBASE]
Jonathan Marsh, Richard Tobin. XML Base (Second Edition). 28 January 2009. W3C Recommendation. URL: http://www.w3.org/TR/2009/REC-xmlbase-20090128/

B.2 Informative references

[AWOL]
@@TODO AtomOWL reference
[DATARSS]
@@TODO DataRSS reference
[RFC5988]
M. Nottingham. Web Linking October 2010. Internet RFC 5988. URL: http://www.ietf.org/rfc/rfc5988.txt
[TURTLE]
David Beckett, Tim Berners-Lee. Turtle: Terse RDF Triple Language January 2008. W3C Team Submission. URL: http://www.w3.org/TeamSubmission/turtle/