Questions tagged [neo4j.rb]

Neo4j.rb is an Active Model compliant Ruby/JRuby wrapper for the Neo4j graph database. It uses the neo4j-core and active_attr gems.

Neo4j.rb is an Active Model compliant Ruby/JRuby wrapper for the Neo4j graph database.

https://github.com/neo4jrb/neo4j

175 questions
3
votes
2 answers

Export Neo4j.rb Nodes with Associations as JSON

I have an app that is using the Neo4j.rb gem in a Rails app on a smallish database with only a few thousand nodes/relationships and I'm now writing a batch upload and download script. Mostly for backup/migration purposes. I have 2 nodes for now-…
3
votes
1 answer

How to define these owner/member relationships in Neo4j.rb?

I'm trying to figure out how to define these owner/member relationships in my Neo4j.rb Active::Node models. Users can create many teams (and become the "owner" of those teams) Users can fetch the teams that they have created Teams have a single…
Andrew
  • 227,796
  • 193
  • 515
  • 708
3
votes
1 answer

Using has_many "both" in neo4j.rb

I'm looking for a way to set up a relationship between Users where you can use in, out, and both all at the same time in Neo4j.rb. Here's what I have so far: class User include Neo4j::ActiveNode has_many :both, :friends, type: :connection,…
bswinnerton
  • 4,533
  • 8
  • 41
  • 56
3
votes
1 answer

Neo4j Cypher : transfer all relationships before replacing a node by another

I'm trying to transfert all ingoing and outgoing relationships from a node to another, before deleting the first one. they both have the same label. I saw this Neo4j Cypher: copy relationships and delete node but in my case i don't know the type of…
armedwing
  • 113
  • 1
  • 10
3
votes
0 answers

Using Foreman with Sidekiq, Neo4j and Ruby on Rails

In a Rails project I'm currently using neo4j instead of ActiveRecord. I added the Sidekiq and Foreman to be able to start Sidekiq and Rails server at the same time. This is what I have in the Procfile: worker: bundle exec sidekiq web: rails…
mpartan
  • 1,296
  • 1
  • 14
  • 30
2
votes
1 answer

How to override ruby neo4j node primary id

I have the following model: class User include Neo4j::ActiveNode end and I simply want to specify the primary key at creation time: user = User.create(id: SecureRandom.uuid) However, this does not work and return Undefined properties: id. I have…
Pierre-Louis Gottfrois
  • 17,561
  • 8
  • 47
  • 71
2
votes
1 answer

Neo4j.rb: how to search from serialize property having array

class Picture property :name property :user_ids serialize :user_ids end Picture.create(name: '1', user_ids: [1,4,5]) How to find all pictures having user id 1 in user_ids property I am trying this in way: Picture.as(:p).where('ALL(x IN [1]…
Vishal G
  • 1,521
  • 11
  • 30
2
votes
1 answer

errors using neo4j gem for non-rails (ruby-only)

From the documentation: http://neo4jrb.readthedocs.io/en/8.0.x/Setup.html neo4j_adaptor = Neo4j::Core::CypherSession::Adaptors::HTTP.new('http://user:pass@host:7474') Neo4j::ActiveBase.on_establish_session {…
Satchel
  • 16,414
  • 23
  • 106
  • 192
2
votes
2 answers

Neo4j.rb (8.0.11) + Resque : Input/output error @ io_write -

I have recently upgraded neo4j and I am getting issue in resque workers, Exception Errno::EIO Error Input/output error @ io_write - I am getting this issue and backtrace says its related to neo4j.rb puts Errno::EIO: Input/output error -…
Vishal G
  • 1,521
  • 11
  • 30
2
votes
1 answer

Neo4j.rb : as_json how to ignore root?

For Active record its working fine ActiveRecord::Base.include_root_in_json = false User.first.as_json => { "id" => 1, "name" => "Konata Izumi", "age" => 16, "created_at" => "2006/08/01", "awesome" => true} When I use it for Neo4j.rb active…
Vishal G
  • 1,521
  • 11
  • 30
2
votes
1 answer

Rails Neo4j.rb Serializers?

In Active node how we can implement JSON serializers like active modal http://api.rubyonrails.org/classes/ActiveModel/Serializers/JSON.html Or any other way to send customized API response? Right now I am doing it by making custom method in…
Vishal G
  • 1,521
  • 11
  • 30
2
votes
1 answer

How to set "resultDataContents" in Neo4jrb?

I want to visualise data from Neo4j with the frontend-library D3.js in an Rails application, using Neo4jrb. For example I could use the following query to get my graph data. query = "MATCH path = (a)-[b]->(c) RETURN path" result =…
2
votes
0 answers

rake neo4j:install giving ArgumentError

I am working on a Windows 8 PC and am new to web development. I am following this tutorial to build a neo4j rails application. When I type the following into Powershell: rake neo4j:install[community-latest] I get the following error DL is…
2
votes
2 answers

Reconnect Neo4jrb connections after puma fork with preload_app?

Heroku suggests using it, but these problems I see all in my local dev environment I am using MRI 2.2.3 and neo4j.rb 6.0.0 (ActiveNode models) with the HTTP adapter I am also on OSX 10.11.2 with Neo4j 2.2.5 and jdk1.7.0_51-b53 I've tried lots of…
brucek
  • 726
  • 6
  • 9
2
votes
2 answers

Counting the results of a cypher query by range

I would like to count the results of my cypher query by range. Here's an example : let's say I've a list of books with the year of publication, I'd like to be able to count the number of books matching my cypher query published between 1970 and…
armedwing
  • 113
  • 1
  • 10
1
2
3
11 12