on the semantics of r2rml and its relationship with the direct mapping juan f. sequeda research in...
TRANSCRIPT
On the Semantics of R2RML and its Relationship with the Direct
MappingJuan F. Sequeda
Research in Bioinformatics and Semantic Web (RiBS) LabDepartment of Computer Science, The University of Texas at Austin
SQL query
Parser
• What are the formal semantics of R2RML?• What is the relationship between R2RML and Direct
Mapping?
Logical Query Plan
Select Logical Query Plan
Optimal Logical Query Plan
Physical Query Plan
Select Physical Query Plan
R2RML Mapping
Parser
Logical Mapping
Select Logical Mapping
Optimal Logical Mapping
Physical Mapping
Select Physical Mapping
• Exploit a well established architecture: query optimization • Organization of query optimization is applicable to
mappings
Example
Methodology
Declarative Language
Logical Perspective
Physical Perspective
Triple(S,"rdf:type”,O) ← SubjectTemplateValueTermMap(SID, T, S),
Class(SID, O)
Triple(S,P,O) ← SubjectMap(TM, SID),
PredicateObjectMap(TM, POID),
SubjectTemplateValueTermMap (SID, T, S),
PredicateConstantValueTermMap(POID, P),
ObjectColumnTermMap(POID, T, O)
Triple(S,P,O) ← SubjectMap(TM, SID),
PredicateObjectMap(TM, POID),
SubjectTemplateValueTermMap (SID, T, S),
PredicateConstantValueTermMap(POID, P),
ReferencingObjectTemplate(POID, T, O)
R2RML
Ptemplate
Pcolumn
Pconstant
Otemplate
Ocolumn
Oconstant
Stemplate
Otemplate
Ocolumn
Oconstant
Ocolumn
Oconstant
Otemplate
Ptemplate
Pcolumn
Pconstant
Otemplate
Ocolumn
Oconstant
Sconstant
Otemplate
Ocolumn
Oconstant
Ocolumn
Oconstant
Otemplate
Ptemplate
Pcolumn
Pconstant
Otemplate
Ocolumn
Oconstant
Scolumn
Otemplate
Ocolumn
Oconstant
Ocolumn
Oconstant
Otemplate
Theorem: The total number of distinct Datalog rules which can be used to generate RDF triples is 57Proof: 3 rules to generate Table triples, 27 rules to generate Local triples and 27 rules to generate Reference triples.
• Direct Mapping is the default and automatic approach of generating RDF and OWL from a Relational Database
• Semantics formalized in Datalog (see WWW2012 paper)
Hypothesis: R2RMLcore is as expressive as theDirect Mapping if views are allowed as input
Relationship between R2RML and Direct Mapping R2RMLcore
Table Triples
Local Triples
References Triples
Problem Statementempno ename dept1 Bob 1002 Alice 200
deptno dname
100 CS
200 EE
<emp/1> rdf:type ex:Employee.<emp/1> ex:name “Bob”.<emp/1> ex:name <dept/100>.<emp/2> rdf:type ex:Employee.<emp/2> ex:name “Alice”.<emp/2> ex:name <dept/200>.
<dept/100> rdf:type ex:Department.<dept/100> ex:deptName “CS”.<dept/200> rdf:type ex:Department.<dept/200> ex:deptName “EE”.
<#TriplesMap1> rr:logicalTable [ rr:tableName "emp" ]; rr:subjectMap [ rr:template "http://ex.com/emp/{empno}"; rr:class ex:Employee; ]; rr:predicateObjectMap [ rr:predicate ex:name; rr:objectMap [ rr:column "ename" ]; ]; rr:predicateObjectMap [ rr:predicate ex:department; rr:objectMap [ rr:parentTriplesMap <#TriplesMap2>; rr:joinCondition [ rr:child "dept"; rr:parent "deptno"; ]; ]; ].
<#TriplesMap2> rr:logicalTable [ rr:tableName "dept" ]; rr:subjectMap [ rr:template "http://ex.com/dept/{deptno}"; rr:class ex:Department; ]; rr:predicateObjectMap [ rr:predicate ex:deptName; rr:objectMap [ rr:column ”dname" ]; ].
What does this actually mean?
Understanding these questions can help support users and build tools.
Three types of triples: Table, Local and Reference RDF Term (S, P, O) can be generated from a Template, Constant or Column
W3C Recommendations to map Relational Databases to RDF are R2RML (customizable mapping language) and Direct Mapping (default automatic mapping) are the
5e4d76