Foreword |
|
ix | |
Preface |
|
xi | |
Acknowledgments |
|
xii | |
About this book |
|
xiii | |
About the authors |
|
xviii | |
About the cover illustration |
|
xix | |
|
Part 1 Getting started with graph databases |
|
|
1 | (168) |
|
|
3 | (21) |
|
|
4 | (12) |
|
What is a graph database? |
|
|
6 | (1) |
|
Comparison with other types of databases |
|
|
7 | (2) |
|
|
9 | (7) |
|
1.2 Is my problem a graph problem? |
|
|
16 | (8) |
|
|
16 | (3) |
|
I'm still confused. Is this a graph problem ...? |
|
|
19 | (5) |
|
|
24 | (30) |
|
2.1 The data modeling process |
|
|
25 | (4) |
|
|
25 | (2) |
|
Four-step process for data modeling |
|
|
27 | (2) |
|
2.2 Understand the problem |
|
|
29 | (4) |
|
Domain and scope questions |
|
|
30 | (1) |
|
Business entity questions |
|
|
31 | (1) |
|
|
32 | (1) |
|
2.3 Developing the whiteboard model |
|
|
33 | (4) |
|
Identifying and grouping entities |
|
|
33 | (1) |
|
Identifying relationships between entities |
|
|
34 | (3) |
|
2.4 Constructing the logical data model |
|
|
37 | (14) |
|
Translating entities to vertices |
|
|
38 | (3) |
|
Translating relationships to edges |
|
|
41 | (8) |
|
Finding and assigning properties |
|
|
49 | (2) |
|
|
51 | (3) |
|
3 Running basic and recursive traversals |
|
|
54 | (26) |
|
3.1 Setting up your environment |
|
|
55 | (2) |
|
Starting the Gremlin Server |
|
|
55 | (1) |
|
Starting the Gremlin Console, connecting to the Gremlin Server, and loading the data |
|
|
56 | (1) |
|
|
57 | (11) |
|
Using a logical data model (schema) to plan traversals |
|
|
58 | (1) |
|
Planning the steps through the graph data |
|
|
59 | (2) |
|
Fundamental concepts of traversing a graph |
|
|
61 | (2) |
|
Writing traversals in Gremlin |
|
|
63 | (5) |
|
Retrieving properties with values steps |
|
|
68 | (1) |
|
|
68 | (12) |
|
|
68 | (4) |
|
Writing recursive traversals in Gremlin |
|
|
72 | (8) |
|
4 Pathfinding traversals and mutating graphs |
|
|
80 | (32) |
|
|
81 | (17) |
|
Creating vertices and edges |
|
|
82 | (4) |
|
Removing data from our graph |
|
|
86 | (2) |
|
|
88 | (7) |
|
|
95 | (3) |
|
|
98 | (5) |
|
|
100 | (1) |
|
|
101 | (2) |
|
4.3 Traversing and filtering edges |
|
|
103 | (9) |
|
Introducing the E and V steps for traversing edges |
|
|
103 | (5) |
|
Filtering with edge properties |
|
|
108 | (1) |
|
Include edges in path results |
|
|
109 | (1) |
|
Performant edge counts and denormalization |
|
|
110 | (2) |
|
|
112 | (30) |
|
5.1 Review of values steps |
|
|
113 | (5) |
|
5.2 Constructing our result payload |
|
|
118 | (13) |
|
Applying aliases in Gremlin |
|
|
120 | (7) |
|
Projecting results instead of aliasing |
|
|
127 | (4) |
|
5.3 Organizing our results |
|
|
131 | (6) |
|
Ordering results returned from a graph traversal |
|
|
131 | (2) |
|
Grouping results returned from a graph traversal |
|
|
133 | (2) |
|
|
135 | (2) |
|
5.4 Combining steps into complex traversals |
|
|
137 | (5) |
|
6 Developing an application |
|
|
142 | (27) |
|
|
143 | (4) |
|
|
144 | (1) |
|
|
145 | (1) |
|
|
145 | (1) |
|
Preparing the database server Instance |
|
|
146 | (1) |
|
6.2 Connecting to our database |
|
|
147 | (4) |
|
Building the cluster configuration |
|
|
147 | (1) |
|
Setting up the GraphTraversalSource |
|
|
148 | (3) |
|
|
151 | (5) |
|
|
151 | (2) |
|
Using Gremlin language variants (GLVs) |
|
|
153 | (1) |
|
|
154 | (1) |
|
Creating the Java method in our application |
|
|
155 | (1) |
|
6.4 Adding, modifying, and deleting data |
|
|
156 | (7) |
|
|
156 | (2) |
|
|
158 | (2) |
|
|
160 | (1) |
|
|
160 | (3) |
|
6.5 Translating our list and path traversals |
|
|
163 | (6) |
|
Getting a list of results |
|
|
163 | (1) |
|
Implementing recursive traversals |
|
|
164 | (2) |
|
|
166 | (3) |
|
Part 2 Building on Graph Databases |
|
|
169 | (92) |
|
7 Advanced data modeling techniques |
|
|
171 | (27) |
|
7.1 Reviewing our current data models |
|
|
172 | (1) |
|
7.2 Extending our logical data model |
|
|
173 | (3) |
|
7.3 Translating entities to vertices |
|
|
176 | (18) |
|
|
177 | (6) |
|
|
183 | (5) |
|
Translating relationships to edges |
|
|
188 | (2) |
|
Finding and assigning properties |
|
|
190 | (1) |
|
Moving properties to edges |
|
|
191 | (3) |
|
|
194 | (1) |
|
7.4 Extending our data model for personalization |
|
|
194 | (2) |
|
7.5 Comparing the results |
|
|
196 | (2) |
|
8 Building traversals using known walks |
|
|
198 | (39) |
|
8.1 Preparing to develop our traversals |
|
|
199 | (7) |
|
Identifying the required elements |
|
|
199 | (5) |
|
Selecting a starting place |
|
|
204 | (1) |
|
|
205 | (1) |
|
8.2 Writing our first traversal |
|
|
206 | (8) |
|
|
206 | (4) |
|
Developing the traversal code |
|
|
210 | (4) |
|
8.3 Pagination and graph databases |
|
|
214 | (4) |
|
8.4 Recommending the highest-rated restaurants |
|
|
218 | (12) |
|
|
218 | (2) |
|
Developing the traversal code |
|
|
220 | (10) |
|
8.5 Writing the last recommendation engine traversal |
|
|
230 | (7) |
|
|
232 | (2) |
|
Adding this traversal to our application |
|
|
234 | (3) |
|
|
237 | (24) |
|
9.1 Working with subgraphs |
|
|
238 | (8) |
|
|
238 | (6) |
|
|
244 | (2) |
|
9.2 Building a subgraph for personalization |
|
|
246 | (6) |
|
9.3 Building the traversal |
|
|
252 | (4) |
|
Reversing the traversing direction |
|
|
253 | (2) |
|
Evaluating the individualized results of the subgraph |
|
|
255 | (1) |
|
9.4 Implementing a subgraph with a remote connection |
|
|
256 | (5) |
|
Connecting with TinkerPop's Client class |
|
|
257 | (1) |
|
Adding this traversal to our application |
|
|
258 | (3) |
|
Part 8 Moving Beyond the Basics |
|
|
261 | (40) |
|
10 Performance, pitfalls, and anti-patterns |
|
|
263 | (23) |
|
10.1 Slow-performing traversals |
|
|
264 | (5) |
|
|
264 | (2) |
|
|
266 | (2) |
|
|
268 | (1) |
|
10.2 Dealing with supernodes |
|
|
269 | (8) |
|
|
270 | (1) |
|
|
270 | (1) |
|
|
270 | (1) |
|
Monitoring for supernodes |
|
|
271 | (2) |
|
What to do if you have a supernode |
|
|
273 | (4) |
|
10.3 Application anti-patterns |
|
|
277 | (3) |
|
Using graphs for non-graph use cases |
|
|
277 | (1) |
|
|
278 | (2) |
|
|
280 | (1) |
|
10.4 Traversal anti-patterns |
|
|
280 | (6) |
|
Not using parameterized traversals |
|
|
280 | (3) |
|
Using unlabeled filtering steps |
|
|
283 | (3) |
|
11 What's next: Graph analytics, machine learning, and resources |
|
|
286 | (15) |
|
|
287 | (12) |
|
|
287 | (3) |
|
|
290 | (2) |
|
|
292 | (4) |
|
Graphs and machine learning |
|
|
296 | (1) |
|
|
297 | (2) |
|
|
299 | (2) |
Appendix Apache TinkerPop installation and overview |
|
301 | (10) |
Index |
|
311 | |