xspf2rdfxml.xsl@en

I needed a virginish GRDDL transformation for a test case, and Lucas Gonze's mention of XSPF resolvers got me curious around there, so I've made a first pass at a converter from XSPF to the new Music Ontology: xspf2rdfxml.xsl, sample source, sample result. ( Libby had already started such an XSLT for a demo/test, but with a different result vocab).

Ran into one syntax problem, what to do with things like:

<track>

...

<meta rel="http://purl.org/stuff/brol">http://example.org/prout</meta>

</track>


I'm probably missing something obvious, but all I can think of now is maybe a nasty XSLT string hack to produce:

<stuff:brol xmlns:stuff="http://purl.org/stuff/" rdf:resource="http://example.org/prout" />

I'd missed a little something in Lucas's post, in a follow-up he notes that the source data he mentioned isn't XML. I only looked as far as the list of links, assuming they pointed to something moderately machine-processable. Nope. It's lots and lots of fairly inconsistent HTML. If I feel in need of a few day's occupational therapy in the near future I might just fire up emacs/tidy and have a go at cleaning some of it up. If.

But I still think RDF & SPARQL could be a great help in an XSPF resolver. Probably a lot of the service angle (using MusicBrainz or whatever) is already in place, local stuff shouldn't be too hard to accomodate. For example, if a filesystem walker (like that of Aperture) had made an RDF representation of what's on your local drive, SPARQL's regexp filters should be able to match between: " I Wanna Get High" and ../iwannagethigh.mp3

PS. although HTML -xslt-> XSPF -xslt-> RDF would be nice to have, given the nature of the source data above (and the lack of a spec'd microformat for playlists), it seems like it'll be more versatile to generate any microformat stuff from the RDF (e.g. using SPARQL -xslt-> HTML). I guess this might be a good place to insert a LazyWeb call for eRDF/RDFa serialisers (using SPARQL or whatever). 

@en

Danny Ayers
2007-02-20T16:31:16+01:00

Related
Comments
Edit