D2R Server

D2R Server is a tool for publishing relational databases on the Semantic Web.

It enables RDF and HTML browsers to navigate the content of the database, and allows applications to query the database using the SPARQL query language.

Category:
Website:
Author(s):
Chris Bizer, Richard Cyganiak 
Contact Email:
richard@cyganiak.de 
License:
User Interface:
Command Line 
Programming Language(s):
Java 
Online Manual:
Mailing List:

Documentation

D2R Server is a tool for publishing the content of relational databases on the Web as Linked Data. D2R Server uses a customizable D2RQ mapping to map database content into. The D2RQ mapping language is a declarative language for describing the relation between a relational database schemata and RDFS vocabularies or OWL ontologies. A D2RQ map is an RDF document.

In order to run D2R Server you will need:

  • Java 1.4 or newer on the path.
  • A supported database. D2R Server works with Oracle, MySQL, PostgreSQL, Microsoft SQL Server, and any SQL-92 compatible database. Microsoft Access can be used with some restrictions. More information is available in the D2RQ manual.
  • A modern browser like Firefox, Opera or Safari for using D2R Server's AJAX SPARQL Explorer. Internet Explorer can only browse the HTML pages, but not use the SPARQL Explorer.
  • Optionally, a J2EE servlet container as a deployment target. D2R Server can be run either as a stand-alone web server or inside an existing servlet container.

What to do:

  1. Download and extract the latest D2R Server version into a suitable location.
  2. Download a JDBC driver from your database vendor. Place the driver's JAR file into D2R Server's /lib directory. Also take note of the driver class name (e.g. org.postgresql.Driver for PostgreSQL or oracle.jdbc.driver.OracleDriver for Oracle) and JDBC URL pattern (e.g. jdbc:mysql://servername/database for MySQL) from the driver's documentation. Drivers for MySQL and PostgreSQL are already included with D2R Server.
  3. Generate a mapping file for your database schema. Mappings are to be defined by D2RQ Mapping Language. Change into the D2R Server directory and run:
    generate-mapping -o mapping.n3 -d driver.class.name
    -u db-user -p db-password jdbc:url:...
    mapping.n3 is the name for the new mapping file. -d can be skipped for MySQL.
  4. Start the server:
    d2r-server mapping.n3
  5. Test the Server: Open http://localhost:2020/ in a web browser. Replace 2020 by the port you specified in your mapping file.

You can browse the database content or use the SPARQL Explorer to execute queries and display results in a number of formats.