Last modified 2 years ago Last modified on 12/29/11 16:46:37

Welcome to X2R

This is the wiki of the X2R project. It aims to provide a unified platform for integrating diverse data sources in an RDF store.

Right now X2R can extract data from relational, XML and LDAP databases, transform them to RDF and load the RDF into an RDF database.

We have released the 0.0.3 version of X2R. It is an early pre-alpha release so pretty much everything may change.

You can also use x2r-core in your maven application by adding a following dependency the "<dependencies>" section of your pom.xml file:


You will also need to add our maven repository to the "<repositories>" section of your pom.xml


The library is made available under a BSD-like license, see the LICENSE.txt file for details.

Getting Started

From the user point of view, X2R can be understood as a set of implementations of the DataSourceAdapter (javadoc) interface. Right now there are three of them:

Each of them has a single method:

DumpReport dump(DataSourceConfiguration dataSourceConfiguration,
     String mapping, RepositoryConnection target, URI targetContext);

Basically you pass in the configuration of the data source (a glorified hashmap), the string with the turtle serialization of the mapping file, and the connection to the target repository, where the result RDF triples are to be placed. In return you'll get a report (the DumpReport object) about how well did everything go. The wiki pages about each of the adapters: (LdapAdapter, RelationalDataSourceAdapter and XMLAdapter) contain more information about what constitutes the configuration and the mapping.

Apart from that there is also the StreamingXMLAdapter, which uses the same mapping language as the XMLAdapter, but allows you to convert XML data supplied as an input stream.

The way to use X2R, is:

  1. Download the binary distribution, place the x2r-core-<version>.jar and all the jars from the lib folder on your classpath OR, add a maven dependency as described above.
  2. Create an instance of the required data source adapter (e.g. DataSourceAdapter adapter = new RelationalDataSourceAdapter()
  3. Read the required wiki page: (LdapAdapter, RelationalDataSourceAdapter and XMLAdapter)
  4. Create a proper instance of the DataSourceConfiguration and the mapping String
  5. Make sure that the sesame repository where you want your target data to appear is initialized properly (OR use the X2RJenaWrapper in order to have the data placed in a Jena Model)
  6. Call the dump() method
  7. Enjoy your RDF data