9
Chris Bizer: D2R and Named Graphs D2R-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

D2R-Q

  • Upload
    dimaia

  • View
    23

  • Download
    0

Embed Size (px)

DESCRIPTION

D2R-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 - PowerPoint PPT Presentation

Citation preview

Page 1: D2R-Q

Chris Bizer: D2R and Named Graphs

D2R-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

Page 2: D2R-Q

Chris Bizer: D2R and Named Graphs

D2R-Q Architecture

App-specificdatabase

Non-RDFApp

Query +UpdateJena extended

with D2R-Q Graph

RDFApp

Joseki

Query

D2R-Q MAP

Uses

Page 3: D2R-Q

Chris Bizer: D2R and Named Graphs

Structure of a D2R-Q MAP

iswc:name DtPropertyBridge

Datasource 1

ClassMap:PersonObjPropertyBridge

ObjPropertyBridge

iswc:email

rdf:type

owl:sameAs

iswc:authorOf

uriPattern

ObjPropertyBridge

ClassMap:PaperDtPropertyBridge

DtPropertyBridgeuriPattern

ObjPropertyBridge

iswc:title

iswc:abstract

iswc:topName DtPropertyBridge

ClassMap:TopicDtPropertyBridgeiswc:topDescr.

rdf:typeuriPattern

Datasource 2

iswc:Person

iswc:Topic

iswc:Paper

Page 4: D2R-Q

Chris Bizer: D2R and Named Graphs

Example

:InProceedings rdf:type rdfs:Class ; d2r:classMap db1:InProceedings .db1:InProceedings rdf:type d2r:ClassMap; d2r:uriPattern "http://www.example.org/ db01#Paper@@Papers.PaperID@@"; d2r:dataStorage db1:Database1 .:title rdf:type rdf:Property ; d2r:propertyBridge db1:inProceedingsTitle .db1:inProceedingsTitle rdf:type d2r:DatatypePropertyBridge ; d2r:column "Papers.Title" ; d2r:belongsToClassMap db1:InProceedings ; d2r:dataType dtype:string .:author rdf:type rdf:Property ; d2r:propertyBridge db1:inProceedingsAuthor .db1:inProceedingsAuthor rdf:type d2r:ObjectPropertyBridge ; d2r:join "Papers.PaperID = Rel_Person_Paper.PaperID" ; d2r:join "Rel_Person_Paper.PaperID = Persons.PerID" ; d2r:belongsToClassMap db1:InProceedings; d2r:refersToClassMap db1:PersonsClassGroupMap .

Part of a map about authors, papers and conferences:

Page 5: D2R-Q

Chris Bizer: D2R and Named Graphs

Example Query find(s p o)

Find (ANY, iswc:title, “RDF in XML“)

Algorithm Look at Predicate

Find ClassMaps

Get ColumnNames

Get Tables

Execute SQL

Return results

SQL

:InProceedings rdf:type rdfs:Class ;d2r:classMap db1:InProceedings .

db1:InProceedings rdf:type d2r:ClassMap; d2r:uriPattern "http://www.example.org/ db01#Paper@@Papers.PaperID@@"; d2r:dataStorage db1:Database1 .

:title rdf:type rdf:Property ; d2r:propertyBridge db1:inProceedingsTitle .

db1:inProceedingsTitle rdf:type d2r:DatatypePropertyBridge ; d2r:column "Papers.Title" ; d2r:belongsToClassMap db1:InProceedings ; d2r:dataType dtype:string.

SELECT Papers.PaperIDFROM PapersWHERE Papers.Title = “RDF in XML”;

Page 6: D2R-Q

Chris Bizer: D2R and Named Graphs

Example Query find(s p o) with a Many-to-Many Join

Find(ANY, iswc:author, http//:www.persons.org#P1234)

Algorithm Look at Predicate

Find ClassMaps

Find ReferedMaps

Get ColumnNames

Get Tables

Execute SQL

SQL

:author rdf:type rdf:Property ; d2r:propertyBridge db1:inProceedingsAuthor .

db1:inProceedingsAuthor rdf:type d2r:ObjectPropertyBridge ; d2r:join "Papers.PaperID = Rel_Person_Paper.PaperID" ; d2r:join "Rel_Person_Paper.PaperID = Persons.PerID" ; d2r:belongsToClassMap db1:InProceedings; d2r:refersToClassMap db1:PersonsClassMap .

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;

Page 7: D2R-Q

Chris Bizer: D2R and Named Graphs

Query 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.

Page 8: D2R-Q

Chris Bizer: D2R and Named Graphs

Pattern 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 iswc:eventTitle "TheConference") (?y iswc:conference ?x) (?y iswc:author ?z)

Page 9: D2R-Q

Chris Bizer: D2R and Named Graphs

D2R-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.