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
1
vote
1 answer

Neo4j.rb How to merge two realtionship between node

class User include Neo4j::ActiveNode has_many :in, :homes, origin: :owner has_many :in, :shared_homes, origin: :home_mates, model_class: 'Home' end class Home include Neo4j::ActiveNode has_many :out, :housemates, type: :home_mate,…
Vishal G
  • 1,521
  • 11
  • 30
1
vote
1 answer

What's the best way to create Models using Neo4j.rb for an existing Neo4j database?

To create nodes in Neo4j with the Neo4j.rb gem, for an empty database, you'd first define the model class as seen in the examples here: http://neo4jrb.readthedocs.io/en/7.2.x/ActiveNode.html Let's say you have a work project with an existing Neo4j…
Grace
  • 33
  • 2
1
vote
1 answer

Neo4jrb with rails --api: return connected nodes

Super simple setup: Created a new rails app with --api and added the generator/framework Created a single model (Artefacts) with a name attribute and a has_many relationship to other Artefacts (boringly named .artefacts) Created 2 nodes, and joined…
joshfindit
  • 611
  • 6
  • 27
1
vote
0 answers

Rails on Neo4j, using Devise -> undefined method `find_for_oauth' for Neo4j

Running rails 4.2.6, ruby 2.3.1p112 with Neo4j Community edition. On callback from Facebook I get this error: undefined method `find_for_oauth' for Neo4j::Shared::Identity:Module On models/user.rb: identity = Identity.find_for_oauth(auth) My files…
user844214
  • 21
  • 1
1
vote
0 answers

Java Error in Neo4j Rails Not Allowing Server to Start

I'm using Neo4j for my rails app. It was working fine a few days ago, but when I tried to start the server today, it wouldn't start. I checked out the log and got this error Exception in thread "Thread-11" java.lang.RuntimeException:…
1
vote
1 answer

Neo4jrb: a way to query for the model_class while doing collection_select

Is there a way to have a couple generic lines of code that can return results from the correct model_class based on the the model definition, and not on the lines of code? Right now, I'm using a generator to create: <%=…
joshfindit
  • 611
  • 6
  • 27
1
vote
3 answers

Neo4jrb - Cypher query

I have a database like in this question: Neo4j - Finding the Shortest Path between two nodes based on relationship property CREATE (some_point_1:Point {title:'Some Point 1'}) CREATE (some_point_2:Point {title:'Some Point 2'}) CREATE…
Jett Kam
  • 77
  • 1
  • 5
1
vote
1 answer

neo4jrb - Save ActiveRel property from node

I have a ActiveNode like this: class Nodeexample include Neo4j::ActiveNode property :name validates :name, :presence => true has_many :in, :nodeexamples, rel_class: :SomeRel end and a ActiveRel model like this: class SomeRel include…
Jett Kam
  • 77
  • 1
  • 5
1
vote
1 answer

How can I use order and find_each in neo4j.rb, Rails?

I use Neo4j.rb in Rails. I am trying this code. Person.all.order("n.score").find_each or Person.order(score: :asc).find_each But,its does not get person order by.
1
vote
1 answer

undefined method `find_by' for nil:NilClass when using `model_class: false`

undefined method 'find_by' for nil:NilClass Extracted source (around line #38): def update respond_to do |format| if @tag.update(tag_params) format.html { redirect_to @tag, notice: 'Tag was successfully updated.' } format.json {…
joshfindit
  • 611
  • 6
  • 27
1
vote
1 answer

Neo4jrb: Enumerator for model_class: false

When specifying a model_class of false, it's expected that the connection from this node to another could be any other class of node. Is there a reciprocal enumerator so that we can call something like: ActiveNodes.all when giving the user a…
joshfindit
  • 611
  • 6
  • 27
1
vote
1 answer

How to get value of field from Neo4j database by neo4j.rb in Rails?

Which method has neo4j.rb to get value of field from Neo4j database?
Dan Mukh
  • 35
  • 4
1
vote
2 answers

How to format output (Remove session data) of custom cypher query with Neo4j::Session.query

I'm using Neo4jrb/Neo4j-core for custom cypher querying in my Rails application. I use this output as json. However, everytime I run a query Eg: output_hash = Neo4j::Session.query("Match (n) return n limit 1;") Along with the results I also get a…
Nein
  • 389
  • 2
  • 4
  • 12
1
vote
1 answer

Neo4j.rb returns models with incorrect class for nodes with multiple labels

I have two ActiveNode models: class Company include Neo4j::ActiveNode end and class Entity include Neo4j::ActiveNode end They correspond to the labels "Entity" and "Company", which are attached to the same node. So, a node and be an entity…
1
vote
1 answer

Searching nth-level friends in neo4j.rb in bi-directional relationship graph

I have a User class defined as below class User include Neo4j::ActiveNode include Neo4j::Timestamps property :user_id, type: Integer, constraint: :unique property :max_friends_count, type: Integer, default: 5 validates :user_id, :presence…