Database Reference
In-Depth Information
tp://projects.spring.io/spring-data-neo4j ) is also a very useful reference resource, with
more general information about the core Spring framework itself available at ht-
tp://projects.spring.io/spring-framework .
9.2. Modeling with SDN
In this section, we'll show you how SDN can be used to transform POJOs to represent the
entities within the movie-lovers' social network, where the data is stored in your Neo4j
database. We'll assume that you're starting from a blank canvas and will be using SDN as
the primary mechanism for driving the creation of, and setting up, your graph database. If
youalreadyhaveagraphdatabaseandwanttoknowifyoucanapplySDNretrospectively,
please refer to the sidebar “ Can SDN and native Neo4j play nicely together? ” later in the
chapter.
In this section, you'll
1 . Define a standard POJO object model to represent your domain.
2 . See what's required by SDN to transform these POJOs into entities backed by
Neo4j.
3 . Dig a little deeper into various elements of SDN modeling, including
• Modeling node entities
• Modeling relationship entities
• Modeling relationships between node entities
To recap, in this social network users can be friends with each other. Users can also mark
themoviesthey'veseenandratethemwithonetofivestars,basedonhowmuchtheyliked
them. You're going to add a userId property so users can log in. This will also allow
you to uniquely identify and refer to each user. Finally, you're going to add the ability for
new users to indicate whether they were referred by anyone at joining time. This could be
used to assign points to the referrer for each movie rated by new members within their first
month, potentially leading to a free movie ticket or some other benefit. Figure 9.2 illus-
trates that John originally joined the network because he was referred by David.
Search WWH ::




Custom Search