Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
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 (http://docs.neo4j.org/chunked/milestone/). Just that you know what you are dealing with… a little example:
start s=node(1) match s-[:friends]-d return d order by d.name 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"
.
# Class definition
class Instrument < Architect4r::Model::Node
# Properties
property :name, :cast_to => String, :localize => true
property :name, :cast_to => String, :localize => :de
timestamps!
# Validations
validates :name, :presence => true
end
# Interfacing with the I18n class
I18n.locale = :en
# Working with a record
instrument = Instrument.new
instrument.name = "Piano"
instrument.name(:de) = "Klavier"
instrument.valid?
instrument.save
# Updating attributes
instrument.update_attributes(params[:instrument])
# Finding records
Instrument.find_by_id(123)
class Fanship < Architect4r::Model::Relationship
# Properties
property :created_at, :cast_to => DateTime
property :reason, :cast_to => String
end
# Init a class based relationship
Fanship.new(@user, @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 = File.open('log/output.log', File::WRONLY | File::APPEND)
logger = Logger.new(file, '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.
FAQs
Unknown package
We found that architect4r demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.