contents

foreword

preface

acknowledgments

about this book

about the authors

about the cover illustration

    

Part 1. Getting started with graph databases

  1 Introduction to graphs

  1.1  What is a graph?

What is a graph database?

Comparison with other types of databases

Why can’t I use SQL?

  1.2  Is my problem a graph problem?

Explore the questions

I’m still confused. . . . Is this a graph problem?

  2 Graph data modeling

  2.1  The data modeling process

Data modeling terms

Four-step process for data modeling

  2.2  Understand the problem

Domain and scope questions

Business entity questions

Functionality questions

  2.3  Developing the whiteboard model

Identifying and grouping entities

Identifying relationships between entities

  2.4  Constructing the logical data model

Translating entities to vertices

Translating relationships to edges

Finding and assigning properties

  2.5  Checking our model

  3 Running basic and recursive traversals

  3.1  Setting up your environment

Starting the Gremlin Server

Starting the Gremlin Console, connecting to the Gremlin Server, and loading the data

  3.2  Traversing a graph

Using a logical data model (schema) to plan traversals

Planning the steps through the graph data

Fundamental concepts of traversing a graph

Writing traversals in Gremlin

Retrieving properties with values steps

  3.3  Recursive traversals

Using recursive logic

Writing recursive traversals in Gremlin

  4 Pathfinding traversals and mutating graphs

  4.1  Mutating a graph

Creating vertices and edges

Removing data from our graph

Updating a graph

Extending our graph

  4.2  Paths

Cycles in graphs

Finding the simple path

  4.3  Traversing and filtering edges

Introducing the E and V steps for traversing edges

Filtering with edge properties

Include edges in path results

Performant edge counts and denormalization

  5 Formatting results

  5.1  Review of values steps

  5.2  Constructing our result payload

Applying aliases in Gremlin

Projecting results instead of aliasing

  5.3  Organizing our results

Ordering results returned from a graph traversal

Grouping results returned from a graph traversal

Limiting results

  5.4  Combining steps into complex traversals

  6 Developing an application

  6.1  Starting the project

Selecting our tools

Setting up the project

Obtaining a driver

Preparing the database server Instance

  6.2  Connecting to our database

Building the cluster configuration

Setting up the GraphTraversalSource

  6.3  Retrieving data

Retrieving a vertex

Using Gremlin language variants (GLVs)

Adding terminal steps

Creating the Java method in our application

  6.4  Adding, modifying, and deleting data

Adding vertices

Adding edges

Updating properties

Deleting elements

  6.5  Translating our list and path traversals

Getting a list of results

Implementing recursive traversals

Implementing paths

Part 2. Building on Graph Databases

  7 Advanced data modeling techniques

  7.1  Reviewing our current data models

  7.2  Extending our logical data model

  7.3  Translating entities to vertices

Using generic labels

Denormalizing graph data

Translating relationships to edges

Finding and assigning properties

Moving properties to edges

Checking our model

  7.4  Extending our data model for personalization

  7.5  Comparing the results

  8 Building traversals using known walks

  8.1  Preparing to develop our traversals

Identifying the required elements

Selecting a starting place

Setting up test data

  8.2  Writing our first traversal

Designing our traversal

Developing the traversal code

  8.3  Pagination and graph databases

  8.4  Recommending the highest-rated restaurants

Designing our traversal

Developing the traversal code

  8.5  Writing the last recommendation engine traversal

Designing our traversal

Adding this traversal to our application

  9 Working with subgraphs

  9.1  Working with subgraphs

Extracting a subgraph

Traversing a subgraph

  9.2  Building a subgraph for personalization

  9.3  Building the traversal

Reversing the traversing direction

Evaluating the individualized results of the subgraph

  9.4  Implementing a subgraph with a remote connection

Connecting with TinkerPop’s Client class

Adding this traversal to our application

Part 3. Moving Beyond the Basics

10 Performance, pitfalls, and anti-patterns

10.1  Slow-performing traversals

Explaining our traversal

Profiling our traversal

Indexes

10.2  Dealing with supernodes

It’s about instance data

It’s about the database

What makes a supernode?

Monitoring for supernodes

What to do if you have a supernode

10.3  Application anti-patterns

Using graphs for non-graph use cases

Dirty data

Lack of adequate testing

10.4  Traversal anti-patterns

Not using parameterized traversals

Using unlabeled filtering steps

11 What’s next: Graph analytics, machine learning, and resources

11.1  Graph analytics

Pathfinding

Centrality

Community detection

Graphs and machine learning

Additional resources

11.2  Final thoughts

    

appendix. Apache TinkerPop installation and overview

    

index

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.241.116