Database Reference
In-Depth Information
Figure 4.1. The selected user and the movies he's seen are marked with a bold border.
To navigate to nodes representing movies John has seen, you'll start from the node repres-
enting John Johnson, then follow all of the HAS_SEEN relationships to the target movies.
Thenodesandrelationshipsyouwanttovisitaspartofthetraversalaremarkedwithadark
border in figure 4.1 .
The first task is locating the starting node for the traversal: user John Johnson.
4.1.1. Finding the starting node
Before you can proceed with the traversal, you need to find the node from which you're
going to start the traversal, typically called the starting node . The Neo4j Core Java
API has a single lookup method that can be used to load nodes from the graph data-
base— GraphDatabaseService.getNodeById(Long id) . This method loads
thenodebyitsinternalidentifier,whichisrepresentedasa java.util.Long numberin
 
Search WWH ::




Custom Search