#104 Add FOAF export capability to Zoo

open
nobody
None
5
2004-02-22
2004-02-22
Oliver M. Bolzer
No

Attached is a patch that allows exporting basic
information about a user and their friends/foes using
the FOAF (Friend of a Friend) RDF-scheme. (s.
http://www.foaf-project.org/\)

Accessing /~User/foaf.rdf exports the users Friends and
Foes as foaf:knows in addition to some information
known about the user. When friends.rdf or foes.rdf is
accessed, only those will be returned as foaf:knows.

A example foaf.rdf would look like this.

<?xml version='1.0'?>
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
xmlns:foaf="http://xmlns.com/foaf/0.1/"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<foaf:Document rdf:about=''>
<dc:title>FOAF File for Oliver, with Friends and
Foes</dc:title>
<dc:date>2004-02-22T16:51:57+00:00</dc:date>
<foaf:maker><foaf:Agent>
<foaf:name>Slashcode zoo.pl x.y</foaf:name>
</foaf:Agent></foaf:maker>
</foaf:Document>

<foaf:Person>
<foaf:homepage rdf:resource="http://slashdot.jp/" />
<foaf:mbox_sha1sum>50c61517b91ab0650e705920d10f4e66b52b775f</foaf:mbox_sha1sum>
<foaf:weblog
rdf:resource="http://sdtest.fakeroot.net/~Oliver/journal/"
/>
<foaf:nick>Oliver</foaf:nick>
<foaf:knows>
<foaf:Person>
<rdfs:seeAlso
rdf:resource="http://sdtest.fakeroot.net/~wakatono/foaf.rdf"
/>
<foaf:mbox_sha1sum>8608d263d9fe0b696ccdd072044ee3dddb382cb6</foaf:mbox_sha1sum>
<foaf:nick>wakatono</foaf:nick>
</foaf:Person>
</foaf:knows>
<foaf:knows>
<foaf:Person>
<rdfs:seeAlso
rdf:resource="http://sdtest.fakeroot.net/~kazekiri/foaf.rdf"
/>
<foaf:mbox_sha1sum>7761cf44d46bd27c7911827492841f42db2f6067</foaf:mbox_sha1sum>
<foaf:nick>kazekiri</foaf:nick>
</foaf:Person>
</foaf:knows>
<foaf:holdsAccount>
<foaf:OnlineAccount>
<foaf:page
rdf:resource="http://sdtest.fakeroot.net/~Oliver/" />
<foaf:accountServiceHomepage
rdf:resource="http://sdtest.fakeroot.net" />
<foaf:accountName>Oliver</foaf:accountName>
</foaf:OnlineAccount>
</foaf:holdsAccount>
</foaf:Person>

</rdf:RDF>

Discussion

  •  
    Attachments
  • Logged In: YES
    user_id=34903

    I'm attaching another patch (applied on top of the previous)
    to impove handing of e-mail address related info, depending
    on the user's emaildisplay setting.

    0. don't show e-mail => no foaf:mbox, no foaf:mbox_sha1sum
    1. spam-armor => include foaf:mbox_sha1sum
    2. show e-mail => include foaf:mbox and foaf:mbox_sha1sum

    rationale, if foaf:mbox_sha1sum is exported, it might be
    possible to check the mail address by comparing against a
    known set of addresses, resulting in a infomation leak
    compared no no adress shown at all.