Discover millions of ebooks, audiobooks, and so much more with a free trial

Only $11.99/month after trial. Cancel anytime.

Learning Neo4j
Learning Neo4j
Learning Neo4j
Ebook398 pages3 hours

Learning Neo4j

Rating: 3 out of 5 stars

3/5

()

Read preview

About this ebook

This book is for developers who want an alternative way to store and process data within their applications. No previous graph database experience is required; however, some basic database knowledge will help you understand the concepts more easily.
LanguageEnglish
Release dateAug 25, 2014
ISBN9781849517171
Learning Neo4j

Related to Learning Neo4j

Related ebooks

Programming For You

View More

Related articles

Reviews for Learning Neo4j

Rating: 3 out of 5 stars
3/5

1 rating0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Learning Neo4j - Rik Van Bruggen

    Table of Contents

    Learning Neo4j

    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 color images of this book

    Errata

    Piracy

    Questions

    1. Graphs and Graph Theory – an Introduction

    Introduction to and history of graphs

    Definition and usage of graph theory

    Social studies

    Biological studies

    Computer science

    Flow problems

    Route problems

    Web search

    Test questions

    Summary

    2. Graph Databases – Overview

    Background

    Navigational databases

    Relational databases

    NoSQL databases

    Key-Value stores

    Column-Family stores

    Document stores

    Graph databases

    The Property Graph model of graph databases

    Node labels

    Relationship types

    Why (or why not) graph databases

    Why use a graph database?

    Complex queries

    In-the-clickstream queries on live data

    Path finding queries

    Why not use a graph database, and what to use instead

    Large, set-oriented queries

    Graph global operations

    Simple, aggregate-oriented queries

    Test questions

    Summary

    3. Getting Started with Neo4j

    Neo4j – key concepts and characteristics

    Built for graphs, from the ground up

    Transactional, ACID-compliant database

    Made for Online Transaction Processing

    Designed for scalability

    A declarative query language – Cypher

    Sweet spot use cases of Neo4j

    Complex, join-intensive queries

    Path finding queries

    Committed to open source

    The features

    The support

    The license conditions

    Installing Neo4j

    Installing Neo4j on Windows

    Installing Neo4j on Mac or Linux

    Using Neo4j in a cloud environment

    Test Questions

    Summary

    4. Modeling Data for Neo4j

    The four fundamental data constructs

    How to start modeling for graph databases

    What we know – ER diagrams and relational schemas

    Introducing complexity through join tables

    A graph model – a simple, high-fidelity model of reality

    Graph modeling – best practices and pitfalls

    Graph modeling best practices

    Design for query-ability

    Align relationships with use cases

    Look for n-ary relationships

    Granulate nodes

    Use in-graph indexes when appropriate

    Graph database modeling pitfalls

    Using rich properties

    Node representing multiple concepts

    Unconnected graphs

    The dense node pattern

    Test questions

    Summary

    5. Importing Data into Neo4j

    Alternative approaches to importing data into Neo4j

    Know your import problem – choose your tooling

    Importing small(ish) datasets

    Importing data using spreadsheets

    Importing using Neo4j-shell-tools

    Importing using Load CSV

    Scaling the import

    Questions and answers

    Summary

    6. Use Case Example – Recommendations

    Recommender systems dissected

    Using a graph model for recommendations

    Specific query examples for recommendations

    Recommendations based on product purchases

    Recommendations based on brand loyalty

    Recommendations based on social ties

    Bringing it all together – compound recommendations

    Business variations on recommendations

    Fraud detection systems

    Access control systems

    Social networking systems

    Questions and answers

    Summary

    7. Use Case Example – Impact Analysis and Simulation

    Impact analysis systems dissected

    Impact analysis in Business Process Management

    Modeling your business as a graph

    Which applications are used in which buildings

    What buildings are affected if something happens to Appl_9?

    What BusinessProcesses with an RTO of 0-2 hours would be affected by a fire at location Loc_100

    Impact simulation in a Cost Calculation environment

    Modeling your product hierarchy as a graph

    Working with a product hierarchy graph

    Calculating the price based on a full sweep of the tree

    Calculating the price based on intermediate pricing

    Impact simulation on product hierarchy

    Questions and Answers

    Summary

    8. Visualizations for Neo4j

    The power of graph visualizations

    Why graph visualizations matter!

    Interacting with data visually

    Looking for patterns

    Spot what's important

    The basic principles of graph visualization

    Open source visualization libraries

    D3.js

    Graphviz

    Sigma.js

    Vivagraph.js

    Integrating visualization libraries in your application

    Visualization solutions

    Gephi

    Keylines

    Linkurio.us

    Neo4j Browser

    Tom Sawyer

    Closing remarks on visualizations

    The fireworks effect

    The loading effect

    Questions and answers

    Summary

    9. Other Tools Related to Neo4j

    Data integration tools

    Talend

    MuleSoft

    Business Intelligence tools

    Modeling tools

    Arrows

    OmniGraffle

    Questions and answers

    Summary

    A. Where to Find More Information Related to Neo4j

    Online tools

    Google group

    Stack Overflow

    The Neo4j community website

    The new Neo4j website

    The Neo4j Blog

    GraphGists collection

    The Cypher reference card

    Other books

    Events

    Meetup

    GraphConnect

    Conferences

    Training

    Neo Technology

    B. Getting Started with Cypher

    The key attributes of Cypher

    Key operative words in Cypher

    The Cypher refcard

    Syntax

    Index

    Learning Neo4j


    Learning Neo4j

    Copyright © 2014 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: August 2014

    Production reference: 1190814

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-84951-716-4

    www.packtpub.com

    Cover image by Pratyush Mohanta (<tysoncinematics@gmail.com>)

    Credits

    Author

    Rik Van Bruggen

    Reviewers

    Jussi Heinonen

    Michael Hunger

    Andreas Kolleger

    Max De Marzi

    Mark Needham

    Yavor Stoychev

    Ron Van Weverwijk

    Acquisition Editor

    Nikhil Karkal

    Content Development Editor

    Poonam Jain

    Technical Editors

    Tanvi Bhatt

    Akash Rajiv Sharma

    Faisal Siddiqui

    Aman Preet Singh

    Copy Editors

    Roshni Banerjee

    Sayanee Mukherjee

    Aditya Nair

    Deepa Nambiar

    Project Coordinator

    Mary Alex

    Proofreaders

    Simran Bhogal

    Maria Gould

    Ameesha Green

    Paul Hindle

    Indexers

    Hemangini Bari

    Tejal Soni

    Priya Subramani

    Graphics

    Sheetal Aute

    Ronak Dhruv

    Valentina D'silva

    Disha Haria

    Abhinash Sahu

    Production Coordinator

    Komal Ramchandani

    Cover Work

    Komal Ramchandani

    About the Author

    Rik Van Bruggen is the regional territory manager for Neo Technology for Benelux, UK, and the Nordic region. He has been working for startup companies for most of his career, including eCom Interactive Expertise, SilverStream Software, Imprivata, and Courion. While he has an interest in technology, his real passion is business and how to make technology work for a business. He lives in Antwerp, Belgium, with his wife and three lovely kids, and enjoys technology, orienteering, jogging, and Belgian beer.

    This book and all of the work that went on around it would not have been possible without the unconditional support of my wife, Katleen, and our three lovely kids, Mit, Toon, and Cas. Thank you!

    About the Reviewers

    Michael Hunger has been passionate about software development for a long time. He is particularly interested in the people who develop software, software craftsmanship, programming languages, and improving code.

    For the past few years, he has been working with Neo Technology on the Neo4j graph database. As the project lead of Spring Data Neo4j, he helped develop the idea to make it a convenient and complete solution for object graph mapping. He now takes care of all the aspects of the Neo4j developer community.

    Good relationships are everywhere in Michael's life. His life revolves around his family and children, running his coffee shop and co-working space, having fun in the depths of a text-based, multiuser dungeon, tinkering with and without Lego, and much more.

    As a developer, he loves to work with many aspects of programming languages—learning new things every day, participating in exciting and ambitious open source projects, and contributing and writing software-related books and articles. He is also an active speaker at conferences and events, and a longtime editor at InfoQ.

    He is one of the important contributors to the expert book, 97 Things Every Programmer Should Know by Kevin Henney, O'Reilly.

    He has co-authored Spring Data, by Mark Pollack, Oliver Gierke, Thomas Risberg, and Jon Brisbin, O'Reilly and has also reviewed the following books:

    NoSQL Distilled, Pramod J. Sadalage and Martin Fowler, Pearson

    Domain-Specific Languages Patterns, Martin Fowler and Rebecca Parsons, Pearson

    Pragmatic Guide to Git, Travis Swicegood, The Pragmatic Bookshelf

    Art of Readable Code, Dustin Boswell and Trevor Foucher, O'Reilly

    Apprenticeship Patterns, David H. Hoover and Adewale Oshineye, O'Reilly

    I want to thank the four wonderful women in my life who make me happy every day and let me achieve many things.

    Ron Van Weverwijk is an experienced software developer at GoDataDriven in Netherlands. He has years of experience developing both backend and frontend applications.

    For the last few years, he has been building applications to explore and visualize complex network data using Neo4j. He is an expert Neo4j developer and community member. He has given several Neo4j trainings, and has spoken about Neo4j at a number of recent conferences.

    www.PacktPub.com

    Support files, eBooks, discount offers and more

    You might want to visit www.PacktPub.com for support files and downloads related to your book.

    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.

    http://PacktLib.PacktPub.com

    Do you need instant solutions to your IT questions? PacktLib is Packt's online digital book library. Here, you can access, read and search across Packt's entire library of books.

    Why Subscribe?

    Fully searchable across every book published by Packt

    Copy and paste, print and bookmark content

    On demand and accessible via web browser

    Free Access for Packt account holders

    If you have an account with Packt at www.PacktPub.com, you can use this to access PacktLib today and view nine entirely free books. Simply use your login credentials for immediate access.

    Preface

    The title of this book, Learning Neo4j, is a really good title in many ways. On one hand, it reflects my own personal experience with Neo4j over the past couple of years and more. As I fell deeply in love with graph technology, Neo4j kept on providing me with new fascinating things to learn about and explore. This book, in more than one way, is a summary of that learning experience—it's the tale of my learning of Neo4j.

    But the book is also supposed to provide you with lots of good starting points to get going with this technology more quickly. I know for a fact that finding learning resources on these types of technologies is not always easy, and that's really what drove me personally to spend many late nights, weekends, and holidays to put together this book to accelerate your learning of Neo4j.

    What this book covers

    Chapter 1, Graphs and Graph Theory – an Introduction, provides you with some background information on graphs to help you understand where the technology behind Neo4j came from.

    Chapter 2, Graph Databases – Overview, will try to explain how the theory of the previous chapter is used to create a new, different kind of database that is standing on the shoulders of giants. We are going to be basing ourselves on several decades of database technologies, of course.

    Chapter 3, Getting Started with Neo4j, gives you an overview of several of Neo4j's key characteristics, and then helps you get going with the tool on different on-premise and cloud-based platforms.

    Chapter 4, Modeling Data for Neo4j, will provide you with an introduction to data modeling for graph databases. Before you take your newly acquired tool (discussed in the previous chapter) for a spin, you need to think about the data model, just as you would with any other database.

    Chapter 5, Importing Data into Neo4j, will give you a good look at the different options and considerations to import data into your newly created model (discussed in Chapter 4, Modeling Data for Neo4j). It will show you some of the different import techniques in detail as well.

    Chapters 6, Use Case Example – Recommendations, will provide detailed examples of use cases for Neo4j that seem to have become quite commonplace in many different industries. This chapter focuses on recommendations.

    Chapter 7, Use Case Example – Impact Analysis and Simulation, will take a deep look into the impact analysis use cases of Neo4j.

    Chapter 8, Visualizations for Neo4j, will give you an overview of how to integrate the Neo4j graph database with the powerful domain of graph visualizations. We will discuss different alternatives, and point you to different resources to get started with.

    Chapter 9, Other Tools Related to Neo4j, will provide you with some pointers to interesting complementary tools that relate to Neo4j, such as data integration tools, business intelligence tools, and modeling tools.

    Appendix A, Where to Find More Information Related to Neo4j, gives a basic introduction to Cypher.

    Appendix B, Getting Started with Cypher, discusses the Neo4j query language that we are using throughout the book.

    What you need for this book

    This book can be read without any additional resources; however, we recommend access to some physical lab resources to install Neo4j Community Edition

    Enjoying the preview?
    Page 1 of 1