[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Proof-of-concept RDF mapping for Atom
I've put together an XSLT stylesheet to map Atom to RDF/XML. It is
just as a proof of concept to see if it is possible. I think it
handles everything except for xml:lang - I'm not sure what's happening
with xml:lang at the moment - but it should be possible to add it in a
similar way to xml:base.
I don't think using an XSLT processor followed by an RDF/XML parser
would be much fun in practise - a SAX based convertor would be much
The RDF vocabulary was just constructed ad-hoc - like I said, it is
just a proof of concept. It uses a separate namespace to Atom and
defines some new terms, which solves any problems with non-unique
Here are the main features:
* Implements draft-04 with PaceExtensionConstruct. Doesn't handle
xml:lang at the moment, because I think we need to clarify that a bit.
* Preserves Structured Extension Constructs as XML Literals, for
* Preserves xml:base context for Text, Content, and Structured Extension
* Handles author defaulting.
* Resolves URI references using xml:base
There are some more comments at the top of the file.
You need <http://djpowell.net/tmp/atom2rdf.zip> - which contains:
atom2rdf.xsl - the transform
urires.xsl - URIRef resolver used by the transformer
example.xml - an example feed
You can run the transform using Xalan
java -jar xalan.jar -IN example.xml -XSL atom2rdf.xsl -OUT rdf.xml
Part of the implementation is an XSLT based URIRef resolver - you can
try that here in your browser: <http://djpowell.net/tmp/uritest.xml>