Jeremy Keith wrote up something I've had running on my blog since just before BarCamp Brighton. If I know you and I've added your details to my whitelist, when you login with your OpenID you get to see more about me - my full contact details. One of the most useful things about hCard is that people can pull it off the Web and use it in their address book and PIM applications, or in their phone etc.


Compiling the list is manual at the moment, but I've just written a Python script to automate it slightly. The script uses rdflib and BeautifulSoup for adding OpenIDs to a FOAF file. It just uses any 'delegate' URI. This is just a sort of very rough alpha, and I'll clean it up. There are lots of complexities I don't particularly want to bother with at the moment - YADIS and the associated XML format.


The other complication I came across writing it is that rdflib doesn't currently implement graph UNIONs as described in §7 of the SPARQL Query Language specification. This is the reason why there are two SPARQL queries instead of one. If one reimplements this in a language or framework which supports UNION, you could make the software a bit simpler.


The code is a bit fugly, but here it is. I'm sure RDF-inclined Pythonistas can do interesting things with it. Next time I publish my FOAF file, it'll contain OpenIDs for all my friends. You can invoke it from the command line and it'll return an RDF/XML file. Although you'll probably want to edit the script a bit so that it's specific for you.


RDF is playing an interesting role here. It's basically a big box where I can shove all my miscellaneous data (which is, you know, everything) and can then chuck through various processes - both on the Web, on my server and on my laptop. Next step is to get my RDF infrastructure to start reading both my pages and others and looking for microformats like XFN.


As for the whitelist specifically for looking at my contact details? I'm thinking of an algorithm to determine who I can trust enough to look at them. Probably something like if give or more of the people I follow on Twitter (or similar social network) follow you. Haven't decided yet. Then again, follow does not equal trust, so I'm not sure about that.


Tags: foaf openid xfn hcard 