(semantic web technologies and applications track) "mirror: automatic r2rml mapping generation...
TRANSCRIPT
MIRROR: Automatic R2RML Mapping Generation from
Relational Databases
Luciano Frontino de Medeiros
Freddy Priyatna Oscar Corcho
The 15th International Conference on Web EngineeringJune 25th, 2015Rotterdam, the Netherlands
Outline1.Background & Motivation2.Patterns Extraction3.Mappings Generation4.Experimentation5.Conclusion
2
RDB2RDF
3
● Two worldso Relational Database (RDB) for storing
information rows, tables
o Resource Description Framework (RDF) for sharing information triples, graphs
● RDB2RDF and W3C
Direct Mapping● Table URIs
o <ex.com/Student>
● Row nodeso <Student/ID=10>
● Row type tripleso <Student/ID=10> <rdf:type> Student
● Literal tripleso <Sport/ID=110> <Sport#Description> “Tennis”.
● Reference tripleso <Student_Sport/ID_Student=10;ID_Sport=110> <Student_Sport#ref-ID_Student>
<Student/ID=10> .
4
http://www.w3.org/TR/rdb-direct-mapping/
Direct Mapping ExampleStudent
ID(PK) FirstName LastName
10 Venus Williams
11 Fernando Alonso
12 David Villa
Sport
ID(PK) Description
110 Tennis
111 Football
112 Formula1
Student_Sport
ID_Student(PFK)
ID_Sport(PFK)
10 110
11 111
11 112
12 111
5
<Student/ID=11>
<Student>11
Fernando Alonso
rdf:type
<Student/ID>
<Student/LastName>
<Student/FirstName>
R2RML● Customized mappings● Triples Map
o Logical Tableo Subject Mapo Predicate Object Map
Predicate Map Object Map Reference Object Map
● Term Mapo constanto columno template
6
http://www.w3.org/TR/r2rml/
R2RML ExampleStudent
ID(PK) FirstName LastName
10 Venus Williams
11 Fernando Alonso
12 David Villa
7
<Estudiante/11>
<Estudiante>
Fernando Alonso
rdf:type
ex:fullName
<#TriplesMap1> rr:logicalTable [ rr:tableName "Student" ];
rr:subjectMap [ rr:template "http://data.example.com/Estudiante/{ID}"; rr:class ex:Estudiante; ];
rr:predicateObjectMap [ rr:predicate ex:fullName; rr:objectMap [ rr:template "{FirstName} {LastName}" ]; ].
Background: M-N RelationshipExpected Triples
Student
ID(PK) FirstName LastName
10 Venus Williams
11 Fernando Alonso
12 David Villa
Sport
ID(PK) Description
110 Tennis
111 Football
112 Formula1
Student_Sport
ID_Student(PFK)
ID_Sport(PFK)
10 110
11 111
11 112
12 111
8
<Student/ID=11>
<Sport/ID=111>
<Sport/ID=112>
<Student#hasSport>
<Student#hasSport>
Background: 1-N RelationshipExpected Triples
Student
ID(PK) FirstName LastName
10 Venus Williams
11 Fernando Alonso
12 David Villa
Sport
ID(PK) Description
110 Tennis
111 Football
112 Formula1
Student_Sport
ID_Student(PFK)
ID_Sport(PFK)
10 110
11 111
11 112
12 111
Contact
CID(PK)
SID(FK) Email
1 10 [email protected]
2 10 [email protected]
3 11 [email protected]
4 12 [email protected]
9
<Student/ID=10>
<Contact/ID=2>
<Student#hasContact> <Contact/ID=1>
<Student#hasContact>
Background: IsA RelationshipExpected Triples
Student
ID(PFK) FirstName LastName
10 Venus Williams
11 Fernando Alonso
12 David Villa
Sport
ID(PK) Description
110 Tennis
111 Football
112 Formula1
Student_Sport
ID_Student(PFK)
ID_Sport(PFK)
10 110
11 111
11 112
12 111
Person
ID(PK) SSN
10 1234510
11 1234511
12 1234512
10
<Student/ID=10>
1234510
rdf:type
<Student#SSN>
<Person>
Goal● To automatically generate R2RML
mappings that:o simulate DM ruleso encodes relationship in database
11
PINKEL, Christoph, et al. RODI: A Benchmark for Automatic Mapping Generation in Relational-to-Ontology Data Integration. Extended Semantic Web Conference 2015
MIRROR: Overview1.Extraction of tables and its relationship2.Mappings generation
12
Pruning Relationship Types
1 2 3 4 5 6 7 8
Parent (Mand, 1) (Mand, 1) (Mand, 1) (Mand, 1) (Mand, N) (Mand, N) (Mand, N) (Mand, N)
Child (Mand, 1) (Mand, N) (Opt,1) (Opt, N) (Mand, 1) (Mand, N) (Opt,1) (Opt, N)
9 10 11 12 13 14 15 16
Parent (Opt, 1) (Opt, 1) (Opt, 1) (Opt, 1) (Opt, N) (Opt, N) (Opt, N) (Opt, N)
Child (Mand, 1) (Mand, N) (Opt,1) (Opt, N) (Mand, 1) (Mand, N) (Opt,1) (Opt, N)
Reflexive Property● 2 = 5● 3 = 9● 4 = 13● 7 = 10● 8 = 14● 12 = 15
13
Primary key is not null and unique
Correspondences between models
14
Mappings Generation
15
Implementation & Experimentation● Implementation
o https://github.com/oeg-upm/MIRRORo morph-RDB integration
https://github.com/oeg-upm/morph-rdbo Any R2RML engine
● Goalo 1st set mappings -> DM tripleso 2nd mappings -> relationship triples
● Dataseto W3C DM Testcases
26 databases (D000 - D025)o Extension of D011
1-N M-N relationship ISA relationship 16
D011 Extension● 1-N
o Student - Contact● IsA
o Student - Person
17
D011: Generated Mappings1st Set -> DM Triples
18
D011 Outputs
DM19
MIRROR + morph-RDB
D011: Generated Mappings2nd Set -> M-N Relationship
20
<Sport/110> <SportHasStudent> <Student/10> .<Sport/111> <SportHasStudent> <Student/11> .<Sport/111> <SportHasStudent> <Student/12> .<Sport/112> <SportHasStudent> <Student/11> .
D011 Extension: Generated Mappings2nd Set -> 1-N Relationship
<Student/10> <StudenthasContact> <Contact/1> .<Student/10> <StudenthasContact> <Contact/2> .<Student/11> <StudenthasContact> <Contact/3> .<Student/12> <StudenthasContact> <Contact/4> .
21
D011 Extension: Generated Mappings2nd Set -> IsA & inherited properties
<Student/10> <rdf:type> <Person> . <Student/10> <Student#ssn> 1234510 .
<Student/11> <rdf:type> <Person> . <Student/11> <Student#ssn> 1234511 .
<Student/12> <rdf:type> <Person> . <Student/12> <Student#ssn> 1234512 . 22
Conclusion● R2RML Mappings Generator
o Implemented as MIRRORo Integrated with morph-RDB
● 2 Sets of Generated Mappingso Direct Mapping Tripleso Encoded Relationship in a Database Schema
● Evaluationo Direct Mapping Test Caseso Extension of D011
23
MIRROR: Automatic R2RML Mapping Generation from
Relational Databases
Luciano Frontino de Medeiros
Freddy Priyatna Oscar Corcho