- From: Ben Adida <ben@mit.edu>
- Date: 2006年4月29日 21:18:35 -0400
- To: public-rdf-in-xhtml task force <public-rdf-in-xhtml-tf@w3.org>
- Cc: Dan Connolly <connolly@w3.org>, Eric Miller <em@w3.org>, Daniel Weitzner <djweitzner@w3.org>
- Message-Id: <47927874-900A-465E-B9FA-50AB1A00FF16@mit.edu>
Hi all,
This week's brainstorm and hacking session with DanC yielded some
very interesting ideas, including a promising direction for providing
a path from Microformats to RDFa. As a result, I'm proposing hGRDDL,
a GRDDL-like way to transform Microformats into RDFa. It seems this
approach may resolve a core adoption issue: MFs are being deployed,
but RDFa is ultimately the way we want applications to deal with
metadata, and as MF authors realize that MFs are not extensible,
they'll want an upgrade path.
Here's the basic idea:
- the HEAD profile for MF pages indicates an hGRDDL transform
- tools can transform MF-HTML into RDFa-HTML using this hGRDDL transform
- browsers augmented with tools (plugins, bookmarklets, etc...) can
literally *swap out* the MF-HTML and replace it with the RDFa-HTML
- cut-and-paste, metadata highlighting, self-containment, are all
supported by this approach, since the resulting RDFa-HTML is what's
being rendered to the user.
- issues of slight data-type incompatibilities between MFs and RDF
vocabularies are resolved, since the data type conversions can be
performed by the hGRDDL.
Architecturally, this is really exciting, because it means that the
"flimsiness" of MFs can be encapsulated in the hGRDDL transform,
after which it's all RDFa, extensible, evolvable, etc... And since
there won't be that many MFs, there won't be that many hGRDDL
transforms to support. Anyone who wants to do more complicated things
will have an easy transition from MFs to RDFa.
All RDFa tools can consume MF pages.
I'm excited, and when I get excited about technical things, I tend to
write code. So I wrote code, and updated the GetCal bookmarklet I
sent last time to support this approach. Here's how it works:
- getcal.js imports rdfa.js
- getcal.js adds an hGRDDL profile as follows (this would be done
more or less automatically if the MF pages had profiles):
RDFA.GRDDL.addProfile('http://ben.adida.net/rdfa/new/hcal-rdfa.js');
- getcal.js starts the RDFa parser:
RDFA.parse();
The hcal-rdfa.js script traverses the DOM, looking for hCal stuff,
and updating the DOM to reflect the corresponding RDFa properties.
It's literally adding attributes directly into the DOM as it goes,
though none of these affect the rendering, of course.
Then, when that hGRDDL transformation is done, the normal RDFa
parsing happens. The normal callbacks happen, the Calendar logos get
added to the rendered page, etc... In other words, the only change
here is the hGRDDL front-end that went through the DOM, picked up the
hCal MF, and transformed it into RDFa within the same document.
Want to try it out?
http://ben.adida.net/rdfa/new/
Drag the "GetCal" bookmarklet to your bookmarks bar.
Go to any page with MF hCal support, like http://eventful.com (go to
an actual event)
Invoke the bookmarklet. (the logos get added to the end of the page
right now... I'll fix that soon.)
Tadah.
-Ben
Received on Sunday, 30 April 2006 01:18:44 UTC