Database Reference
In-Depth Information
Listing 10-13. Querying with a Label
require 'neography'
neo = Neography::Rest.new({ :protocol => 'http://', :server => 'localhost', :port => 7474,
:directory => '/db/data'})
# find all developers
developers = neo.get_nodes_labeled("Developer")
# find all developers named Daniel
developers = neo. find_nodes_labeled("Developer", username: "Daniel")
Developing a Ruby and Neo4j Application
Preliminary to building out your first Ruby and Neo4j application, this section covers the basics of configuring a
development environment.
Again, if you have not worked through the installation steps in Chapter 2, please take a few minutes to do so.
Preparing the Graph
In order to spend more time highlighting code examples for each of the more common graph models, we will use a
preloaded instance of Neo4j including necessary plugins, such as the spatial plugin.
To quickly set up a server instance with the sample data and plugins for this chapter, go to graphstory.com/
practicalneo4j . You will be provided with your own free trial instance, a knowledge base, and email support from
Graph Story. Alternatively, you may run a local Neo4j database instance with the sample data by going to
graphstory.com/practicalneo4j , downloading the zip file containing the sample database and plugins, and
adding them to your local instance.
Tip
Using the Sample Application
If you have already downloaded the sample application from graphstory.com/practicalneo4j for Ruby and
configured it with your local application environment, you can skip ahead to the “Sinatra Application Configuration”
section. Otherwise, you will need to go back to the section in this chapter titled “ Ruby and Neo4j Development
Environment ” and set up your local environment in order to follow the examples in the sample application.
The sample application also contains a readme file with instructions on configuration as well as contact
information at graphstory.com for support.
Note
 
 
Search WWH ::




Custom Search