The documentation for each vocabulary on vocab.org is built from that vocabulary's RDF schema using a set of XSLT stylesheets and makefiles.
Generate the makefile using vocab-generate-makefile.xsl. This stylesheet takes three parameters:
Apply the stylesheet to the vocabulary RDF schema document. For example:
xsltproc --param schema "'vann'" --param date "'20050401'" ../2004/03/toolchain/vocab-generate-makefile.xsl vann-vocab-20050401.rdf > Makefile-vann-20050401
(Note how the parameters are enclosed in both types of quotes to ensure that they are passed as text and not interpreted as XPath references.)
The result is a makefile that contains targets for all the files needed to completely document the vocabulary. I pipe the output to a new makefile for each version of the schema which means I can regenerate the documentation for any version at any time.
Run make with the generated makefile. This applies vocab-html-docs.xsl to the schema document once for each class or property and once for the HTML version of the schema. This stylesheet takes an optional parameter:
The makefile generates RDF and HTML descriptions for each property and class in the schema. These files are named following the scheme: NNNN-term-TTTT-DDDD where NNNN is the vocabulary short name (e.g. bio), TTTT is the property or class name (e.g. date) and DDDD is the vocabulary date (e.g. 20050401), .rdf or .html is added as appropriate.
The makefile also copies the term documents to the short versions of the file names (e.g. date.html) so that they can be returned when a user dereferences the term URI.
The toolchain uses XSLT which operates at the syntactic level on the RDF schemas. This means that the RDF used in the schemas has to be authored in a consistent manner. The first child of the rdf:RDF needs to be an owl:Ontology element. This contains all the metadata about the vocabulary. The most important properties used here are:
<dcterm:hasFormat> <rdf:Description rdf:about="http://purl.org/vocab/vann/vann-vocab-20050401.html"> <dc:format> <dcterm:IMT> <rdf:value>text/html</rdf:value> <rdfs:label xml:lang="en">HTML</rdfs:label> </dcterm:IMT> </dc:format> </rdf:Description> </dcterm:hasFormat> <dcterm:hasFormat> <rdf:Description rdf:about="http://purl.org/vocab/vann/vann-vocab-20050401.rdf"> <dc:format> <dcterm:IMT> <rdf:value>application/rdf+xml</rdf:value> <rdfs:label xml:lang="en">RDF</rdfs:label> </dcterm:IMT> </dc:format> </rdf:Description> </dcterm:hasFormat>