W3C home > Mailing lists > Public > www-rdf-interest@w3.org > August 2002

RDF Schema transformed into XHTML

From: Dominique HazaŽl-Massieux <dom@w3.org>
Date: 23 Aug 2002 15:06:59 +0200
To: www-rdf-interest@w3.org
Message-Id: <1030108020.10226.124.camel@stratustier>

Hi folks,

I've written a little XSLT that I find convenient to get a human
readable version of an RDF Schema:
http://www.w3.org/2002/06/rdfs2html.xsl [Warning: displaying the XSLT
can crash your mozilla [1]].

First, some examples (using the W3C XSLT servlet):
Applied to: http://www.w3.org/2000/01/rdf-schema#

Applied to http://www.w3.org/2000/10/swap/string#
=> http://www.w3.org/2000/06/webdata/xslt?xmlfile=http %3A%2F%2Fwww.w3.org%2F2000%2F10%2Fswap%2Fstring.rdf&xslfile=http%3A%2F%2Fwww.w3.org%2F2002%2F06%2Frdfs2html.xsl

Applied to http://www.daml.org/2001/03/daml+oil#samePropertyAs

More info:
- what it does
* using some basic knowledge of RDF Schema, it tries to give a human
readable vision of a RDF Schema

- how it works
* it parses the RDF/XML data (the parser is far from being complete).
For any foo:bar that it doesn't know, it tries to read dereference(foo)
and looks for a rdfs:label for bar in it (it assumes that foo is in RDF

- Is it useful?
* well, it has some useful applications:
 - if you're RDF Schema only refers to other RDF schemas, it gives a
human readable version of your schema. In particular, you can use an
<?xml-stylesheet?> PI to make your RDF Schema browser-friendly
  - it allows to detect errors in your schema (for instance, it appears
that http://www.w3.org/2000/10/swap/string# uses non-existing properties
such as http://www.daml.org/2001/03/daml+oil#inverse or
http://www.w3.org/2000/01/rdf-schema#definedBy )
 - it may encourage to make more detailed schemas with rdfs:label and
rdfs:comment to make them nicer

- Is it perfect?
* of course not. Besides bugs that I'm interested to hear about, it
makes many assumptions that are too strong. Especially, it assumes that
all the URIs it gets are in RDF/XML and miserably fails when it gets
something else.
* the RDF parser is very ad-hoc

- Tips and tricks
* you can give a title and a description to your RDF Schema using
<rdf:Description rdf:about="">
  <dc:title>My RDF Schema</dc:title>
  <dc:description>This is my rdf Schema and it is very
and the stylesheet will display it.
Unfortunately, it works only with the empty URI (rdf:about="") since 
the XSLT doesn't have any way to know the URI of the schema itself (I
should probably implement a look up for xml:base, but since it's not
very widely used, I didn't take the time to do it).

* if your schema points to non RDF/XML data, you can get a minimalistic
view of it by adding a parameter "recursive='no'" to the processing
stylesheet. it's much less interesting though.

I hope it can be useful to some of you (I release it now since I'm not
sure it's worth spending more time on it).


1. Mozilla 1.0 crashes when you display the XSLT above twice (reloading,
going back and forth, ...). The bug is fixed in more recent versions. 
Dominique HazaŽl-Massieux - http://www.w3.org/People/Dom/
Received on Friday, 23 August 2002 09:07:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 22:44:37 UTC