concept User in category graphs

This is an excerpt from Manning's book Neo4j in Action.
As you can see, there are several possible paths from a User to a Permission. In order to find out what permissions a user has, you need to find all the Permission nodes that a User node is connected to, via any path. In a traditional RDBMS, this would require a complex query expressing the union of each of the different kinds of paths:
From User directly to Permission (one table join) From User to Group to Permission (two table joins) From User to Role to Permission (two table joins) From User to Group to Role to Permission (three table joins)
There is nothing too complicated here—this is basic object modeling. Both the User and Movie concepts have been modeled as first-class entities—that seems reasonable enough. You’ve also modeled a user’s viewing of a particular movie as an entity as well, namely the Viewing class. This is primarily because the relationship itself holds important information that you want to retain and use—namely the stars rating provided by the user. If you had modeled this as a simple collection type relationship between User and Movie, you’d lose this information.
Using the User domain class as an example, let’s look at how this works and what’s involved. Figure 9.6 shows our starting point.
The following one-line snippet shows the definition of the UserRepository interface, specifically for the User domain (node entity) class:
public interface UserRepository extends GraphRepository<User> { }In this case, the UserRepository interface is extending the GraphRepository interface, which defines the broadest set of default operations available for a domain class. The use of Java generics ties this repository (at compile time, anyway) to the User domain entity.