rdftemplate

Rdftemplate is a library for generating XML documents from RDF data using templates.

The library supports evaluation of “selector expressions”, which use an XPath-inspired syntax for selecting an ordered set of nodes from an arbitrary starting context node.

The library also supports rendering XML from templates. The template interpolator recognises a number of Genshi-inspired template directives, which are used to insert the result of a selector expression into the generated XML.

The library uses the Jena RDF model API. It also includes optional support for integrating with Spring, allowing templates to be used as Spring Web MVC views.

Rdftemplate was developed for the Miskin Hill web site, where it is used to generate output in various XML-based formats. You can view the templates used for Miskin Hill to see some examples of how rdftemplate works.

Development

Quick start with Maven

Add the following to your pom.xml:

<repositories>
    <repository>
        <id>code.djc.id.au</id>
        <url>http://code.djc.id.au/maven2/</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>au.id.djc</groupId>
        <artifactId>rdftemplate</artifactId>
        <version>1.4</version>
    </dependency>
</dependencies>

Todo

more examples, like calling TemplateInterpolator or using Spring views