Version 1.0
June 6, 2008

Overview: OWL2XHTML

owl2xhtml is a stylesheet for client-side rendering of OWL ontologies in the form of XHTML documentation. By simply including it in the header of an OWL ontology serialized in RDF/XML-ABBREV, a human-readable documentation of the ontology is being produced if the ontology is being retrieved from a (modern) browser.

This allows for nice dereferencable identifiers for ontology elements while at the same time always returning machine-readable RDF/XML-ABBREV for any Semantic Web application.

If you want to see the stylesheet in action, please check http://www.heppnetz.de/ontologies/goodrelations/v1.

Download

Simply download the stylesheet from http://www.ebusiness-unibw.org/projects/owl2xhtml/owl2xhtml.xsl.

Usage

Simply copy the stylesheet into the directory of your ontology file and insert the highlighted section directly following the <?xml version ...> tag, before the <rdf:RDF> tag:
<?xml version="1.0"?>
<?xml-stylesheet href="owl2xhtml.xsl" type="text/xsl"?>
<rdf:RDF
Check that your server handles correct content-type for ontology files, possible way is to include following code into an .htaccess file:
# Directive to ensure *.owl and *.rdf files served as appropriate content type,
# if not present in main apache config
AddType application/xml .owl
AddType application/rdf+xml .rdf
In order to get a nice result, you should tidy up the OWL code manually:
  1. Bring all elements into the order comment, subClassOf, domain, range, and subPropertyOf.
  2. Make sure the serialization format is RDF/XML-ABBREV!

By default, the Jena API and tools built on top of Jena (such as Protégé) issue a harmless warning ("Jena parse error message: {W119} A processing instruction is in RDF content. No processing was done. (...)") when processing RDF/XML that includes pointers to stylesheets. That simply says that the stylesheet itself is ignored by Jena, which is perfectly right.

Disclaimer and License

(C) 2008 by Andreas Radinger and Martin Hepp, Bundeswehr University Munich, http://www.unibw.de/ebusiness/

Warning: The stylesheet is still pretty much alpha. No implicit nor explicit warranties for fitness or merchantability are given!
    (C) 2008 by Andreas Radinger and Martin Hepp, Bundeswehr University Munich, http://www.unibw.de/ebusiness/

    Warning: The stylesheet is still pretty much alpha.
    No implicit nor explicit warranties for fitness or merchantability are given!

    owl2xhtml is free software: you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License (LPGL)
    as published by the Free Software Foundation, either version 3 of
    the License, or (at your option) any later version

    owl2xhtml is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with owl2xhtml. If not, see <http://www.gnu.org/licenses/>.

Acknowledgements

The stylesheet re-uses, with kind permission, code-snippets from the RDFS/OWL presentation stylesheet (1) by Masahide Kanzaki, and from the OWL2HTML stylesheet (2), by Li Ding. We are very grateful for this kind support.

(1) http://www.kanzaki.com/ns/ns-schema.xsl
(2) available at http://daml.umbc.edu/ontologies/webofbelief/xslt/owl2html.xsl