Book Image

Neo4j Graph Data Modelling

Book Image

Neo4j Graph Data Modelling

Overview of this book

Table of Contents (16 chapters)
Neo4j Graph Data Modeling
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Designing a system to get a travel itinerary


The travel domain is interesting in terms of data modeling challenges. Throughout this book, we will be modeling systems that work together in a website that can be used for planning flight travel. Travelers would like to look at the options for an itinerary before booking any particular set of flights, especially if there is no direct flight from the traveler's current city to the destination city. Normally, an itinerary includes total duration, layover duration, and the number of hops it takes to reach the destination. We cannot, however, derive the itinerary without modeling cities and flights, which brings us to our first data modeling problem.

Introduction to modeling flights and cities

If we were to explain the problem of cities and the number of flights between them, we could start with drawing cities as nodes. In case two cities have two or more direct flights between them, we connect those two cities with an undirected relationship, as...