Download presentation
Presentation is loading. Please wait.
Published byAlicia Holt Modified over 9 years ago
1
Graph Databases (GDB) Adrian Silvescu Doina Caragea Anna Atramentov
2
Problems And Motivations The necessity to represent, store and manipulate complex data make RDBMS somewhat obsolete [P1] Problem 1: Violations of the 1NF –Multi-valued attributes –Complex attributes –Complex combination of the previous two [P2] Problem 2 : Accommodate Changes –Appears when acquiring data from autonomous dynamic sources or Web (eg: genexp & restaurants ). –RDBMS may require schema renormalization
3
Problems and Motivations (contd) [P3] Problem 3: Unified representation for: –Data –Knowledge (Schemas are a subset of this) –Queries (More generally: Goals) [results+def] –Models (Concepts are a particular example) In order to facilitate the application of learning and reasoning methods on these structures
4
The Big Picture
5
Existing Approaches RDBMS – may need schema renormalisation Approaches that try to fix the above mentioned problems: –OO Databases [P1], [P2] - graphs [but procedural] –XML Databases [P1] (somewhat [P3]) – trees –OORDBMS [P1] – graphs with foreign keys Others –Datalog – More Efficient Crippled Prolog –Network Models - graphs –Hierarchical Models – trees Therefore the motivation for Graph Databases
6
Outline Graph Databases –Examples –DDL –DML – Queries –DML – UPDATES –Informal Semantics –DB => GDB GDB vs. OO, XML, OR, … Conclusions and Further Work
7
Graph Databases We propose a new kind of Database: Graph Databases (GDB) as a solution to Problems [P1],[P2] and [P3]. In order to define the GDB we will specify: –The Data Definition Language (DDL) –The Query Language (more generally DML) –Informal Semantics of the above languages We will also show how to convert existing DBs (RDBMS) into the GDB DDL to facilitate the transition to GDBs
8
Goals and Design Choice 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
9
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) Sailors Reserves Boats sidsnameratingage 22dustin745.0 31lubber855.5 58rusty1035.0 bidbnamecolor 101Interlakered 102Clippergreen 103Marinered sidbidday 2210110/10/96 5810311/12/96
10
:: : ID4 TB L ID1 dustin 7 name rating age 22 45.0 sid ID7 : : Sailor s IO F ID2 lubbe r 8 name rating age 31 55.5 sid IOF ID3 … Boat s IOF Reserves IOF ID5 ID6 ID8 Graph Representation
11
ID1 dustin 7 name rating age 22 45.0 sid ID4 10/10/96 101 day bid 22 sid ID6 101 Interlake bid bname color red Sailor Boat Foreign Keys
12
Data Representation in the GDB DDL 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”) ID Name2 Name N Name1 …… Val 1 Val 2 Val N
13
Defining New Concepts in GDB DDL– Grandson _ID1:(GrSon=_ID2) :- _ID1:(IOF=“Person”,Son=_ID3), _ID3:(IOF=“Person”, Son=_ID2), _ID2:(IOF=“Person”). _ID1GrSon_ID2 :- _ID1Son_ID3Son_ID2 IOF Person IOF Person IOF Person GrSon
14
[DML-QL] Writing simple queries: _ID:(Name = _X) :- _ID:(IOF = Sailors, Boat = _ID1, Name = _X), _ID1:(IOF = Boats, Color = Red). The names of all sailors who have reserved a red boat _ID :- _ID IOF Sailors BoatRed IOF _ID1Color Boats Name _X Name _X
15
Informal Semantics Three kinds of Definitions –Facts: G1. [Extensional definition] –Definitions: G1 :- G2. [Intensional definition] G1 :- PROC f(x1,…,xn). [Procedural definition] Queries = Graphs to be Matched = QG –The same as a definition: Query :- QG.
16
Informal Semantics - Picture Query match Facts Extended Graph Query
17
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) Sailors Reserves Boats sidsnameratingage 22dustin745.0 31lubber855.5 58rusty1035.0 bidbnamecolor 101Interlakered 102Clippergreen 103Marinered sidbidday 2210110/10/96 5810311/12/96
18
DML - Updates Inline Query –_ X : [ _ID: (IOF = Sailor, sname = lubber, rating = _X)] Updates: MODIFY (QryGraph, UpdList) –Add to all GrandSons the money of the Grandparent as a potential inheritance. –MODIFY ( _ID : (GrSon = _ID1), (=> NEWID:(IOF = POT_INHER, BENFICIARY = _ID1, AMOUNT = _AMNT: [ _ID:(Money = _AMNT )]) )) –.
19
Change _ID Book IOF Title Author Databases Ramakrishan Gehrke
20
Change _ID IOF Gene_ex value0.7 IOF Aggregate Operation IOF Exp IOF _ID1 _ID2 _IDn value x2 x1 value xN :
21
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”).
22
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)].
23
OO vs. GDB Class: Car color: red OO Class: Person age: 42 name: john car ID1 ID2 ID1 ID2 IOF Person age name car 42 John IOF Car color red GDB
24
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.