Useful Information Company

Indicating HTML and RDF authorship with FOAF

Indicating authorship in FOAF is achieved through the foaf:maker property.

Saying "I made this!" on HTML pages

It's a common requirement to put authoring information into HTML pages. This may be just for version control purposes, but with the ever increasing number of software agents supplementing your browsing experience -- such as Dashboard -- there is added value you can get by linking a web page to your FOAF description.

If you've read the FOAF web pages you probably already know you can link a FOAF file from HTML by putting code like this in the '' section of your page:

  <!-- the link to the FOAF file -->
  <link rel="meta" type="application/rdf+xml" title="FOAF"
       href="http://example.com/foaf.rdf" />

This leaves us with a problem. A FOAF file can describe many people. Which one is you? A software agent needs an extra hint. The answer is this shorthand:

  <meta name="foaf:maker"
    content="foaf:mbox mailto:edd@usefulinc.com" />

That tells an agent encountering your page "this was made by the person with email box edd@usefulinc.com." The agent can then search inside the FOAF file you referenced for that person.

What if you use mbox_sha1sum to obscure your email address? Easy, use this formulation:

 <meta name="foaf:maker"
   content="foaf:mbox_sha1sum '1ba3bffdd13a136d38b77542f2e26fd1dc0042f2' />

If you want to try out some software which understands this, have a look at Dashboard.

Saying "I made this!" for FOAF files

How do you say you're the maker of your FOAF file? Again, pretty simple. In the description about yourself, add a foaf:made property like this:

 <foaf:Person>
  <foaf:mbox rdf:resource="mailto:edd@usefulinc.com" />
   ...
  <foaf:made rdf:resource="" />
 </foaf:Person>

The "" means "this file."

How do you say "I made this" for any arbitrary RDF file, such as your photo metadata? Add the following to your file:

 <foaf:Document rdf:about="">
   <foaf:maker>
     <foaf:Person>
        <foaf:mbox rdf:resource="mailto:edd@usefulinc.com" />
     </foaf:Person>
   </foaf:maker>
 </foaf:Document>

If you want to list your authorship of a file somewhere else than inside it, then you use the same construct, but alter the value of rdf:about. Here's how, from within my FOAF file, I say I made my RSS file:

 <rss:channel rdf:about="http://usefulinc.com/edd/blog/rss">
   <foaf:maker>
     <foaf:Person>
        <foaf:mbox rdf:resource="mailto:edd@usefulinc.com" />
     </foaf:Person>
   </foaf:maker>
 </rss:channel>   

In fact, I wrap the rss:channel in a rdfs:seeAlso (see my FOAF file) in order to hint to FOAF spidering agents that they should go and read the RSS channel too to get more information about me.

There's a syntactic shortcut you can use here if you are described in the RDF file concerned. Change your Person description to add an rdf:nodeID attribute, this will look like:

 <foaf:Person rdf:nodeID="me">

Then add the following to your file:

 <foaf:Document rdf:about="">
   <foaf:maker rdf:nodeID="me" />
 </foaf:Document>

You can see an example of these techniques in my FOAF file.

You should also read Dan Brickley's article, Pages about people.

Of course, anyone could put your email address in a FOAF file and pretend they were you. For added security, you should consider signing FOAF files with PGP.