O'Reilly logo

Neo4j Cookbook by Ankur Goel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Accessing Neo4j from Ruby using the REST Bindings

In this recipe, we will learn how to access the Neo4j graph database server from Ruby using the REST bindings.

Getting ready

The Neo4j REST server can be accessed using an excellent neography gem module, which claims to be a thin wrapper over the Neo4j REST API interface.

The following steps will get you started with neography gem:

  1. The neography gem modules can be installed on the machine using the gem install command:
    gem install 'neography'
    
  2. The neography module also requires the gem module in the Ruby code, so configure and initialize the neography gem modules with the following code:
    @graph = Neography::Rest.new({ :protocol   => 'http://',
                                   :server     => IP_ADDRESS,
                                   :port       => PORT,
    })

How to do it...

Follow ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required