Christian Bizer

Andy Seaborne
Hewlett-Packard Labs
Bristol, United Kingdom
andy.seaborne@hp.com

Freie Universität Berlin
Berlin, Germany
chris@bizer.deD2RQ
Treating Non-RDF Databases as Virtual RDF Graphs
It will be crucial for many real-world Semantic Web applications to be able to access thecontent of non-RDF relational databases, used by most legacy systems, without having
to replicate the whole database into RDF. This poster presents D2RQ, a declarative
language to describe mappings between application-specific relational database
schemata and RDF-S/OWL ontologies. Using D2RQ, Semantic Web applications can:! query a non-RDF database using theRDQL query language! publish the content of a non-RDF database on the Semantic Web using theRDF Net API! access information in a non-RDF databaseusing the Jena model API! do RDFS and OWL inferencing over thecontent of a non-RDF database using theJena ontology APIArchitecture
D2RQ is implemented as a Jena graph, the basic
information representation object within the Jena
Semantic Web framework. A D2RQ graph wraps
one or more local relational databases into a virtual, read-only RDF graph. D2RQ rewrites RDQL
queries and Jena API calls into applicationdatamodel-specific SQL queries. The result sets ofthese SQL queries are transformed into RDF triples
which are passed up to the higher layers of theJena framework.

Legacy System

RDF
Application
Jena extended
with D2RQ Graph

query +
updatequery
Non-RDF
Database

Non-RDF
Application

RDF
Net API
uses
D2RQ
Map

ExampleStructure of the D2RQ Map

RDQL Query
SELECT ?x
WHERE (<http://www.papers.org/3465>,ex:author, ?x)

SQL Query
SELECT Persons.EmailFROM PersonPaper, PersonsWHERE PersonPaper.PersonID =Persons.PersonID
AND PersonPaper.PaperID = 3465;

ex:title

DatatypePropertyBridge

ex:abstract

DatatypePropertyBridge

ex:author

ObjectPropertyBridge

ex:typeowl:sameAs

Part of the D2RQ Map in N3

ClassMap db1:Paper

db1:Database1

ObjectPropertyBridge

Databaes Tables
Persons
Name

PersonID
1
2

Andy Seaborne
Christian Bizer

ObjectPropertyBridge

PapersPaperID
Title
D2RQ-Treating Non RDF Databases as Virtual RDF Graphs
3465
The Impact of Semantic Web Technologies on Job Recr.
5728

PersonPaperPaperID
3465
3465
5728

ClassMap db1:Person

Emailandy.seaborne@hp.com
chris@bizer.de

PersonID212

ex:name

DatatypePropertyBridge

ex:eMailObjectPropertyBridge

ex:Paper rdf:type rdfs:Class ;d2rq:classMap db1:Paper .
db1:Paper rdf:type d2rq:ClassMap ;d2rq:uriPattern"http://www.papers.org/@@Papers.PaperID@@";
d2rq:dataStorage db1:Database1 .
ex:author rdf:type rdf:Property ;d2rq:propertyBridge db1:author .
db1:author rdf:typed2rq:ObjectPropertyBridge;
d2rq:belongsToClassMap db1:Paper ;d2rq:refersToClassMap db1:Person ;d2rq:join "Papers.PaperID =PersonPaper.PaperID" ;d2rq:join "PersonPaper.PersonID =Persons.PersonID" .
ex:Person rdf:type rdfs:Class ;d2rq:classMap db1:Person .
db1:Person rdf:type d2rq:ClassMap ;d2rq:uriPattern"mailto:@@Person.Email@@";d2rq:dataStorage db1:Database1 .

Benchmark Results
We performed a series of benchmarks comparing
the performance of D2RQ to the performance of theJena2 database backend. As benchmarking dataset
we used the descriptions of 200,000 papers fromthe DBLP Computer Science Bibliography. The data
was stored using both an application-specific relational data model and the Jena database backend(1.6M triples).

Jena2 DBD2RQ

1. find (s ? ?)1.83 ms

0.01 ms

2. find (? p o)

1.94 ms

0.97 ms

3. find (? p ?)42431 ms

72 ms

4. find (? ? o)

1.72 ms

3.23 ms

Further information about D2RQ can be found at: http://www.wiwiss.fu-berlin.de/suhl/bizer/d2rq
D2RQ can be downloaded from: http://sourceforge.net/projects/d2rq-map