IdealSimpleFoafLibrary

Here are my ideas on what an ideal simple foaf library might look like.

You'd use this to write little script and converters.

It's be a single install, for one. You wouldn't have to install any additional dependencies, beyond the language and it's default packages.

And it'd be easy to use. Python code might look something like this:

#!python
import foaf

foaffile = foaf.open( "http://blahblah.com/blah/blah.rdf" )
rootnode = foaffile.root()
print rootnode[[Person]][0][[name]]
for person in rootnode[[Person]][0][[knows]]:
  print person[[name]]
If, say,
rootnode[[Person]][0][[knows]][3]
didn't have a
name
attached, but there was a
seeAlso
, the default behavior would be to go off and scrounge around the Internet, trying to find more information, and caching it in it's local memory database.

It'd be that simple.

You could use cheesy XML parsers, cheesy dictionary "databases" mapping URL to information, screw validation, and make a totally sloppy system. It'd be great.

Notes for implementing in Python:

* PythonInfo:MiniDom - Parsing simple XML files in Python2.3 with
xml.dom.minidom
* PythonInfo:RdfLib - This does half the work we want. Only problem is it's a dependency. Might be able to talk with the authors about incorporating it, though.

-- LionKimbro DateTime(2004-05-30T22:11:04Z)

PHP Resources

* XML_FOAF - A pear package FOAF parser & creator library - http://pear.php.net/package/XML_FOAF
* FOAF_Person - Julian Bond's code for parsing, uses a stripped down version of RAP. 
* ARC - A set of stand-alone classes. The "RDF/XML parser" (~25KB, depends on wanted features) and "simple_model" (8K) classes could be used to build a simple FOAF library. 

Perl Resources

* XML::FOAF -- A FOAF parser. However, it's kind of clunky to use, for one, and two, it requires RDF::Core -- non-trivial.

We need a lightweight parsing library that's easy to include. No storage, no generation, just parsing. Is there something out there that solves this? (I think someone mentioned RDF::Simple to me at one point, but I never got far into it.) Many open source projects do not want RAP because it is a lot of code. (I know that 50kb compressed doesn't seem that big, but when it's twice the size of the rest of your project, it's a lot of code to maintain.)

Alternatively, could a web service work for any of these? If provided by the FOAF Project (or hell, FOAFnet, since they're all so keen on implmenetaiton), something that would convert FOAF files from RDF to a more XML-Friendly form (like FOAFnet recommends)?