W3C home > Mailing lists > Public > www-rdf-interest@w3.org > June 2004

Re: XSLT for literal mapping/conversion

From: Damian Steer <damian.steer@hp.com>
Date: Sat, 5 Jun 2004 12:15:38 +0100
Message-Id: <AC706761-B6E1-11D8-A928-003065B0C95E@hp.com>
Cc: www-rdf-interest@w3.org
To: danny666@virgilio.it

On 4 Jun 2004, at 19:33, Danny Ayers wrote:

> Jeremy Carroll wrote:
>> The hardest bit I see is the "such-and-such": I think TriX would make 
>> it easier. RDF/XML has too much variability.
> Yep, definitely a snag there. XSLT seems such a tidy little mechanism, 
> I was hoping it might work for something like this that's kind-of on 
> the surface. But the idea doesn't seem anything like as convincing 
> when the statements are expressed as n3.

Don't give up :-) Here's an idea:

1) As I said before, use xpath expressions. What I mean is not 'use 
paths' but use the xpath functions for calculations, string munging 
etc. In XPath 2.0 you also get strong typing and xsd - sounds like a 
good thing for your application.

2) Generate xslt for the transform. If your schema relates two classes 
using the xpath expression that should be straightforward. The 
variability of RDF/XML isn't too bad here, just use template 
match="<class> or rdf:type/@rdf:resource='class'". Might get stickier 
if you want to do what I suggested, i.e. creating date nodes (as Jeremy 

3) n3. If you're using xpath functions rather than xslt this, again, 
might no be too hard. Xpath libraries exist for most languages, so use 
an rdf library and evaluate the xpath expression. Perhaps xpath 
function support could be plugged into cwm?

One interesting use case I should mention is relating foaf:mbox and 
foaf:mbox_sha1sum. That's slightly different - properties rather than 
classes - but a very similar problem. I think there are a couple of 
xpath extension functions for md5 floating around.

> Thanks guys, I'll ponder.

Good luck.

> Cheers,
> Danny.

Received on Saturday, 5 June 2004 07:21:55 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:07:51 UTC