GRDDL, Drupal, & Microformats

public
doconnor - Wed, 2008-03-12 12:34

Hey all,
How many of you know about GRDDL ('griddle')?

If you've seen the acronym around but haven't read the spec, then you are missing out.

In short, it's a W3C recommended way to post links to XSL stylesheets in HTML and XML documents.

Those stylesheets are specifically designed to produce RDF/XML from a target document.

So what, you might say.

Well: these GRDDL transformations can be done for an individual document; or an entire xml namespace / xmdp (microformat) profile.

If a couple of large XML schema providers or microformat xmdp wranglers were to simple add in a few attributes & the relevant transformations, a whole lot of locked up data becomes understandable.

So what does that mean to Drupal?

Picture this:
A user posts an event item via their Drupal blog.
They have an upcoming.org url for it - and that url contains hcalendar microformatted data (with the right profile)
They put it into the 'related link' box, and hit 'retrieve'.

Drupal fetches the link, and turns the microformated event & contact data into RDF - using this wonderful GRDDL stuff I mentioned.

Pop! Into a triplestore it goes, and event / contact can be rendered with the post.
It can then also be looked up for later reference in said triplestore (hurray for SPARQL!)

Now, picture this:
The same user just posted an event. They decide to invite some of their friends.
They can't remember all of the emails for their friends, but I've got a linked in profile or two, and a flickr url, or the contents of a blogroll (xfn, anyone?)
Into the magic text field those links go.
Drupal fetches the urls, discovers vcards, translates into FOAF -> into the triplestore.

Drupal could then present the user with 'send email invites' or render 'these people may attend' information.

There's plenty more scenarios you can think of; I'd bet.
What can be done if all microformatted information was extractable?
How would Drupal use it?

What are the big stumbling blocks with these scenarios?
1) A GRDDL PHP client is too much effort... or was.
2) Unfortunately, some of the bigger sites don't correctly publish microformat profile attributes - which can be overcome by deliberately forcing common microformat transformations (hcalender, hcard, etc)
3) Getting your own triplestore running can be tricky.

RDFa ?

Boris Mann's picture
Boris Mann - Wed, 2008-03-12 15:41

I'm more interested in RDFa than microformats. See http://evan.prodromou.name/RDFa_vs_microformats

But in general, regardless of GRDDL or specific pieces, I think the approach of stick in URL, suck into Drupal, and make interesting things happen, is a good one. Looking at the FeedAPI and Feed Element Mapper might be a good idea, since they do that today.


GRDDL is not just for microformats

arto@drupal.org's picture
arto@drupal.org - Tue, 2008-03-25 20:32

RDFa is great (I'm using it on a number of non-Drupal-related projects currently), but you still need to somehow extract the triples from an RDFa-annotated page. GRDDL provides a standardized method for doing this, outputting RDF from RDFa, microformats, or any other structure embedded in XHTML.

I think a GRDDL module for Drupal will, in fact, turn out to be very important. This would make a great Summer of Code project if anyone's interested in tackling it. The basic building blocks are there in the form of the RDF API and Daniel's XML_GRDDL library.


A practical example of GRDDL to import other site profile data

doconnor - Tue, 2008-03-25 22:42

Another benefit to GRDDL is that you can do reasonably neat things with a little xpath and existing microformats - you don't need to go the whole hog and use a triplestore to get benefits.

For instance, you can retrieve meaningful data from flickr, linkedin, upcoming and others as part of a user signup process.