W3C home > Mailing lists > Public > semantic-web@w3.org > September 2005

Re: XSLT and XPath-like functions in RDF/OWL ?

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Date: Mon, 19 Sep 2005 14:39:08 +0100
To: Ian Emmons <iemmons@bbn.com>
Cc: Hans Teijgeler <hans.teijgeler@quicknet.nl>, semantic-web@w3.org
Message-Id: <1127137148.25959.33.camel@kessel>

On Mon, 2005-09-19 at 08:58 -0400, Ian Emmons wrote:
> Hans,
> SPARQL is well along in the standardization process, so that is your 
> clear choice for a query/path language.


> * RDF/OWL --> XML:  I was originally inclined to recommend XSLT for 
> this, but a colleague of mine (Mike Dean) pointed out that XSLT is 
> really a poor choice.  This is because the RDF/XML (which is the 
> serialization of RDF information in XML format) has no canonical 
> representation.  In other words, it supports many ways to say the same 
> thing.  For instance, rdf:ID vs. rdf:about, typed node elements vs. 
> rdf:type, property attributes, rdf:parseType="Resource", and so on.
> If you can tolerate brittle code (i.e., code that is easily broken by 
> external changes), you could use XSLT to translate the output from a 
> specific RDF serialization tool, such as Jena.  But this would 
> definitely break if you switched to some other tool, and it would also 
> be sensitive to anything that perturbed Jena's output, such as upgrading 
> to a new version.

I'd suggest that you use SPARQL for this too.  There's an XML format for
the variable bindings results of SPARQL (which I edit) that allows you
to extract the data you want out of the RDF graph - you don't need to
care about what syntax or system it was stored in.  Then write the
results as XML and transform them to another XML form with your
favourite XML transformer.  This XML format was designed to be regular
to enable this kind of thing to happen.

The draft:
already includes XSLT and XQuery examples of how to do that:
and you can grab some implementations at
and see some demos at
to try it out.

Received on Monday, 19 September 2005 13:38:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 08:44:54 UTC