foaf

Dan Brickley daniel.brickley@bristol.ac.uk
Sat, 22 Feb 2003 21:32:47 -0500


* lgonze@panix.com <lgonze@panix.com> [2003-02-22 19:29-0500]
> 
> The purpose of foaf is collaborative filtering, yes?

FOAF is semantic Web vapourware - I'm not sure I ever really 
wrote down what the purpose was... ;)

It's really a collision of various strands. I wanted to find out what it 
might be like if there were a machine readable equivalent to the 
traditional HTML home page, capturing in a a more automation-friendly 
way the sorts of claims one often finds in prose on a person's homepage. 

But I also wanted to experiment with deployment models for RDF/XML as a data 
format for using in the public Web, eg. what issues arise when people 
publish RDF document alongside HTML? How can indexing and harvesting tools 
deal with merging data from multiple scattered documents? How do we deal with
having a variety of ways of identifying the same thing (person, company, etc)?
How can we structure databases and query APIs to support the need to 
track the provenance of this mergable data? How feasible is it to mix 
multiple independently developed XML/RDF vocabularies in one sprawling 
ill-scoped application? So from this perspective FOAF might seem 
somewhat technology-led. 

I suspect the homepage analogy is the best explanation. Homepages are pretty 
pointless things in many ways, but they are what you make of them. You can 
use a homepage as a bibliography, CV, personality profile, or art happening.
You can list the URLs for organisations you work for, have worked for, or 
aspire to work for. Or you might give a geek-code or myers briggs profile  
if you feel like sharing that sort of thing. Or list stuff you're selling, 
or photos of yourself and your friends. If you're that way inclined, you 
might point to your PGP key, maybe even sign the documents you publish in 
the Web too. FOAF's in very similar territory, with a few interesting twists.
Instead of making these sorts of statements in rambling unpredictable 
human-oriented HTML prose, you get to make them in fiddly futuristic harder
to read and write RDF/XML markup. The payoff, if you see this as a benefit, 
is that its a lot easier to write code that processes such data, since you 
can deal with fairly predictable structures instead of natural language. So
for eg. one might query the RDF to find RSS channels that were made by 
people who are members of FoRK, or find photos depicting the participants in
the latest thread you're reading...

Anyways, the documentation is still pretty woeful, but there are a few 
interesting things people have built regardless, see 
http://rdfweb.org/foaf/ and nearby. Edd's articles are a good intro, as is 
his foafbot application (currently offline while being updated to use 
more recent versions of the Redland RDF toolkit, unfortunately).

FWIW the most interesting imho thing about FOAF is the way we use 
rdfs:seeAlso references to link together RDF/XML documents into a Web. 

For example, in http://rdfweb.org/people/danbri/rdfweb/danbri-foaf.rdf I write:

(note the seeAlso hyperlinks)

 <Person>
    <mbox rdf:resource="mailto:daniel.brickley@bristol.ac.uk"/>
    <mbox rdf:resource="mailto:danbri@rdfweb.org"/>
    <mbox rdf:resource="mailto:danbri@w3.org"/>
    <schoolHomepage rdf:resource="http://www.vandh.free-online.co.uk/wgate/westgate.htm"/>
    <contact:nearestAirport>
      <wn:Airport air:icao="EGGD" air:iata="BRS"/>
    </contact:nearestAirport>
    <myersBriggs>INTP</myersBriggs> <!-- not that I'm a believer, but still... -->
    <plan>Save the world and home in time for tea.</plan>
    <rdfs:seeAlso rdf:resource="http://rdfweb.org/people/danbri/rdfweb/webwho.xrdf"/>
<!-- etc etc -->
    <knows>
      <Person foaf:name="Edd Dumbill" foaf:nick="edd">

        <rdfs:seeAlso rdf:resource="http://heddley.com/edd/foaf.rdf"/>

        <mbox rdf:resource="mailto:edd@usefulinc.com"/>
        <mbox rdf:resource="mailto:edd@xml.com"/>
        <mbox rdf:resource="mailto:edd@xmlhack.com"/>
        <homepage rdf:resource="http://heddley.com/edd/"/>
      </Person>
    </knows>
</Person>

...and over in http://heddley.com/edd/foaf.rdf Edd writes a bunch more 
RDF that describes and references other people, etc etc. This makes it 
easy to write code that scutters around this Web of documents, parsing each 
into RDF triples for storage/query, in a way not so different from 
classic search enginery. Difference being that the documents are fundamentally
data-oriented rather than prose, and so support more SQL-like query operations.

Here's a cheap/nasty Perl scutter I hacked up that doesn't use a proper 
XML or RDF parser (and hence easy to install). We can do better but it 
should give you an idea of the way things could work.

http://rdfweb.org/2002/09/ayf/ayf-intro.html -> 
http://rdfweb.org/2002/09/ayf/ayf.pl

If you run this it'll trawl around the foaf web keeping a local .html file 
updated with photo urls extracted. Idea being you can gut out that behaviour 
and replace it with whatever you're interested in doing, eg. filtering 
by more interesting properties of people. See 
http://rdfweb.org/2002/09/ayf/intro.html also for the bones of a rewrite 
in Ruby that tries to do things properly but isn't finished yet.

Hoping this makes some sense,

Dan

--
http://rdfweb.org/people/danbri/rdfweb/danbri-foaf.rdf
http://rdfweb.org/people/danbri/rdfweb/webwho.xrdf
etc