Roberto De
Virgilio

affiliated

Antonio
Maccioni

aff
ili

ate
d

Riccardo
Torlone

topic

topic

ia
ffil
a

t ed

author

author

or
auth

Converting Relational to Graph Databases

In

g
din
e
ce
o
pr

GRADES 2013

23 June 2013

when
where

New York, USA

affiliated workshop

where
Relational Database Migration

SQL

select *
from T
where T.A1 = v1

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
R2G: Features
●

Data migration

●

Query translation

●

●

Automatic non-naïve
approach
Try to minimize the
memory accesses

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Graph Modeling of Relational DB

●

Full Schema Paths:
FR.fuser → US.uid → US.uname
FR.fuser → FR.fblog → BG.bid → BG.bname
FR.fuser → FR.fblog → BG.bid → BG.admin → US.uid → US.uname
...

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Basic Concepts
•

Joinable tuples t1 ∈ R1 and t2 ∈ R2:
●

•

there is a foreign key constraint between R1.A and R2.B
and t1[A] = t2[B].

Unifiability of data values t1[A] and t2[B]:
●

●

●

(i) t1=t2 and both A and B do not belong to a multiattribute key;
(ii) t1 and t2 are joinable and A belongs to a multiattribute key;
(iii) t1 and t2 are joinable, A and B do not belong to a
multi-attribute key and there is no other tuple t 3 that is
joinable with t2.

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Data Migration (1)
●

Identify unifiable data exploiting schema
and constraints
FR.fuser

US.uid

US.uname

n1

FR.fuser : u01

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Data Migration (2)
●

Identify unifiable data exploiting schema
and constraints
FR.fuser

US.uid

US.uname

n1
FR.fuser : u01
US.uid : u01

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Data Migration (3)
●

Identify unifiable data exploiting schema
and constraints
FR.fuser

US.uid

US.uname

n1
FR.fuser : u01
US.uid : u01
US.uname : Date

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Data Migration (4)
●

Identify unifiable data exploiting schema
and constraints

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Query Translation

Gremlin

GRADES 2013

Converting Relational to Graph Databases

XQuery

New York, 23-06-2013
Experimental Results

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Conclusion
•

Automatic data mapping

•

Conjunctive query translation into a
path traversal query

•

Independent of a specific GDBMS

•

Efficient exploitation of Graph Database
Features

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Future Work
•

Consider frequent queries to migrate
data

•

Consider wider range of queries than CQ

•

Improve compactness of the graph
database

GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013
Thanks For The Attention

... demo presentation during the
following interactive session!
GRADES 2013

Converting Relational to Graph Databases

New York, 23-06-2013

Converting Relational to Graph Databases

  • 1.
    Roberto De Virgilio affiliated Antonio Maccioni aff ili ate d Riccardo Torlone topic topic ia ffil a t ed author author or auth ConvertingRelational to Graph Databases In g din e ce o pr GRADES 2013 23 June 2013 when where New York, USA affiliated workshop where
  • 2.
    Relational Database Migration SQL select* from T where T.A1 = v1 GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 3.
    R2G: Features ● Data migration ● Querytranslation ● ● Automatic non-naïve approach Try to minimize the memory accesses GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 4.
    Graph Modeling ofRelational DB ● Full Schema Paths: FR.fuser → US.uid → US.uname FR.fuser → FR.fblog → BG.bid → BG.bname FR.fuser → FR.fblog → BG.bid → BG.admin → US.uid → US.uname ... GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 5.
    Basic Concepts • Joinable tuplest1 ∈ R1 and t2 ∈ R2: ● • there is a foreign key constraint between R1.A and R2.B and t1[A] = t2[B]. Unifiability of data values t1[A] and t2[B]: ● ● ● (i) t1=t2 and both A and B do not belong to a multiattribute key; (ii) t1 and t2 are joinable and A belongs to a multiattribute key; (iii) t1 and t2 are joinable, A and B do not belong to a multi-attribute key and there is no other tuple t 3 that is joinable with t2. GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 6.
    Data Migration (1) ● Identifyunifiable data exploiting schema and constraints FR.fuser US.uid US.uname n1 FR.fuser : u01 GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 7.
    Data Migration (2) ● Identifyunifiable data exploiting schema and constraints FR.fuser US.uid US.uname n1 FR.fuser : u01 US.uid : u01 GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 8.
    Data Migration (3) ● Identifyunifiable data exploiting schema and constraints FR.fuser US.uid US.uname n1 FR.fuser : u01 US.uid : u01 US.uname : Date GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 9.
    Data Migration (4) ● Identifyunifiable data exploiting schema and constraints GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 10.
    Query Translation Gremlin GRADES 2013 ConvertingRelational to Graph Databases XQuery New York, 23-06-2013
  • 11.
    Experimental Results GRADES 2013 ConvertingRelational to Graph Databases New York, 23-06-2013
  • 12.
    Conclusion • Automatic data mapping • Conjunctivequery translation into a path traversal query • Independent of a specific GDBMS • Efficient exploitation of Graph Database Features GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 13.
    Future Work • Consider frequentqueries to migrate data • Consider wider range of queries than CQ • Improve compactness of the graph database GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013
  • 14.
    Thanks For TheAttention ... demo presentation during the following interactive session! GRADES 2013 Converting Relational to Graph Databases New York, 23-06-2013