Microformats and eRDF sitting in a tree
Following on from my previous post on eRDF I’ve started to play around with it. For anyone bored enought to have read the source of this site today you’ll have seen a couple of behind the scenes changes – specifically I’ve added a dash of FOAF.
The FOAF, or Friend of a Friend, project is:
creating a Web of machine-readable pages describing people, the links between them and the things they create and do.
I sort of see it as a bigger and more complicated older brother to XFN and hCard.
First things first, unlike Microformats, using eRDF needs a bit of setup outside just adding classes and attributes – specifically you need to add a profile to the head element of your document and then add some namespaces links into the head like so:
Then you’re onto the more familiar ground (if you’re used to Microformats) of adding semantic attributes. I already had the following snippet markup up in hCard, i just needed to add a few more classes (-foaf-Person, foaf-weblog and foaf-name) to existing elements.
Morethanseven
is where Gareth Rushgrove plays with the web
The full FOAF Specification details a huge range of other elements – everything from foaf:Project for making associations between yourself and projects you have worked on, to foaf:OnlineGamingAccount which is pretty self explanatory.
When parsed out that gives you a foaf document a little something like:
Morethanseven
Gareth Rushgrove
So far I’d agree with Ben. All I’ve done is something people (including me) have been doing already with hCard. But I’ve done it in a way, using eRDF, that doesn’t in any way stop me continuing using Microformats.
Marking things up with Microformats for it’s own sake was only ever really of interest to markup junkies (including me again). It’s only when you can parse that information out that it gets more interesting. I’ve got a follow up post to this on just that subject involving some XSL, Javascript, PHP and some standing on the shoulder of giants. It will be left to a post after that when I try do something a little different.
On a related note; so far I’ve found only scattered and often overly technical and verbose documentation on eRDF and RDF in general. I’ve been adding links to del.icio.us as I find useful resources but I can see how useful Get Semantic has the potential to be if any of this is going to take off in the web standards community.
Comments
Gareth, feel free to jump in to GetSemantic – I should hopefully have the OpenID stuff set up in the next day or so (been mad crazy busy over the last few days with real life work). If you come up with an idea, it’s easy enough to encode it as, say, eRDF and put it up. The basic idea is that if you’ve got something you want to markup, see if it’s possible to mark it up easily using eRDF. If not, then perhaps coming up with a semantic markup format and writing a GRDDL script would be easier.
Also, I’ve experimented a lot with RAP (I see you’ve bookmarked it on del.icio.us). It’s not the easiest library to use – the Python one tends to be much easier – but once you figure out RAP, it is quite powerful. What’s really cool about it is that you can make a script to, say, pull in five different web pages marked up with microformats and/or eRDF containing different scraps about you and merge them all in to one document and serve that as your FOAF profile. For instance, LiveJournal gives me a FOAF profile. But I also have a profile that I keep on my server. It’s trivially easy for me to write a script using RAP that pulls both in and merges them.
Tom Morris - 4th March 2007
Thanks Tom. Hopefully I’ll jump into Get Semantic once I get my head round all this stuff. I’ve had a brief look at RAP, with regards the Python library I’d found pdfxml.py which may or my not be the one you were refering to? I’ve yet to look at GRDDL but it’s on my list.
gareth - 4th March 2007
[...] < [...]
Morethanseven > Parsing ERDF - 4th March 2007
The Python library is http://rdflib.net/ – you can do much the same with the PHP and the Python libraries, it’s just I find the Python library to be slightly better documented. And you can test it out interactively.
If you have any problems with any of these things, just drop me an email or hop on to #swig on irc.freenode.net
Tom Morris - 4th March 2007
Comments are now closed.