Chapter 3. Starting development with Neo4j
This chapter covers
- Modeling graph data
- Creating connected nodes using the Neo4j Java API
- Adding additional information to nodes and relationships using properties
- Strategies for differentiating between types of nodes
In chapter 1 we demonstrated the performance and scalability improvements available when using Neo4j as a database for graph data. We also discussed how data that’s naturally modeled as a graph fits well with the Neo4j data model. Now it’s time to get some hands-on practice.
In this chapter we’ll introduce you to the Neo4j Core Java API by modeling and creating an example graph in the Neo4j graph database. We’ll build on the social network example from chapter 1, but we’ll make it slightly more complex by allowing users to rate movies they’ve seen.
The users in the social network can be friends. In addition, users can mark the movies they’ve seen and rate them with one to five stars based on how much they liked them.