Morethanseven

Gareth Rushgrove

Parsing ERDF

| Comments

Now we’ve got some eRDF in our pages we need to extract it out in preparation for doing someting with it.

With XSL

First up we want to try and extract the eRDF in our page into an RDF document. Ian Davis has already created a nice XSL document to do just that. and I’ve implemented a nice service wrapper to extract the RDF from a given URL. Try pointing it at morethanseven.net or iandavis.com for an example of it in action. Next step here is to extend it to allow extracting a simple vcard from the RDF in a similar manner to Brian Suda’s Microformats extractor.

With Javascript

Dan Webb has recently written up his Sumo! microformas parser and boy is it really rather fancy. At the moment he’s only got profiles for hCard, hCalendar and hResume but writing profiles is relatively simple. Accoring to one of Dans comments he’s working on adding support for rel and rev style microformats like rel-tag and XFN.

Although billed as a Microformats parser, in reality what Dan’s created is pretty generic. You can use it to parse out any information marked up with any semantic class names – just like our eRDF.

I’ve set up a very basic Sumo! profile for FOAF and some simple tests to extract eRDF data from a test page. This is very much a proof of concept of extracting eRDF using Javascript but would be relatively simple to extend for the full FOAF spec once Dan or someone else extends Sumo! to support rel and rev.

On a related note the combination of Sumo! and the Firebug javascript console is just perfect. Anyone who hasn’t yet downloaded the latest version should get over there quick.

Firebug

Comments