Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Neo4j Graph Data Modelling

You're reading from  Neo4j Graph Data Modelling

Product type Book
Published in Jul 2015
Publisher
ISBN-13 9781784393441
Pages 138 pages
Edition 1st Edition
Languages
Concepts

Table of Contents (16) Chapters

Neo4j Graph Data Modeling
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
1. Graphs Are Everywhere 2. Modeling Flights and Cities 3. Formulating an Itinerary 4. Modeling Bookings and Users 5. Refactoring the Data Model 6. Modeling Communication Chains 7. Modeling Access Control 8. Recommendations and Analysis of Historical Data 9. Wrapping Up Index

Preface

Graph databases have been gaining traction for a long time now and companies have adopted them for various use cases. Neo4j, the world's leading graph database, has been at the forefront of this trend and is widely used in production by companies that are world leaders in their respective domains. Advice on the usage of Neo4j using Cypher (the Neo4j query language), performance tuning of Neo4j, and general information can be sourced from various sources, including, but not limited to, blogs, the Neo4j website, the Neo4j mailing list, as well as books written by authors on these subjects. However, there is limited information regarding modeling information in Neo4j. This book aims to address this gap by giving examples of how various scenarios can be modeled in Neo4j. By sticking to a nonsocial graph example, this book steers clear of the stereotypical use case of graph databases. While we use Neo4j as an example to discuss graph database modeling, the concepts discussed can be applied to any graph database. We believe this book to be a useful tool for anyone wishing to understand graph database modeling.

What this book covers

Chapter 1, Graphs Are Everywhere, introduces you to the logical data representation of a property graph model, the various use cases of graph databases, and the advantages of using graph databases in general and Neo4j in particular.

Chapter 2, Modeling Flights and Cities, introduces you to basic modeling in Neo4j by discussing how flights and cities can be modeled in a graph database. We then create cities and flights in Neo4j using Cypher.

Chapter 3, Formulating an Itinerary, discusses some basic querying using Cypher for the purpose of creating a light itinerary from the existing data in Neo4j.

Chapter 4, Modeling Bookings and Users, discusses how to represent, in a graph database, a data model that is traditionally implemented in a RDBMS by modeling bookings in Neo4j.

Chapter 5, Refactoring the Data Model, covers refactoring the data model to accommodate changes in the business using Cypher. We do this as a multistep process and demonstrate how simple it is in Neo4j to change the data model.

Chapter 6, Modeling Communication Chains, discusses how communication chains can be modeled in Neo4j. This also covers how we can represent temporal relationships using this modeling technique, which allows for efficient retrieval of data while maintaining the integrity of the relationships between various pieces of information.

Chapter 7, Modeling Access Control, focuses on how access control lists can be modeled in Neo4j. This also discusses how hierarchies and groups can be modeled in Neo4j.

Chapter 8, Recommendations and Analysis of Historical Data, demonstrates the construction of queries to recommend cities and hotels to travelers using the data that we have in the database. This also analyzes some historical data to discover patterns in the database. This chapter demonstrates queries that would normally require some heavy lifting in an RDBMS.

Chapter 9, Wrapping Up, is the final chapter and talks about potential issues that you might run into while using Neo4j or a graph database, and also how modeling for a current problem isn't future-proof.

What you need for this book

To be able to learn from this book effectively, you must have Neo4j 2.2.3 (or higher) installed on your machine. Neo4j runs on Windows, Linux, and Mac OS X machines. The queries in this book have also been tested with Neo4j 2.3.0-M02.

Who this book is for

If you are a developer who wants to understand the fundamentals of modelling data in Neo4j and how it can be used to model full-fledged applications, then this book is for you. Some understanding of domain modelling may be advantageous, but is not essential.

Conventions

In this book, you will find a number of text styles that distinguish between different kinds of information. Here are some examples of these styles and an explanation of their meaning.

Code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles are shown as follows: "The MATCH clause is used to match a path having the specified node and relationship types."

A block of code is set as follows:

neo4j-sh (?)$ CREATE CONSTRAINT ON (user:User) ASSERT user.email IS UNIQUE;

New terms and important words are shown in bold like this: "A city can have multiple categories and will be connected to all categories that it has by a :KNOWN_FOR relationship."

Note

Warnings or important notes appear in a box like this.

Tip

Tips and tricks appear like this.

Reader feedback

Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.

To send us general feedback, simply e-mail , and mention the book's title in the subject of your message.

If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.

Customer support

Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.

Downloading the example code

You can download the example code files from your account at http://www.packtpub.com for all the Packt Publishing books you have purchased. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Downloading the color images of this book

We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/3441OS_ColoredImages.pdf.

Errata

Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.

To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.

Piracy

Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.

Please contact us at with a link to the suspected pirated material.

We appreciate your help in protecting our authors and our ability to bring you valuable content.

eBooks, discount offers, and more

Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at for more details.

At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.

Questions

If you have a problem with any aspect of this book, you can contact us at , and we will do our best to address the problem.

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}