r2rml-kit is an implementation of W3C's R2RML and Direct Mapping standards. It can:
- Generate an R2RML mapping by inspecting a relational database schema
- Validate R2RML mapping files
- Dump the contents of a database to an RDF file according to an R2RML mapping
- Dump the contents of a database to an RDF file according to the W3C Direct Mapping
- Access the contents of a database through the Jena API
Besides R2RML, r2rml-kit also supports the D2RQ mapping language.
r2rml-kit is an offshoot of D2RQ, based on its abandoned develop
branch. Unlike D2RQ, it does not support SPARQL, and does not include a server application equivalent to D2RQ's D2R Server.
r2rml-kit is currently in pre-alpha stage. It is not yet fully separated from the D2RQ codebase, and many things will not yet work. It does not support R2RML's named graph features. See TODO.md
for a short-term roadmap.
After building with mvn compile
, you can test-run the various components. Let's assume you have a MySQL database called mydb
on your machine.
./generate-mapping -u root -o mydb.ttl jdbc:mysql:///mydb
This generates a mapping file mydb.ttl
for your database.
./validate mydb.ttl
This validates the mapping file mydb.ttl
.
./dump-rdf -m mydb.ttl -o dump.nt
This creates dump.nt
, a dump containing the mapped RDF in N-Triples format.
The unit tests can be executed with mvn test
.
Some unit tests rely on MySQL being present, and require that two databases are created:
-
A database called
iswc
that contains the data fromsrc/test/resources/example/iswc-mysql.sql
:echo "CREATE DATABASE iswc" | mysql -u root mysql -u root iswc < src/test/resources/example/iswc-mysql.sql
-
An empty database called
D2RQ_TEST
.