concept section in category graphs

appears as: section, The sections, section, sections
Neo4j in Action

This is an excerpt from Manning's book Neo4j in Action.

In Neo4j 1.9 and below, the simplest strategy you can use is to add a type property to each node, with the value of the property determining the node type. This is a well-known strategy used in other NoSQL technologies (such as document databases) because it’s easy to implement and understand. From Neo4j 2.0 onward, the recommended strategy is to make use of a new feature called “labels,” which we’ll cover in section 3.3. For now, we’ll start with the Neo4j 1.9-compatible non-label strategies.

  • Using non-Set-based collections —When modeling node entity relationships (via @RelatedTo, which is covered in section 9.2.5), at present only Set-backed collections may be used. For example, you can’t have the following:
    @RelatedTo
    private Map<RelationshipType,Set<User>> users;
  • You’ve probably noticed that an additional field appears to have snuck into both the User and Movie node entities, namely nodeId, annotated with @GraphId. This is a mandatory SDN requirement when using simple object mapping. Without going into too much detail just yet, simple object mapping is one of the strategies employed by SDN to perform the physical mapping between your domain entity and the Neo4j-backed graph entity. Using this strategy, SDN needs to have a field where it can store the underlying ID of the node backing the entity. The @GraphId annotation serves to mark the field that you’ve set aside for SDN to store this value in. Read more about simple object mapping in section 9.4.1.