Title: D2R-Q
1D2R-Q
- Work together with Andy, Chris and Kevin
- Goal Query huge, live, non-RDF data bases with
RDQL - Allow access to existing databases
- Allow a more efficient storage of application
specific RDF data - Approach
- Develop a declarative mapping language, that
allows to - rewrite RDQL and find(spo) queries to application
specific SQL queries. - Redesign my D2R MAP language
- Implement it as a Jena graph
2D2R-Q Architecture
RDFApp
Query Update
Query
App-specificdatabase
Jena extended with D2R-Q Graph
Non-RDFApp
Joseki
Uses
D2R-Q MAP
3Structure of a D2R-Q MAP
4Example
- Part of a map about authors, papers and
conferences
InProceedings rdftype rdfsClass
d2rclassMap db1InProceedings . db1InProceedings
rdftype d2rClassMap d2ruriPattern
"http//www.example.org/ db01Paper_at__at_Papers.PaperI
D_at__at_" d2rdataStorage db1Database1
. title rdftype rdfProperty
d2rpropertyBridge db1inProceedingsTitle
. db1inProceedingsTitle rdftype
d2rDatatypePropertyBridge
d2rcolumn "Papers.Title"
d2rbelongsToClassMap db1InProceedings
d2rdataType dtypestring
. author rdftype rdfProperty
d2rpropertyBridge db1inProceedingsAuthor
. db1inProceedingsAuthor rdftype
d2rObjectPropertyBridge d2rjoin
"Papers.PaperID Rel_Person_Paper.PaperID"
d2rjoin "Rel_Person_Paper.PaperID
Persons.PerID" d2rbelongsToClassM
ap db1InProceedings
d2rrefersToClassMap db1PersonsClassGroupMap
.
5Example Query find(s p o)
- Find (ANY, iswctitle, RDF in XML)
- Algorithm
- Look at Predicate
- Find ClassMaps
- Get ColumnNames
- Get Tables
- Execute SQL
- Return results
- SQL
InProceedings rdftype rdfsClass d2rclassMap
db1InProceedings . db1InProceedings rdftype
d2rClassMap d2ruriPattern
"http//www.example.org/ db01Paper_at__at_Papers.PaperI
D_at__at_" d2rdataStorage db1Database1 . title
rdftype rdfProperty d2rpropertyBridge
db1inProceedingsTitle . db1inProceedingsTitle
rdftype d2rDatatypePropertyBridge
d2rcolumn "Papers.Title"
d2rbelongsToClassMap db1InProceedings
d2rdataType dtypestring.
SELECT Papers.PaperIDFROM PapersWHERE
Papers.Title RDF in XML
6Example Query find(s p o) with a Many-to-Many Join
- Find(ANY, iswcauthor, http//www.persons.orgP123
4) - Algorithm
- Look at Predicate
- Find ClassMaps
- Find ReferedMaps
- Get ColumnNames
- Get Tables
- Execute SQL
- SQL
author rdftype rdfProperty
d2rpropertyBridge db1inProceedingsAuthor
. db1inProceedingsAuthor rdftype
d2rObjectPropertyBridge d2rjoin
"Papers.PaperID Rel_Person_Paper.PaperID"
d2rjoin "Rel_Person_Paper.PaperID
Persons.PerID" d2rbelongsToClassMap
db1InProceedings d2rrefersToClassMap
db1PersonsClassMap .
SELECT Papers.PaperIDFROM Papers, Persons,
Rel_Person_Paper WHERE Papers.PaperID
Rel_Person_Paper.PaperID AND
Rel_Person_Paper.PaperID Persons.PerID
AND Persons. PersonID 1234
7Query Performance find(s p o)
- find (?x p o) OK (I guess)
- find (?x p ?z) OK
- find (s p ?z) OK
- find (s p o) OK
- find (s ?x ?y) slow
- find (?x ?y o) very slow
- find (?x ?y ?z) db dump
- ? Use Pattern groups, because they contain more
usable information.
8Pattern Groups
- Second step Use Pattern groups because they
contain more information useable for query
optimization. - WHERE part of a RDQL query
- Find all author with papers at "TheConference"
- results in one SQL statement.
(?x iswceventTitle "TheConference") (?y
iswcconference ?x) (?y iswcauthor ?z)
9D2R-Q Status Quo
- Language designed
- Algorithms designed
- Paper tests with two relatively complex
ontologies and database schemata (including
taxonomies and many-to-many relationships). - Implementation started
- D2RQGraph implements Jena Graph
- D2RQQueryHandler implements Jena QueryHandler.
- D2R-Q will be available under an open source
license sometime in May.