[uf-discuss] Re: A (big) problem with XFN: identity of source and target not findable

David Janes davidjanes at blogmatrix.com
Tue Mar 18 08:08:55 PST 2008

On Tue, Mar 18, 2008 at 10:29 AM, Toby A Inkster <mail at tobyinkster.co.uk> wrote:
> David Janes wrote:
>  > FOAF is, quite frankly, an ugly mess. This, based on my experience of
>  > trying to code to extract useful information out of it rather than just
>  > an opinion I pulled out of the air. I spent way to many hours coding
>  > trying to pull info out of FOAF because, well, things seem to be doable
>  > in lots of different ways.
>  Don't try to parse it yourself -- use an RDF parser. I recommend Redland
>  (a.k.a. librdf) -- it's stable, has bindings for a bunch of different
>  language, and feature-wise seems to beat the competition hands down.

Thanks -- I've got XFN and FOAF working nicely together too. I'm using
SPARQL and rdflib. My issue is not that it's not doable, it's just a
lot more difficult than you would think because more or less anything
shows up in the data -- not some specific thing.

With a typical XML API and Python's ElementTree, I can manipulating
data within seconds because everything will fall into a well-defined
slot. Same with JSON APIs and simplejson -- that's even better, to
tell you the truth, since there's a clearer distinction from dumping
the data what's representing a list and what's representing rows.

With XFN, I've already done the hard work: normalizing the HTML (using
TIDY), hCard parsers, etc. so it's really only regexs. That's ugly in
one sense, but there's definite benefits for the publishers.

Regards, etc...

David Janes
Founder, BlogMatrix

More information about the microformats-discuss mailing list