24
MIRROR: Automatic R2RML Mapping Generation from Relational Databases Luciano Frontino de Medeiros Freddy Priyatna Oscar Corcho The 15th International Conference on Web Engineering June 25th, 2015 Rotterdam, the Netherlands

(Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

Embed Size (px)

Citation preview

Page 1: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 2: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

Outline1.Background & Motivation2.Patterns Extraction3.Mappings Generation4.Experimentation5.Conclusion

2

Page 3: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 4: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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/

Page 5: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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>

Page 6: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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/

Page 7: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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}" ]; ].

Page 8: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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>

Page 9: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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>

Page 10: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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>

Page 11: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 12: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

MIRROR: Overview1.Extraction of tables and its relationship2.Mappings generation

12

Freddy Priyatna
Should it be "1. Extraction of relationships from tables"?
Page 13: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Freddy Priyatna
I don't really understand how to present this part.
Page 14: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

Correspondences between models

14

Page 15: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

Mappings Generation

15

Page 16: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 17: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

D011 Extension● 1-N

o Student - Contact● IsA

o Student - Person

17

Page 18: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

D011: Generated Mappings1st Set -> DM Triples

18

Page 19: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

D011 Outputs

DM19

MIRROR + morph-RDB

Page 20: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 21: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 22: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 23: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

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

Page 24: (Semantic Web Technologies and Applications track) "MIRROR: Automatic R2RML Mapping Generation from Relational Databases" - Luciano Frontino De Medeiros, Freddy Priyatna and Oscar

MIRROR: Automatic R2RML Mapping Generation from

Relational Databases

Luciano Frontino de Medeiros

Freddy Priyatna Oscar Corcho