June 25, 2003

Using foaf:weblog in your FOAF file

Here's how to add a foaf:weblog property to a FOAF document.

Anywhere there is an element describing a Person (or for that matter a company, group etc), you can include a sub-element that mentions their weblog(s):

So, if you start out with markup like this:

(Nicole just asked me how to do this, so she gets to be the example...)

<foaf:Person>
  <foaf:name>Nicole Sullivan</foaf:name>
  <foaf:homepage rdf:resource="http://www.apocalypse.org/~nicole/"/>
</foaf:Person>

...and add a weblog property of the Person described, it should look like this:

<foaf:Person>
  <foaf:name>Nicole Sullivan</foaf:name>
  <foaf:homepage rdf:resource="http://www.apocalypse.org/~nicole/"/>
  <foaf:weblog rdf:resource="http://www.stubbornella.org/"/>
</foaf:Person>

It doesn't matter exactly where you put the foaf:weblog entry, so long as it is immediately 'inside' the foaf:Person element. You can have the foaf:homepage bit first, or foaf:img, foaf:workplaceHomepage etc. there too., all alongside each other in any order.

This same technique works if you are describing your friends and collaborators in a FOAF file; just add in a foaf:weblog property inside the foaf:Person section that describes them.

That's all there is to it. Your FOAF file now describes the address of your weblog, making it easier to find for FOAF and other Semantic Web tools.

Note that If you have multiple weblogs, list them each separately, one after another. Note also that each foaf:weblog described in FOAF has to be the weblog of one 'thing' (whether Person, Company or whatever). So describing collaboratively edited weblogs is a topic I'll come back to in a future article.

Posted by danbri at June 25, 2003 11:48 AM
Comments
Post a comment