Question

I would like to store my personal data in a FOAF file on my own server. There is a group of us doing the same thing. We need a couple of custom fields that the standard FOAF implementation doesn't have, ie: availability.

How can I add the availability field, and still keep the FOAF file validated? I guess I use the RDF format outside of the FOAF block, but I am not quite sure how to do that 'legally'. Here is a sample of FOAF code.

<?xml version="1.0"?>

    <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:foaf="http://xmlns.com/foaf/0.1/">
      <foaf:Person>
       <foaf:name>Joe Blogs</foaf:name>
       <foaf:gender>Male</foaf:gender>
       <foaf:title>Mr</foaf:title>
       <foaf:givenname>Joe</foaf:givenname>
       <foaf:family_name>Blogs</foaf:family_name>
     </foaf:Person>
    </rdf:RDF>
Was it helpful?

Solution

It's really simple, you just need an 'availability' property. You could just make up a namespace and use it:

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns:foaf="http://xmlns.com/foaf/0.1/"
         xmlns:myvocab="http://my.example.org/vocab#">
   <foaf:Person>
     <myvocab:availability>....</myvocab:availability>
     <foaf:name>Joe Blogs</foaf:name>
     ....
   </foaf:Person>
</rdf:RDF>

Perfectly legal. Ideally you would host an rdf file describing the property at http://my.example.org/vocab, so people could look up the property.

However even easier is open.vocab.org. There you can define you little property and it will be retrievable. The namespace will be http://open.vocab.org/terms/, and the property name will be, well, whatever you pick.

(It may be that there's a relevant property out there already, of course. Try asking on the foaf list)

OTHER TIPS

Yes, FOAF was designed (by using RDF) to allow just this kind of casual extensibility. You can add anything you like so long as it parses as RDF (see http://www.w3.org/RDF/Validator )

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top