Ben Trott has uploaded version 0.02 of XML::FOAF to CPAN. This is a Perl module designed to make it easier for programmers to work with FOAF documents. It builds upon the RDF::Core module from Ginger Alliance and can use Crypt::OpenPGP to check digitally signed FOAF files. Version 0.02 of XML::FOAF adds autodiscovery support. The documentation shows how to load FOAF from a URI, which can either be a directly named FOAF file, or an HTML page which references a FOAF file using the following markup:
<link rel="meta" type="application/rdf+xml" title="FOAF" href="http://foo.com/my.foaf" />See Ben's earlier Fun with FOAF article for more examples of usage and potential applications.
The All Your FOAF toy indexing tool has been rewritten in Ruby. The original was a standalone short Perl script that showed how a Web of RDF documents can be explored using pretty simple code. The Ruby re-write uses the RubyRDF library, and has a nicer architecture.
See ayf.rb for the main code, myScutter.rb for an example crawler that uses it, and who.rb for a 25 line demo script that shows a custom crawler-based app (sample output).
This shows one of the attractions of Ruby as a scripting language. You can have one page hacks (like my original Perl script, ayf.pl) and migrate them smoothly into more reasonable chunks of OO-ish code. The result of rewriting this in Ruby (and using a proper RDF library) is that scripts such as who.rb are easier to create and extend, since all you have to do is write a snippet of code that gets called when each RDF document has been parsed.
This is of course still pretty basic. A better RDF Web indexer would need better facilities for controlling link-following behaviour, caching etc., and needs to be hooked up to persistent RDF storage systems. But hopefully it'll show the fundamental simplicity behind some of this stuff...