RDFa

Index



1. At A Glance

RDFa is a syntax that allows for embedding RDF information into (X)HTML documents via attributes. The best starting point to explore RDFa is the official RDFa page at the SWD-WG Wiki.

Fabien Gandon has put together a nice RDFa tutorial (via slideshare).

2. FAQ

The following FAQ tries to give answers to the most important questions around utilising RDFa. It is maintained by members of the RDF in XHTML Taskforce, though anyone interested is welcome to contribute. You may also want to subscribe to the mailing list to get involved into RDFa discussions.

2.1. General

General RDFa questions.

2.1.1. Can I use RDFa on any HTML version?

The intention of the RDF in XHTML Taskforce is that RDFa can be used with every (X)HTML version. This is, however, still an issue that is in state of flux. Shortly we'll support XHTML from version 1.1 with specific module for metainformation and attributes. We are also working for an HTML implementation.

2.1.2. I am currently using Microformats. Any chance to upgrade to RDFa?

Yep. And it is soooo easy: Our proposal is to use hGRDDL. See it work in a simple hGRDDL example.

2.2. Syntax

Questions and answers w.r.t. the syntax.

2.2.1. How do I put RDF in my HTML document using RDFa?

For syntactic details, the reader is referred to the RDFa syntax document. If you want to e.g. publish your profile using Friends-Of-A-Friends (FOAF) vocabulary, you may copy-and-paste the following HTML-snippet and adapt it to your needs:

<div xmlns:foaf="http://xmlns.com/foaf/0.1/" id="me" about="#me" class="foaf:Person">

You've reached <a rel="foaf:homepage foaf:weblog">my homepage and blog</a>.
My name is <span property="foaf:name">Fran Q</span>.

<h3>Blog Roll</h3>
<ul rel="foaf:knows">
  <li><a href="http://example.org/~alice">Alice</a></li>
  <li><a href="http://example.org/~bob">Bob</a></li>
</ul>

</div>

For more examples see the RDFa Examples pages ...

2.2.2. How do I put bibliographic metadata (as Dublin Core) in my HTML document?

<div xmlns:dc="http://purl.org/dc/elements/1.1/">
 <div about="http://esw.w3.org/topic/RDFa">RDFa 101<br />
  <strong>Author</strong>: <a href="http://www.w3.org/2006/07/SWD/wiki/MichaelHausenblas" rel="dc:creator">MichaelHausenblas</a> <br />
  <strong>Topics</strong>: <span property="dc:subject" datatype="xsd:string">scalability, video-blogging, GEO-tracking</span>
 </div>
</div>)

2.2.3. How do I connect my web page to a geographic lat/long location?

For example one way of doing this is the following.

<div xmlns:xsd="http://www.w3.org/2001/XMLSchema#" 
     xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" 
     xmlns:foaf="http://xmlns.com/foaf/0.1/">
  <div about="http://www.w3.org/2006/07/SWD/wiki/MichaelHausenblas">
   Michael <link rel="foaf:based_near" href="[_:loc]">is located near</link>
   <span about="[_:loc]">
     latitude <span property="geo:lat" datatype="xsd:float">47.064</span> and 
     longitude <span property="geo:long" datatype="xsd:float">15.453</span>.
   </span>
   <link rel="rdf:type" href="[foaf:Person]" />
  </div>
</div>

2.2.4. How do I put rights metadata in my HTML document ala CreativeCommons?

You may want to have a look at a RDFa use case that is exactly about this issue.

2.3. Implementational

Regarding implementational issues.

2.3.1. Does RDFa support blank nodes

Yes. See the RDFa Syntax Document - Section 5.2.

2.3.2. Does RDFa support reification?

RDFa partially supports reification, cf. RDFa syntax document.

2.3.3. Does RDFa support RDF containers? E.g. Sequences, Bags, Lists, etc.

This issue is being discussed.

2.3.4. Are there any RDFa validators or sample code I can use?

Yes. See the section right below.

3. Implementations

We will be expanding this list into a proper W3C Implementation Report, but in the meantime just add yourself to the list.

Note: See also http://rdfa.info/rdfa-implementations/

3.1. XSLT

3.2. PHP

3.3. JavaScript

3.4. Java

3.5. Python

3.6. Ruby

3.7. C#

3.8. Online Extractor

3.9. Editors and Tools

3.10. Applications and Plugins

3.11. Platforms

4. RDFa in 10s

Just got 10s to understand what RDFa is? Read through some of the thoughts collected from the RDFa mailing list:

Steven Pemberton on 2007-02-15:
Here's one: When you do a search on the Web for Pascal, the search engine doesn't know if you mean the programming language, the philosopher, or any of a dozen other possibilities. Amongst other things RDFa helps the search engine work out what a page is about.

Another: When you look at a web page about an event such as a conference, you can see where it is, when it will happen, and so on. If the browser knew that too it could offer to add it to your calendar, show a map of the location, find flights there, look up hotels, maybe even offer to fill in your details on the registration form.

Ivan Herman on 2007-02-15:
This is not my elevator pitch, but David Wood's. I am not sure he reads this mailing list, so I just forward his idea:

Think of a credit card. Your name, expiry date, cc number is on it with nice golden letters, the card itself may have all kinds of colours and pictures. That is for the human. If you run it through the card reader, all the essential data is also available for a machine.

© David Wood :)

Karl Dubost on 2007-02-15:
short: RDFa is the label on the Jam pot.

longer: Everyone sees that it is a strawberry jam pot. But it's quite cool to have the label explicitly named, and to get other information as well about it the jam pot like the quantity and the origin of production.

Laurian Gridinoc on 2007-02-14:
Between magic ink or whatever CSI blue light + red googles, I would use this description: upon the structure of the page, RDFa allows you to add a semantic layer, you may also say that the layer does not alter the underlaying document, and by this is also peelable. Note: I'm borrowing the term semantic layering from the Magpie semantic browser.

Bob DuCharme on 2007-02-14:
Instead of talking about magic ink, I'd say that it's a set of attributes that let you add metadata to web pages so that you can build cool new applications around collections of web pages. (I'm assuming that I'm talking to someone who understands the basics of web pages--otherwise, there's not much point in even discussing RDFa.)

Elias Torres on 2007-02-14:
In case you have more time to explain, try this: :) http://www.xml.com/pub/a/2007/02/14/introducing-rdfa.html

Michael Hausenblas on 2007-02-14:
Imagine a magic ink on a paper. With a special kind of glasses you can actually see the things written on the paper with the magic ink. HTML is the paper and RDFa is both the magic ink and the special kind of glasses.

Simone Onofri on 2007-03-12:
We read from Semantic Web Road Map:
The Web was designed as an information space, with the goal that it should be useful not only for human-human communication, but also that machines would be able to participate and help. One of the major obstacles to this has been the fact that most information on the Web is designed for human consumption, and even if it was derived from a database with well defined meanings (in at least some terms) for its columns, that the structure of the data is not evident to a robot browsing the web.

RDFa has the power of an integration of Semantic Layer in (X)HTML document. RDFa can broke the "major obstacles": a document readable by Humans and Machines BOTH.

RDFa (last edited 2008-05-30 13:59:42 by FlorianSchmedding)