Jump to content

RDFa: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
→‎References: removed link that doesn't even mention rdfa
→‎References: updated references and added UC, Test Suite, and FAQ
Line 55: Line 55:


==References==
==References==
* [http://www.w3.org/2006/07/SWD/RDFa/primer/ RDFa Primer]
* [http://www.w3.org/TR/xhtml-rdfa-primer/ RDFa Primer]
* [http://www.w3.org/TR/xhtml-rdfa-scenarios/ RDFa Use Cases: Scenarios for Embedding RDF in HTML]
* [http://www.w3.org/2006/07/SWD/RDFa/syntax/ RDFa Syntax]
* [http://www.w3.org/2006/07/SWD/RDFa/syntax/ RDFa Syntax]
* [http://www.w3.org/2006/07/SWD/RDFa/testsuite/ RDFa Test Suite]
* [http://esw.w3.org/topic/RDFa#FAQ RDFa FAQ]
* [http://www.w3.org/2006/07/SWD/wiki/hGRDDL_Example hGRDDL]
* [http://www.w3.org/2006/07/SWD/wiki/hGRDDL_Example hGRDDL]
* [http://rdfa.info rdfa.info] RDFa news and examples site.
* [http://rdfa.info rdfa.info] RDFa news and examples site.

Revision as of 13:52, 22 May 2007

RDFa 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.

Essence

The essence of RDFa is to generalize the attributes (hence the a in RDFa) of the meta and link elements to allow them to be used on any element in an XHTML document.

These attributes are:

  • about - a URI specifying the resource the metadata is about; in its absence it defaults to the current document
  • rel, rev and href - specifying a relationship or reverse-relationship with another resource
  • property - specifying a property for the content of an element
  • content - optional attribute that overrides the content of the element when using the property attribute
  • datatype - optional attribute that specifies the datatype of the content.

Benefits of RDFa

Five "principles of interoperable metadata" met by RDFa.[1]

  • Publisher Independence - each site can use their own standards
  • Data Reuse - data is not duplicated. You do not need separate XML and HTML sections for the same content.
  • Self Containment - The HTML and the RDF are separated
  • Schema Modularity - The attributes are reusable
  • Evolvability - additional fields can be added and XML transforms can extract the semantics of the data from an XHTML file

Example 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:author">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
    <em property="dc:title">Wikinomics</em>,
    <span property="dc:author">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>
  

See also

References