RDFa
From Wikipedia, the free encyclopedia
Semantic Web
Web 2.0, Web 3.0, Plain Old Semantic HTML, Search engine optimization, Open Database Connectivity, References, Information architecture, Knowledge management, Topic Maps, XML, Description logic
W3C based
RDF, OWL, URI, HTTP, SPARQL, GRDDL, RDFS
Common Vocabularies
FOAF, SIOC, Dublin Core, SKOS
Semantic Annotation
RDFa, Microformats, eRDF
Rules
Rule Interchange Format, Semantic Web Rule Language
Tim Berners-Lee, James Hendler, Ora Lassila, Nigel Shadbolt, Wendy Hall, Kingsley Idehen, Dan Brickley, Libby Miller, Dave Beckett
RDFa (or Resource Description Framework - in - attributes) is a set of extensions to XHTML being proposed by W3C. RDFa uses attributes from XHTML's meta and link elements, and generalises them so that they are usable on all elements. This allows you to annotate XHTML markup with semantics. A simple mapping is defined so that RDF triples may be extracted.
The W3C RDF in XHTML Taskforce is also working on an implementation for non-XML versions of HTML.[1] The primary issue for the non-XML implementation is how to handle the lack of XML namespaces.
The RDFa community runs a wiki to host tools, examples, and tutorials.[2]
Contents
[edit] History
RDFa was first proposed by Mark Birbeck in the form of a W3C note entitled XHTML and RDF,[3] which was then presented to the Semantic Web Interest Group at the W3C's 2004 Technical Plenary.[3] Later that year the work became part of the sixth public Working Draft of XHTML 2.0.[4] Although it is generally assumed that RDFa was originally intended only for XHTML 2, in fact the purpose of RDFa was always to provide a way to add a metadata to any XML language. Indeed, one of the earliest documents bearing the RDF/A Syntax name, has the sub-title A collection of attributes for layering RDF on XML languages.[5] The document was written by Mark Birbeck and Steven Pemberton, and was made available for discussion on October 11, 2004. (Note that although the document bears the logo of a W3C note, it was never actually placed at a W3C URL.)
In April 2007 the XHTML 2 Working Group produced a module to support RDF annotation within the XHTML 1 family.[6] As an example, it included an extended version of XHTML 1.1 dubbed XHTML+RDFa 1.0. Although described as not representing an intended direction in terms of a formal markup language from the W3C, limited use of the XHTML+RDFa 1.0 DTD did subsequently appear on the public Web.[7]
October 2007 saw the first public Working Draft of a document entitled RDFa in XHTML: Syntax and Processing.[8] This superseded and expanded upon the April draft; it contained rules for creating an RDFa parser, as well as guidelines for organizations wishing to make practical use of the technology. It reached Proposed Recommendation status in September 2008.[9]
An additional RDFa Primer document was last updated in June 2008.[10] (The first public Working Draft dates back to March 2006.)
[edit] Essence
The essence of RDFa is to provide a set of attributes that can be used to carry metadata in an XML language (hence the 'a' in RDFa).
These attributes are:
[edit] Benefits of RDFa
Five "principles of interoperable metadata" met by RDFa.[1]
Additionally RDFa may benefit web accessibility as more information is available to assistive technology.[2]
[edit] Examples of RDFa
The following is an example of adding Dublin Core metadata to an HTML file. Dublin Core data elements are data typically added to a book or article (title, author, subject etc.)
<div xmlns:dc="http://purl.org/dc/elements/1.1/" about="http://www.example.com/books/wikinomics"> <span property="dc:title">Wikinomics</span> <span property="dc:creator">Don Tapscott</span> <span property="dc:date">2006-10-01</span> </div>
However, the real power of RDFa is in how it allows you to mark up running text with semantic values:
<p xmlns:dc="http://purl.org/dc/elements/1.1/" about="http://www.example.com/books/wikinomics"> In his latest book <cite property="dc:title">Wikinomics</cite>, <span property="dc:creator">Don Tapscott</span> explains deep changes in technology, demographics and business. The book is due to be published in <span property="dc:date" content="2006-10-01">October 2006</span>. </p>
[edit] XHTML+RDFa 1.0 example
The following is an example of a complete XHTML+RDFa 1.0 document. It uses Dublin Core and FOAF, an ontology for describing people and their relationships with other people and things:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN" "http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en"> <head> <title>John's Home Page</title> <base href="http://example.org/john-d/" /> <meta property="dc:creator" content="Jonathan Doe" /> </head> <body> <h1>John's Home Page</h1> <p>My name is <span property="foaf:nick">John D</span> and I like <a href="http://www.neubauten.org/" rel="foaf:interest" xml:lang="de">Einstürzende Neubauten</a>.</p> <p>My <span rel="foaf:interest" resource="urn:ISBN:0752820907">favorite book</span> is the inspiring <span about="urn:ISBN:0752820907"><cite property="dc:title">Weaving the Web</cite> by <span property="dc:creator">Tim Berners-Lee</span></span>.</p> </body> </html>
In the example above, the document URI can be seen as representing a person. The foaf:nick property (in the first span element) contains a nickname for this person, and the dc:creator property (in the meta element) tells us who created the document. The hyperlink to the Einstürzende Neubauten website contains rel="foaf:interest", suggesting that John Doe is interested in this band. The URI of their website is a resource. (If it had been rev="foaf:interest" instead, it would have suggested that Einstürzende Neubauten were interested in him.)
The foaf:interest inside the second p element is referring to a book by ISBN number. The resource attribute defines a resource in a similar way to the href attribute, but without defining a hyperlink. Further into the paragraph, a span element containing an about attribute defines the book as another resource to specify metadata about. The book title and author are defined within the contents of this tag using the dc:title and dc:creator properties.
Here are the same triples when the above document is automatically converted to RDF/XML:
<?xml version="1.0" encoding="UTF-8"?> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:dc="http://purl.org/dc/elements/1.1/"> <rdf:Description rdf:about="http://example.org/john-d/"> <dc:creator xml:lang="en">Jonathan Doe</dc:creator> <foaf:nick xml:lang="en">John D</foaf:nick> <foaf:interest rdf:resource="http://www.neubauten.org/"/> <foaf:interest> <rdf:Description rdf:about="urn:ISBN:0752820907"> <dc:creator xml:lang="en">Tim Berners-Lee</dc:creator> <dc:title xml:lang="en">Weaving the Web</dc:title> </rdf:Description> </foaf:interest> </rdf:Description> </rdf:RDF>

