Tripliser
Tripliser is a Java library and command-line tool for creating triple graphs from XML. It is particularly suitable for data exhibiting any of the following characteristics:
- Messy - missing data, badly formatted data, changeable structure)
- Bulky - large volumes
- Volatile - ongoing changes to data and structure, e.g. feeds
It is designed as an alternative to XSLT conversion, providing the following advantages:
- Easy-to-read mapping format - concisely describing each mapping
- Robust - error or partial failure tolerant
- Detailed reporting - comprehensive feedback on the successes and failures of the conversion process
- Extensible - custom functions, flexible API
- Efficient - facilities for processing data in large volumes with minimal memory usage
As an introductory explanation of how tripliser works, here is a practical example.
Quick start
requires Java 1.6wget https://github.com/downloads/daverog/tripliser/tripliser-1.0-jar-with-dependencies.jar wget https://github.com/daverog/tripliser/raw/master/src/main/sh/triplise chmod u=r+x triplise ./triplise [input] [mapping]
To run a quick example, using the code shown in the example, run the following:
wget -O universe-mapping.xml https://github.com/daverog/tripliser/raw/master/src/test/resources/examples/mappings/universe.xml wget https://github.com/daverog/tripliser/raw/master/src/test/resources/examples/source/universe.xml ./triplise universe.xml universe-mapping.xml cat universe.xml.rdf
Example
Premise
You have an XML file containing data, which you wish to express in RDF:
Source XML file (universe.xml)
Solution
The following mapping file is created to convert the data. (Do not worry about every detail, as this example is used elsewhere in the documentation where each part is explained).
Mapping file (universe-mapping.xml)
The following command is run:
triplise universe.xml universe-mapping.xml
This produces the following RDF file:
RDF output (universe.xml.rdf)
That's all there is to it.
In Java
To do the same as above, but in Java, you'll need to run the following code:
Credits
Tripliser was designed and developed by David Rogers with assistance from Rija Menage.
d dot p dot rogers at gmail dot com
Copyright (C) 2010, 2011 by David Rogers