Book Image

Neo4j Cookbook

By : Ankur goel, Ankur Goel
Book Image

Neo4j Cookbook

By: Ankur goel, Ankur Goel

Overview of this book

Table of Contents (17 chapters)
Neo4j Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Importing data using the REST API


The recipes that you have learned until now consist of Java code, which is used to import spatial data into Neo4j. However, by using any other programming language, such as Python or Ruby, spatial data can be easily imported into Neo4j using the REST interface.

In this recipe, you will learn how to import geospatial data using the REST interface.

Getting ready

Perform the following steps to get started with this recipe:

  1. Install Neo4j using the recipes from Chapter 1, Getting Started with Neo4j. This installation process will depend on your preference for your machine OS type.

  2. Install the Neo4j Spatial plugin using the Installing the Neo4j Spatial extension, recipe from this chapter.

  3. Restart the Neo4j graph database server:

    $NEO4J_ROOT_DIR/bin/neo4j restart
    

How to do it...

Using the REST API interface is a very simple three-stage process to import the geospatial data into the Neo4j graph database server. For the sake of simplicity, the code of the Python language...