[foaf-dev] Adding FOAF support to mod_virgule (Advogato)

Richard Cyganiak richard at cyganiak.de
Wed Jan 31 23:23:31 UTC 2007


Steve,

On 31 Jan 2007, at 18:25, R. Steven Rainwater wrote:

> On Mon, 2007-01-29 at 11:17, R. Steven Rainwater wrote:
>> I'm looking at adding FOAF support to mod_virgule <...>
>
> I didn't get any feedback on this, but I took a shot at it anyway. I'm
> exporting trust metric certifications as foaf:knows and the user's
> projects as foaf:Project. Here's an example of what the output looks
> like now:
>
>  http://www.advogato.org/person/StevenRainwater/foaf.rdf

Nice! There are three minor issues though.

First, the foaf:Project thing. Each of them indeed has to be wrapped  
into a foaf:currentProject element. That's because of the underlying  
graph structure of RDF. All the foaf:Person and foaf:Project elements  
represent nodes in the graph. All the foaf:somethingLowerCase  
elements are arcs that connect two nodes. If you wrap foaf:Project  
directly into foaf:Person, then you just have two nodes, and haven't  
said how they are connected. That's why the validator complains, and  
why the foaf:currentProject element is needed. (Unfortunately, RDF/ 
XML doesn't really make the RDF graph structure clear, which makes  
this exercise harder than it should be. Sigh.)

Second, the choice of URL for foaf:homepage. As far as I can tell,  
you use a person's non-Advogato homepage for the main person, and the  
person's Advogato info page for the known people. That's a problem,  
you should use the same in both cases. That's because the homepage  
will be used to link up persons from different files. RDF files are  
just containers of arbitrary data -- the rdfs:seeAlso points to the  
container, and another piece of information is needed to pinpoint the  
resource of interest inside the file. With FOAF, we usually use a  
person's email address (or a hash thereof) for this purpose, but the  
homepage works too. If it's not the same homepage in all files, then  
we can't link the people up properly. Note that you can give multiple  
foaf:homepages per person if you like. (Unfortunately, the creators  
of the FOAF spec are obsessed with using an RDF misfeature called  
blank nodes instead of URI-named nodes, which makes linking people  
much harder than it should be. Sigh.)

Third, not an issue but a suggestion: You should add some metadata  
about the FOAF file itself. Insert this into the root rdf:RDF element:

   <foaf:PersonalProfileDocument rdf:about="">
       <rdfs:label>Advogato FOAF profile for R. Steven Rainwater</ 
rdfs:label>
       <foaf:primaryTopic rdf:nodeID="me"/>
   </foaf:PersonalProfileDocument>

And add an rdf:nodeID="me" attribute to the main foaf:Person. This  
adds two statements to the FOAF document itself (rdf:about="" always  
refers to the current document): a label and a foaf:primaryTopic arc  
to the foaf:Person node the document is about. This will make the  
file much more useful to general-purpose RDF browsers such as  
Tabulator and Disco.

Whew! That's it.

Yours,
Richard



>
> Hopefully I haven't screwed it up too badly. :)
>
> I'm unsure of my project property implementation because every  
> example I
> found was completely different. Some wrapped each foaf:Project in a
> foaf:currentProject, some wrapped foaf:currentProject in a  
> foaf:Project.
> In our case, the currentProject vs pastProject property doesn't  
> have any
> meaning, so I just left it out altogether.
>
> The FOAF standard seems to suggest that I can put a foaf:homepage tag
> inside of foaf:Project but when I ran my output through an RDF
> validator, it complained that this wasn't allowed. Is there any  
> sort of
> official FOAF validator around?
>
> -Steve
>
> _______________________________________________
> foaf-dev mailing list
> foaf-dev at lists.foaf-project.org
> http://lists.foaf-project.org/mailman/listinfo/foaf-dev
>



More information about the foaf-dev mailing list