Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Neo4j Graph Data Modelling
  • Toc
  • feedback
Neo4j Graph Data Modelling

Neo4j Graph Data Modelling

By : Mahesh K Lal
3 (1)
close
Neo4j Graph Data Modelling

Neo4j Graph Data Modelling

3 (1)
By: Mahesh K Lal

Overview of this book

If you are a developer who wants to understand the fundamentals of modeling data in Neo4j and how it can be used to model full-fledged applications, then this book is for you. Some understanding of domain modeling may be advantageous but is not essential.
Table of Contents (11 chapters)
close
10
Index

Modeling hierarchies


To model employees and access control groups, we need to first modify our existing data to account for hierarchies in regions, countries, and cities. We also need to add hotel chains and their hierarchies. We can then apply the same practices used in modeling hierarchies to model access groups.

Modeling geographical regions

We already have airports and cities, which are geographical entities. We can add a couple of other entities such as country and region.

Figure 7.1: Country and region

A country or a region is uniquely identified by its name.

We can represent the relationship between airports, cities, countries, and regions in the following way:

Figure 7.2: Regions, countries, cities, and airports

Note

The previous diagram representing Regions, countries, cities, and airports can be generalized to represent a hierarchy in Neo4j.

Adding countries and regions to Neo4j

We can add a constraint to ensure the uniqueness of a name across countries, shown as follows:

neo4j-sh (?)$ CREATE...
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete