4. Graph Data A graph G = (V,E) is a collection of nodes (vertices) and edges. A graph represents a “relationship structure” among different data elements. A graph database is a collection of different graphs representing different relationship structures.
5. Graph database versus Relational database A relational database maintains different instances of the same relationship structure (represented by its ER schema) A graph database maintains different relationship structures
6.
7.
8.
9.
10.
11. Storing Graph Data Attributed Relational Graphs (ARGs) A B C D p q r s t r D A p C A t D B s C B q B A
12.
13. Storing Graph Data A B C D p q r s t Maximum walks: A r D t B s C p A q B
14.
15. Storing Graph Data Linear DFS Tree: (Example: Glide http://www.cs.nyu.edu/cs/faculty/shasha/papers/graphgrep/ ) A B C D p q r s t A%1 /p/ C /s/ B%1q /t/ D%1r
16.
17. Storing Graph Data XML with IDREFS: A B C D <node id=“A”, adj=“C D”> <node id=“B”> <node id=“C”> </node> <node id=“D”> </node> </node> </node>
18.
19.
20.
21. Structural Indexes GraphGrep (Guigno and Shasha 2002) Two index files: “ Fingerprint” file holding label-paths “ Path” file holding id-paths … paths from length 1 up to a maximum l p
22. Structural Indexes GraphGrep (Guigno and Shasha 2002) A B A D 1 2 3 4 G1 Database Fingerprint file 0 2 ABA 1 2 AAB 0 1 BD 1 1 AD 1 2 AB 0 2 AA G2 G1 Path
23. Structural Indexes GraphGrep (Guigno and Shasha 2002) A B A D 1 2 3 4 G1 Database Paths file {1-2-3, 3-2-1} ABA {1-3-2, 3-1-2} AAB {2-4} BD {1-4} AD {1-2, 3-2} AB {1-3, 3-1} AA G1 Path
36. gSpan A B A D p q r p 0 1 2 3 Sequence: (0,1,A,q,B)(1,2,B,r,A)(2,0,A,p,A)(1,3,B,p,A) Since a graph has many DFS trees, consider only the DFS tree which yields sequence with the least lexicographic value.
37.
38.
39. FBT A B C A B A C B Length-1 Walks AB, AB, BC, AC AB, AB, BC, AC
40. FBT A B C A B A C B Length-2 Walks ABA , ABC, BCA, BAC, ABA, ACB ABC, ACB, BCA, BAC, BAB , BAC
41.
42.
43.
44.
45.
46.
47.
48. Thank You! For more interaction, contact me at [email_address]