Architect4r Save

A ruby wrapper for the neo4j graph database which aims for easy rails integration.

Project README


Architect4r is intended as an easy ruby wrapper for the neo4j graph db REST API. There are other solutions such as neo4j.rb if you are working in a java environment or neography which provides another working wrapper for the REST API. Both solutions are far more feature complete and allow you to do pretty advanced queries on the graph.

Architect4r is trying to go another route. Instead of using the native graph traversal engine it requires you to write your queries in recently implemented cypher query language. The language is well documented at the official neo4j documentation ( Just that you know what you are dealing with… a little example:

start s=node(1) match s-[:friends]-d return d order by skip 0 limit 20

But please read the docs for more info.


You need a running neo4j installation.


In oder to work with architect4r you have to install the gem by using gem install architect4r or in case that you are using bundler, you can add the following line to your Gemfile: gem "architect4r".

Quick Start

# Class definition
class Instrument < Architect4r::Model::Node
  # Properties
  property :name, :cast_to => String, :localize => true
  property :name, :cast_to => String, :localize => :de
  # Validations
  validates :name, :presence => true

# Interfacing with the I18n class
I18n.locale = :en

# Working with a record
instrument = = "Piano" = "Klavier"

# Updating attributes

# Finding records

class Fanship < Architect4r::Model::Relationship
  # Properties
  property :created_at, :cast_to => DateTime
  property :reason, :cast_to => String

# Init a class based relationship, @instrument, { :reason => 'Because I like you' })


In order to log the debug output from architect4r to a logfile, just override the default logger instance. If you are using rails, you might wanna add this to an initializer:

# Create a logger instance
file ='log/output.log', File::WRONLY | File::APPEND)
logger =, 'daily')
logger.level = Logger::DEBUG

# Set architect4r logger
Architect4r.logger = logger


# Clone the repo and cd into it, then:
bundle install
bundle exec rake server:install
bundle exec rspec spec/

You can also use guard to run the specs continuously during development: bundle exec guard.


Architect4r is copyright (c) 2011 Maximilian Schulz. It is free software, and may be redistributed under the terms of the MIT License.

Open Source Agenda is not affiliated with "Architect4r" Project. README Source: namxam/architect4r
Open Issues
Last Commit
11 years ago

Open Source Agenda Badge

Open Source Agenda Rating