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

Only $11.99/month after trial. Cancel anytime.

Neo4j Cookbook
Neo4j Cookbook
Neo4j Cookbook
Ebook586 pages2 hours

Neo4j Cookbook

Rating: 0 out of 5 stars

()

Read preview

About this ebook

About This Book
  • Rapidly build your data analysis application over Neo4j with ease
  • Transition from RDMS and other NoSQL databases to Neo4j
  • Learn to effectively scale your Neo4j installations to millions of nodes
Who This Book Is For

If you are already using Neo4j in your application and want to learn more about data analysis or database graphs, this is the book for you. This book also caters for your needs if you are looking to migrate your existing application to Neo4j in the future. We assume that you are already familiar with any general purpose programming language and have some familiarity with Neo4j.

LanguageEnglish
Release dateMay 28, 2015
ISBN9781783287260
Neo4j Cookbook

Related to Neo4j Cookbook

Related ebooks

Databases For You

View More

Related articles

Reviews for Neo4j Cookbook

Rating: 0 out of 5 stars
0 ratings

0 ratings0 reviews

What did you think?

Tap to rate

Review must be at least 10 words

    Book preview

    Neo4j Cookbook - Ankur Goel

    Table of Contents

    Neo4j Cookbook

    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

    Sections

    Getting ready

    How to do it…

    How it works…

    There's more…

    See also

    Conventions

    Reader feedback

    Customer support

    Downloading the example code

    Downloading the color images of this book

    Errata

    Piracy

    Questions

    1. Getting Started with Neo4j

    Introduction

    Single node installation of Neo4j over Linux

    Getting ready

    How to do it...

    How it works...

    See also

    Single node installation of Neo4j over Windows

    Getting ready

    How to do it...

    How it works...

    See also

    Single node installation of Neo4j over Mac OS X

    Getting ready

    How to do it...

    How it works...

    There's more…

    Creating your first graph with Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    Importing data from the CSV format to Neo4j

    Getting ready

    How to do it...

    Using a batch importer

    Using custom scripts

    How it works...

    See also

    Importing data from RDBMS to Neo4j

    Getting ready

    How to do it...

    Using the Neo4j SQL importer tool

    Using custom scripts

    How it works...

    There's more…

    Importing data from the Geoff format to Neo4j

    Getting ready

    How to do it...

    How it works...

    Bulk load

    See also

    Importing data from OrientDB to Neo4j

    Getting ready

    How to do it...

    Exporting in the JSON format

    Using Gremlin

    How it works...

    See also

    Importing data from InfiniteGraph to Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    Importing data from the DEX graph database to Neo4j

    Getting ready

    How to do it...

    How it works...

    See also

    Common configurations of Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    Running multiple instances of Neo4j over a single machine

    Getting ready

    How to do it...

    How it works...

    See also

    Building Neo4j from the source

    Getting ready

    How to do it...

    How it works...

    There's more…

    2. Connecting to Neo4j

    Introduction

    Accessing Neo4j from the command line using the Neo4j shell

    Getting ready

    How to do it...

    How it works...

    Accessing Neo4j from the command line using curl

    Getting ready

    How to do it...

    How it works...

    Accessing Neo4j from the Java libraries

    Getting ready

    How to do it...

    How it works...

    Accessing Neo4j using the Java REST bindings

    Getting ready

    How to do it...

    Developing your own Neo4j REST client

    Using the Java Neo4j REST binding

    How it works...

    Mapping Neo4j to Java-annotated classes using Spring Data Neo4j

    Getting ready

    How to do it...

    Graph Entities

    How it works...

    Accessing the embedded Neo4j from Python

    Getting ready

    How to do it...

    How it works...

    Accessing Neo4j from Python using the REST bindings

    Getting ready

    How to do it...

    Annotate the Python object model to the Neo4j graph database

    Getting ready

    How to do it...

    How it works...

    Accessing the embedded Neo4j from Ruby

    Getting ready

    How to do it...

    How it works...

    Accessing Neo4j from Ruby using the REST Bindings

    Getting ready

    How to do it...

    Accessing Neo4j from Scala

    How to do it...

    Accessing Neo4j from .NET

    How to do it...

    Accessing Neo4j from PHP

    Getting ready

    How to do it…

    Accessing Neo4j from Node.js

    Getting ready

    How to do it…

    3. The Cypher Query Language

    Introduction

    Creating your first node and relationship using Cypher

    Getting ready

    How to do it...

    How it works...

    Querying nodes and relationships using Cypher

    Getting ready

    How to do it...

    How it works...

    Deleting data from Neo4j using the Cypher query

    Getting ready

    How to do it...

    How it works...

    Boolean operators with Cypher

    Getting ready

    How to do it...

    How it works...

    Changing the order of results with Cypher

    Getting ready

    How to do it...

    How it works...

    Limiting and skipping results with Cypher

    Getting ready

    How to do it...

    How it works...

    Regular expressions with Cypher

    Getting ready

    How to do it...

    How it works...

    Aggregation with Cypher

    Getting ready

    How to do it...

    How it works...

    Combining results with Cypher

    Getting ready

    How to do it...

    How it works...

    Finding paths in Cypher along with their shortest route

    Getting ready

    How to do it...

    How it works...

    There's more…

    4. Data Modeling and Leveraging with Neo4j

    Introduction

    Data modeling with Neo4j – moving away from traditional SQL

    Getting ready

    How to do it...

    How it works...

    Aggregate versus connected data models

    Getting ready

    How to do it...

    How it works...

    There's more...

    The connected model

    The aggregated model

    The hybrid model

    Creating a binary search tree with Neo4j

    Getting ready

    How to do it...

    How it works...

    Healthcare data modeling with Neo4j

    Getting ready

    How to do it...

    How it works...

    See also

    Travel data modeling with Neo4j

    Getting ready

    How to do it...

    How it works...

    See also

    Social data modeling with Neo4j

    Getting ready

    How to do it...

    How it works...

    See also

    Retail data modeling with Neo4j

    Getting ready

    How to do it...

    How it works...

    See also

    5. Mining the Social Treasure

    Introduction

    Finding mutual friends with Neo4j

    Getting ready

    How to do it...

    How it works...

    Finding friends of friends with Neo4j

    Getting ready

    How to do it...

    How it works...

    Activity streaming with Neo4j

    Getting ready

    How to do it...

    How it works...

    Finding user similarity with Neo4j

    Getting ready

    How to do it...

    How it works...

    Network reachability with Neo4j

    Getting ready

    How to do it...

    How it works...

    6. Developing Location-based Services with Neo4j

    Introduction

    Installing the Neo4j Spatial extension

    Getting ready

    How to do it...

    How it works...

    There's more…

    Importing the Esri shapefiles

    Getting ready

    How to do it...

    How it works...

    There's more…

    Importing the OpenStreetMap files

    Getting ready

    How to do it...

    How it works...

    There's more…

    Importing data using the REST API

    Getting ready

    How to do it...

    How it works...

    There's more…

    Creating a point layer using the REST API

    Getting ready

    How to do it...

    How it works...

    There's more…

    Finding geometries within the bounding box

    Getting ready

    How to do it...

    How it works...

    There's more…

    Finding geometries within a distance

    Getting ready

    How to do it...

    How it works...

    There's more…

    Finding geometries within a distance using Cypher

    Getting ready

    How to do it...

    How it works...

    There's more…

    7. Visualization of Graphs

    Introduction

    Visualization using the Neo4j console

    Getting ready

    How to do it...

    How it works...

    Viewing your graph with Linkurious

    Getting ready

    How to do it...

    How it works...

    The Neo4j graph with Gephi

    Getting ready

    How to do it...

    How it works...

    Visualization with Neoeclipse

    Getting ready

    How to do it...

    How it works...

    8. Industry Usages of Neo4j

    Introduction

    Healthcare with Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    The social networking industry with Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    The travel industry with Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    E-commerce with Neo4j

    Getting ready

    How to do it...

    How it works...

    There's more…

    9. Neo4j Administration and Maintenance

    Introduction

    Deploying Neo4j over the Amazon EC2 Cloud

    Getting ready

    How to do it...

    How it works...

    There's more…

    Deploying Neo4j over the Heroku Cloud

    Getting ready

    How to do it...

    There's more…

    Deploying Neo4j over the Microsoft Azure Cloud

    Getting ready

    How to do it...

    There's more…

    Backups with Neo4j

    Getting ready

    How to do it...

    Neo4j backup with Community Edition

    Neo4j backup with Enterprise Edition

    There's more…

    Upgrading Neo4j to the latest version

    Getting ready

    How to do it...

    There's more…

    Neo4j's remote debugging setup

    Getting ready

    How to do it...

    There's more…

    Configuring secure access to your Neo4j instance

    Getting ready

    How to do it...

    There's more…

    10. Scaling Neo4j

    Introduction

    A bulk upload of the initial large dataset

    Getting ready

    How to do it...

    How it works...

    There's more…

    The high availability setup

    Getting ready

    How to do it...

    How it works...

    There's more…

    Handling high read loads

    Getting ready

    How to do it...

    How it works...

    There's more…

    Handling high write loads

    Getting ready

    How to do it...

    How it works...

    There's more…

    Optimizing the Cypher query for performance

    Getting ready

    How to do it...

    How it works...

    There's more…

    Index

    Neo4j Cookbook


    Neo4j Cookbook

    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: May 2015

    Production reference: 1260515

    Published by Packt Publishing Ltd.

    Livery Place

    35 Livery Street

    Birmingham B3 2PB, UK.

    ISBN 978-1-78328-725-3

    www.packtpub.com

    Credits

    Author

    Ankur Goel

    Reviewers

    Onofrio Panzarino

    Ignaz Wanders

    Commissioning Editor

    James Jones

    Acquisition Editor

    James Jones

    Content Development Editor

    Ruchita Bhansali

    Technical Editor

    Narsimha Pai

    Copy Editors

    Dipti Kapadia

    Rashmi Sawant

    Project Coordinator

    Kranti Berde

    Proofreaders

    Safis Editing

    Paul Hindle

    Indexers

    Hemangini Bari

    Rekha Nair

    Graphics

    Sheetal Aute

    Valentina D'silva

    Disha Haria

    Production Coordinators

    Komal Ramchandani

    Alwin Roy

    Cover Work

    Komal Ramchandani

    About the Author

    Ankur Goel has been passionate about software development for a long time. He is particularly interested in exploring upcoming technologies in the areas of big data, artificial intelligence, and machine learning. He started his career with CDAC High Performance Computing Lab, where he worked on the PARAM series of supercomputers and built real-world use cases around them. He has been working for start-up companies and research labs for most of his career.

    He also enjoys working with start-ups that are in the stealth mode stage, and helps them with their technology stack.

    He lives in the beautiful city of Chandigarh, India, with his pretty wife and cute newborn daughter.

    This book and all of the work that went on around it would not have been possible without the unconditional support of my wife, Pooja, and mother, Santosh. During this book, my daughter, Aradhita, came into our life, so I've been taking care of both the babies together, my first book and our first child.

    I would also like to thank the amazing people at Neo4j Technologies for introducing the power of graph databases to the world and also for keeping everyone on their toes by introducing cool features frequently.

    Special thanks to the reviewers and editors at Packt Publishing, especially Ruchita and Narsimha, without whose efforts this work would not have been possible.

    About the Reviewers

    Onofrio Panzarino is a programmer with 15 years of experience, working with various languages (mostly with Java), platforms, and technologies. Before receiving his master of science degree in electronics engineering, he worked as a digital signal processor programmer. Around the same time, he started working as a C++ developer for real-time embedded systems and PCs. Currently, he is working with Android, ASP.NET C#, and JavaScript. During these years, he gained a lot of experience in graph databases, particularly in Neo4j.

    Onofrio is the author of Learning Cypher, by Packt Publishing, in 2014. He also reviewed Fast ASP.NET Websites, by Manning Publications.

    He resides in Ancona, Italy. He is a speaker in the local Java user group and also a technical writer, mostly for Scala and NoSQL. In his spare time, he loves playing the piano with his family and programming with functional languages. His Twitter handle is @onof80.

    Ignaz Wanders is an enterprise architect who specializes in integration and data architectures. He is an expert in service-oriented architecture and in applying top-down methodologies to achieve his goals.

    Ignaz has great practical experience in ESBs, BPM, Neo4j, Java EE, and a wide variety of supporting frameworks and tools.

    He is a speaker at international conferences and his astronomical background facilitates a strong analytical mind and excellent problem-solving skills.

    Ignaz works for Archimiddle and offers consultancy to a variety of customers, ranging from government institutions to telecom and logistics.

    www.PacktPub.com

    Support files, eBooks, discount offers, and more

    For support files and downloads

    Enjoying the preview?
    Page 1 of 1