List of Listings

 

Chapter 1. A case for a Neo4j database

Listing 1.1. SQL script defining tables for social network data

Listing 1.2. Neo4j Traversal API code for finding all friends at depth 2

Chapter 3. Starting development with Neo4j

Listing 3.1. Creating a single user node in Neo4j (Java 6/Neo4j 1.9.X style)

Listing 3.2. Creating single user node in Neo4j (Java 7/Neo4j 2.0.X style)

Listing 3.3. Creating multiple nodes in a single transaction

Listing 3.4. Creating relationships between nodes using the Neo4j Core Java API

Listing 3.5. Adding name property to user nodes

Listing 3.6. Adding different property types to nodes

Listing 3.7. Creating movie nodes using Neo4j Core Java API

Listing 3.8. Adding a type property to determine node types

Listing 3.9. Creating relationships with properties

Listing 3.10. Adding labels to nodes

Listing 3.11. Finding nodes with a given label and property

Chapter 4. The power of traversals

Listing 4.1. Filtering movies by iterating through all relationships from the node

Listing 4.2. Filtering movies using the Neo4j Core Java API filtering capabilities

Listing 4.3. Finding movies that have been seen by John’s friends

Listing 4.4. Finding movies that have been seen by John’s friends but not by John

Listing 4.5. Using iterables to lower Java heap memory consumption

Listing 4.6. Using the Neo4j Traversal API to find movies seen by friends

Listing 4.7. Custom evaluator to exclude movies that the user has seen