Neo4j Graph Data Modeling
By Mahesh Lal
4/5
()
About this ebook
Related to Neo4j Graph Data Modeling
Related ebooks
Neo4j High Performance Rating: 0 out of 5 stars0 ratingsLearn D3.js: Create interactive data-driven visualizations for the web with the D3.js library Rating: 0 out of 5 stars0 ratingsLearning Neo4j Rating: 3 out of 5 stars3/5Learning Cypher Rating: 0 out of 5 stars0 ratingsBuilding Web Applications with Python and Neo4j Rating: 0 out of 5 stars0 ratingsInstant MongoDB Rating: 0 out of 5 stars0 ratingsMastering Python Design Patterns Rating: 0 out of 5 stars0 ratingsHands-On Data Analysis with Pandas: Efficiently perform data collection, wrangling, analysis, and visualization using Python Rating: 0 out of 5 stars0 ratingsMachine Learning with Spark - Second Edition Rating: 0 out of 5 stars0 ratingsBuilding Web Applications with Flask Rating: 0 out of 5 stars0 ratingsLearning Data Mining with Python - Second Edition Rating: 0 out of 5 stars0 ratingsWeb Application Development with R Using Shiny - Second Edition Rating: 0 out of 5 stars0 ratingsAdvanced Deep Learning with Python: Design and implement advanced next-generation AI solutions using TensorFlow and PyTorch Rating: 0 out of 5 stars0 ratingsProfessional ASP.NET Design Patterns Rating: 4 out of 5 stars4/5Web Scraping with Python Rating: 4 out of 5 stars4/5Troubleshooting PostgreSQL Rating: 5 out of 5 stars5/5RStudio for R Statistical Computing Cookbook Rating: 0 out of 5 stars0 ratingsNeo4j Cookbook Rating: 0 out of 5 stars0 ratingsNeo4j - A Graph Project Story Rating: 5 out of 5 stars5/5Visualizing Graph Data Rating: 0 out of 5 stars0 ratingsReal-Time Big Data Analytics Rating: 5 out of 5 stars5/5MLOps A Complete Guide - 2021 Edition Rating: 0 out of 5 stars0 ratingsLearning PostgreSQL Rating: 1 out of 5 stars1/5Python Business Intelligence Cookbook Rating: 0 out of 5 stars0 ratingsIntroducing Data Science: Big data, machine learning, and more, using Python tools Rating: 5 out of 5 stars5/5Semantic Web for the Working Ontologist: Effective Modeling in RDFS and OWL Rating: 4 out of 5 stars4/5How to Lead in Data Science Rating: 0 out of 5 stars0 ratingsGraph Databases in Action: Examples in Gremlin Rating: 0 out of 5 stars0 ratings
Programming For You
Learn to Code. Get a Job. The Ultimate Guide to Learning and Getting Hired as a Developer. Rating: 5 out of 5 stars5/5Python Programming : How to Code Python Fast In Just 24 Hours With 7 Simple Steps Rating: 4 out of 5 stars4/5Coding All-in-One For Dummies Rating: 4 out of 5 stars4/5HTML & CSS: Learn the Fundaments in 7 Days Rating: 4 out of 5 stars4/5Grokking Algorithms: An illustrated guide for programmers and other curious people Rating: 4 out of 5 stars4/5SQL: For Beginners: Your Guide To Easily Learn SQL Programming in 7 Days Rating: 5 out of 5 stars5/5SQL QuickStart Guide: The Simplified Beginner's Guide to Managing, Analyzing, and Manipulating Data With SQL Rating: 4 out of 5 stars4/5Excel : The Ultimate Comprehensive Step-By-Step Guide to the Basics of Excel Programming: 1 Rating: 5 out of 5 stars5/5Python QuickStart Guide: The Simplified Beginner's Guide to Python Programming Using Hands-On Projects and Real-World Applications Rating: 0 out of 5 stars0 ratingsLearn PowerShell in a Month of Lunches, Fourth Edition: Covers Windows, Linux, and macOS Rating: 0 out of 5 stars0 ratingsPYTHON: Practical Python Programming For Beginners & Experts With Hands-on Project Rating: 5 out of 5 stars5/5Photoshop For Beginners: Learn Adobe Photoshop cs5 Basics With Tutorials Rating: 0 out of 5 stars0 ratingsMastering Windows PowerShell Scripting Rating: 4 out of 5 stars4/5The Absolute Beginner's Guide to Binary, Hex, Bits, and Bytes! How to Master Your Computer's Love Language Rating: 5 out of 5 stars5/5Learn JavaScript in 24 Hours Rating: 3 out of 5 stars3/5Hacking: Ultimate Beginner's Guide for Computer Hacking in 2018 and Beyond: Hacking in 2018, #1 Rating: 4 out of 5 stars4/5Python Machine Learning By Example Rating: 4 out of 5 stars4/5Problem Solving in C and Python: Programming Exercises and Solutions, Part 1 Rating: 5 out of 5 stars5/5Programming Arduino: Getting Started with Sketches Rating: 4 out of 5 stars4/5OneNote: The Ultimate Guide on How to Use Microsoft OneNote for Getting Things Done Rating: 1 out of 5 stars1/5SQL All-in-One For Dummies Rating: 3 out of 5 stars3/5Modern C++ for Absolute Beginners: A Friendly Introduction to C++ Programming Language and C++11 to C++20 Standards Rating: 0 out of 5 stars0 ratings
Reviews for Neo4j Graph Data Modeling
1 rating1 review
- Rating: 4 out of 5 stars4/5I am trying to learn how to model graph data for my use cases and as a beginner found this book very helpful. The examples that are used in the book are real world scenarios which anyone can relate to instantly.
Book preview
Neo4j Graph Data Modeling - Mahesh Lal
Table of Contents
Neo4j Graph Data Modeling
Credits
About the Author
About the Reviewers
www.PacktPub.com
Support files, eBooks, discount offers, and more
Why subscribe?
Free access for Packt account holders
Preface
What this book covers
What you need for this book
Who this book is for
Conventions
Reader feedback
Customer support
Downloading the example code
Downloading the color images of this book
Errata
Piracy
eBooks, discount offers, and more
Questions
1. Graphs Are Everywhere
Graphs in mathematics
The property graph model
Storage – native graph storage versus non-native graph storage
Reasons to use graph databases
What to use a graph database for
Choosing Neo4j for exploring graph databases
The structure of the book
Summary
2. Modeling Flights and Cities
Graphs are more than social
Designing a system to get a travel itinerary
Introduction to modeling flights and cities
Identifying the entities
Introduction to modeling nodes and relationships
Using Cypher to operate on Neo4j
Creating cities in Neo4j
Indices
Adding flights to Neo4j
Traversing relationships
Summary
3. Formulating an Itinerary
Creating an itinerary from flights and cities
Information and paths
Using Cypher to find a path
Business logic should lie in code
Summary
4. Modeling Bookings and Users
Building a data model for booking flights
A simple model of the bookings ecosystem
Modeling bookings in an RDBMS
Creating bookings and users in Neo4j
Creating users
Creating bookings in Neo4j
Queries to find journeys and bookings
Finding all journeys of a user
Queries to find the booking history of a user
Upcoming journeys of a user
Summary
5. Refactoring the Data Model
Capturing information about hotels at airports
Modeling airports and hotels
Extracting airport information from flights
Breaking airports out as a node
Connecting flights to airports
Delinking flights and cities
Querying the refactored data model
Reasons for not migrating using a single query
Adding hotels to airports
Fetching hotels
Summary
6. Modeling Communication Chains
Capturing traveler reviews for hotels
A model for reviews and comments
Adding reviews to Neo4j
Listing reviews for a hotel
Using reviews to find the average rating of a hotel
Adding comments to Neo4j
Considerations for modeling temporal data as chains
Summary
7. Modeling Access Control
Controlling access for content change
Modeling hierarchies
Modeling geographical regions
Adding countries and regions to Neo4j
Modeling hotel chains
Adding hotel chains to Neo4j
Modeling access control groups and employees
Adding access groups to Neo4j
Adding employees to Neo4j
Querying the data model to find what is accessible to an employee
Summary
8. Recommendations and Analysis of Historical Data
Recommending cities to travelers
Modeling categories
Creating categories in Neo4j
Cities and categories
Recommending cities based on previous travels
Recommending cities on the basis of other travelers
Recommending hotels to travelers
Recommending hotels from the same chains
Recommending hotels visited by similar travelers
Recommending hotels that match a price range
Improving recommendations
Analysis of the historical data
Querying to discover patterns
Summary
9. Wrapping Up
There is no correct model
Further reading and exploration
What to watch out for while using Neo4j
Index
Neo4j Graph Data Modeling
Neo4j Graph Data Modeling
Copyright © 2015 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: July 2015
Production reference: 1230715
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham B3 2PB, UK.
ISBN 978-1-78439-344-1
www.packtpub.com
Credits
Author
Mahesh Lal
Reviewers
Patrick Baumgartner
Sonal Raj
Daniel Vaughan
Acquisition Editor
Shaon Basu
Content Development Editor
Kirti Patil
Technical Editor
Mrunmayee Patil
Copy Editor
Pranjali Chury
Project Coordinator
Nidhi Joshi
Proofreader
Safis Editing
Indexer
Mariammal Chettiyar
Production Coordinator
Conidon Miranda
Cover Work
Conidon Miranda
About the Author
Mahesh Lal is a developer who has experience with various technologies. In 2011, while working on a social network for a client, he discovered the power of graphs, specifically Neo4j. Since then, he has been working with multiple clients across various domains for modeling their data as a graph. Currently working for ThoughtWorks, India, he is trying to help his clients look at their search problems in the form of a graph.
I would like to thank my reviewers, Daniel Vaughan, Sonal Raj, and Patrick Baumgartner, for giving me valuable feedback. I am grateful to Jim Webber and Pramod Sadalge for guiding me through this journey. I am indebted to my colleagues at ThoughtWorks for believing in me. Finally, I'd like to thank my family, who always inspire me to improve.
About the Reviewers
Patrick Baumgartner works as a passionate software craftsman at 42talents and builds software with Java/JEE, Spring Framework, OSGi, NoSQL databases, and other open source technologies. Since he began working with Neo4j in 2010, he sees the whole world as one big connected graph.
He is the host of the Neo4j Zurich and the Software Craftsmanship Zurich Meetup group and is actively involved in the agile community in Switzerland.
As a Spring trainer and Neo4j master instructor, he conducts various training and workshops on the topic, is an active speaker at conferences and events, and lectures at technical colleges. In his free time, he likes to explore Rik's Beer Graph or his own Single Malt Whisky Graph and tries to find routes to beautiful places.
Patrick has coauthored the German book, OSGi für Praktiker, with Bernd Weber and Oliver Braun and reviewed Scala - Objektfunktionale Programmierung by Oliver Braun.
I would like to thank my dearest girlfriend, Carmen, for supporting me in all my adventures.
Sonal Raj is a hacker, Pythonista, big data believer, and a technology dreamer. He has a passion for design and is an artist at heart. He blogs about technology, design, and gadgets at http://www.sonalraj.com/. When not working on projects, he can be found travelling, stargazing, or reading.
He has pursued engineering in computer science and loves to work on community projects. He has been a research fellow at IISc Bangalore and has taken up projects on graph computations using Neo4j and Storm. Sonal has been a speaker at PyCon India and local meetups about Neo4j, and has also published articles and research papers for leading magazines and international journals. He has contributed to