Professional Documents
Culture Documents
Graph Databases (GDB) : Adrian Silvescu Doina Caragea Anna Atramentov
Graph Databases (GDB) : Adrian Silvescu Doina Caragea Anna Atramentov
Graph Databases (GDB) : Adrian Silvescu Doina Caragea Anna Atramentov
Adrian Silvescu
Doina Caragea
Anna Atramentov
Problems And Motivations
Information
Exploita tion Informa tion
AVAILABLE
INFORMA TION
IN THE WORLD
INFORMA TION INTEGRATION
Informa tion
Integra tion
• Goals
– Declarativity
– Change
• Design Choice : Have unique instance
identifiers vs. having foreign keys
– Close in Spirit to OO
– Will allow us to cope easier with Change
– Declarativity is an issue in OO, but not for GDB as we
will show
Database Representation
• Sailors(sid:integer, sname:char(10), rating: integer, age:real)
• Boats(bid:integer, bname:char(10), color:char(10))
• Reserve(sid:integer, bid:integer, day:date)
sid sname rating age sid bid day bid bname color
name dustin
IOF ID1
rating 7
IO Sailor
age 45.0
TB F s
L
sid 31
IOF
IOF
name lubbe
IOF ID2 r
Boat
s rating 8
Reserves
IOF IOF age 55.5
IOF ID8
ID6 ID3
…
ID4 ID5 : ID7 :
: :
Foreign Keys 22
sid
name dustin
ID1
rating 7
age 45.0
Sailor
sid 22
day 10/10/96
ID4
bid 101
Boat
bid 101
ID6
bname Interlake
color red
Data Representation in the GDB DDL
Name1 Val
1
Name2 Val
ID 2
……
Name Val
N N
• ID:(Name1=Val1,…,NameN=ValN)
Examples:
ID1:(sid=22, name=“Dustin”, rating=7, age=45.0)
ID4:(sailor=ID1, day=“10/10/96”, boat=ID6)
ID6:(bid=101, bname=“Interlake”, color=“red”)
Defining New Concepts in GDB DDL– Grandson
GrSon
_ID1:(GrSon=_ID2) :- _ID1:
(IOF=“Person”,Son=_ID3),
_ID3:(IOF=“Person”, Son=_ID2),
_ID2:(IOF=“Person”).
[DML-QL] Writing simple queries:
•The names of all sailors who have reserved a red boat
_X Sailors _X Boats
_ID:(Name = _X) :-
_ID:(IOF = Sailors, Boat = _ID1, Name = _X),
_ID1:(IOF = Boats, Color = Red).
Informal Semantics
Query match
Facts
Extended Graph
RDBMS => GDB
• Sailors(sid:integer, sname:char(10), rating: integer, age:real)
• Boats(bid:integer, bname:char(10), color:char(10))
• Reserve(sid:integer, bid:integer, day:date)
sid sname rating age sid bid day bid bname color
Book
IOF
Title Databases
_ID
Author Ramakrishan
Author Gehrke
Gene_ex
Change
IOF
Aggregate
Operation
High Order Queries
Find all the fields from Tables that contain the name John.
_ID:(Name=_X) :-
_ID1:(IOF=Tables),
_ID2:(IOF=_ID1, _X=“John”).
GDB vs. OO, XML, OR, CG, …
• GDB are close in spirit to OO but not the same
(GDB : no encapsulation + more IDs).
• Close To Datalog but with IDs(links) vs foreign
keys
• The same for ORDBMs and somewhat XML
• Close to Conceptual Graphs But CG do not have
IDs
• We can also use foreign keys:
_ID:[ _ID(IOF = Sailors, sname = lubber)].
OO vs. GDB
OO GDB
ID1 Person
red
Conclusions and Further work
• Advantages & Disadvantages of GDB
• Conclusions
– Proposed a new database model DBG that copes with
problems existing in previous approaches
– Showed how to link existing DB with GDB
– Showed advantages of GDB over existing database
approaches
• Further Work
– Use GDB for learning