I’ve been working with FOAF a bit recently which has entailed a fair amount of reading through the FOAF namespace document. Doing a “View Source” on that page is also useful as you can then examine the embedded RDF Schema that describes the FOAF vocabulary; there’s a lot more in the schema than is visible in the HTML.
But this soon got frustrating so I gave some thought to a better approach.
First of all I dug out a link to a stylesheet posted by Edd Dumbill that can be used to extract the RDF into a separate file. I’ve put a local copy of it here.
However that also got frustrating, as it’s still not particularly readable. So, whilst thinking about an idea of Dan Brickley’s to label the FOAF properties with indications of their stability, I decided to write up an XSLT stylesheet to generate a more complete HTML presentation of the FOAF documentation.
The results — still currently a work in progress — are available here: foaf2doc.xsl and the sample output which works on the extracted RDF Schema.
As a work in progress this is liable to change. For example there are additional properties that could be added, including the aforementioned stability labelling. Comments are very welcome however. The XSLT should work with any RDF Schema, although it relies on the owl:Ontology element to describe the schema. See the FOAF schema for an example of this.
The magic of URL pipelining can be used to combine these two stylesheets together to generate documentation on-the-fly. The key additional ingredient being the W3C XSLT Service:
Building this up step by step we start with:
- Extracting the RDF Schema — using Edd’s stylesheet, and then
- Generating the Documentation — using foaf2doc.xsl