Mindswap Weblog

SPARQL and XSLT

by Ron Alford

In my quest to learn XSLT (it didn’t work), I wrote two generic XSLT scripts to transform SPARQL results into HTML.

The table xslt is dead simple - it just translates the results into a table format, with the order of the query variables dictating the columns of the head.

The list xslt was developed with the help of Ian Davis. This version takes the first variable as a kind of key, and the rest of the variables as properties off that identifier. I think I spent about two days trying to make this run in under eight minutes, and a couple of key changes brought it down to well under a second.

It’s not bad for a quick view of the sparql results, but it isn’t exactly pretty. It does make a nice starting point for more customized xslt.

Leave a Reply

MINDSWAP is a W3C member