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

Multiple types for each record in Neo4j.rb

I have a database currently represented as a set of YAML files (one record per file). I would like to port it into Neo4j. Each record has a property "type" which stores an array of types. I would like to have a module (that includes ActiveNode) for…
Sean Mackesey
  • 10,701
  • 11
  • 40
  • 66
1
vote
1 answer

Neo4j Paginated - undefined method 'total_pages' for

I am using Neo4j database and my Author class is including ActiveNode. I am looking to have the index with pagination. Here are the controller and the index for Authors: class AuthorsController < ApplicationController before_action :set_author,…
L.D
  • 1,279
  • 3
  • 15
  • 31
1
vote
1 answer

Filter Neo4j nodes that have no relationship with a certain node

I want to find all Foos that are not yet associated with my Bar. I use neo4j.rb (4.1.2) and Rails (4.2). The code I use now, that produces the right output but feels unoptimal is: @foos = Foo.all.find_all do |foo| …
Ed Ytterbrink
  • 376
  • 2
  • 10
1
vote
1 answer

Neo4j - Query results random order

I'm not exactly sure what's gone on inside my app but my queries don't seem to give me my results in order of creation. It recently rearranged itself without me changing the code related to the query. However, I've obviously done SOMETHING. At one…
Clam
  • 935
  • 1
  • 12
  • 24
1
vote
2 answers

Neo4j.rb : transfer all relationships before replacing a node by another

I'm trying to transfert all ingoing and outgoing relationships (including their properties) from a node to another, before deleting the first one. they both have the same label. The discussion started here : Neo4j Cypher : transfer all…
armedwing
  • 113
  • 1
  • 10
1
vote
1 answer

Neo4j, NoMethodError: undefined method 'outgoing' for

I have a small Neo4j database with two nodes: Author and Book. The relationship is that one or more authors authored books. From the rails console I am loading an Author node and I am getting a result a = Neo4j::Node.load(36) => #
LDB
  • 692
  • 6
  • 18
1
vote
1 answer

Neo4jrb Neo4j::Session::CypherError: uuid not defined

i try to create a custom getOrCreate method using find and if nothing is returned using create my class : class User include Neo4j::ActiveNode include Neo4jrbConcern property :name property :email validates :name, :presence => true …
armedwing
  • 113
  • 1
  • 10
1
vote
1 answer

Travis-CI "The command "bundle exec rake" exited with 1." + mystery 404 error

bundle exec rake runs all tests perfectly fine locally. However, Travis CI keeps blowing up with Problem accessing /authentication without giving much more info to go on. Here's one of the failed builds:…
Nase
  • 13
  • 1
  • 3
1
vote
1 answer

Neo4j gem - Create relationship between two nodes only if it doesn't exist

If I have two nodes (self) and friend_node, what's the most efficient way to do this check if I already know my two nodes. I built this off of what you taught me last time but this seems convoluted given that I know where my nodes are. Is there…
Clam
  • 935
  • 1
  • 12
  • 24
1
vote
1 answer

neo4j.rb check relation already exists between two nodes

I Need to check relation between two nodes exists already. brian.following << chris brian.following #=> chris I Need to check like this brian.following?(chris) #=> true brian.following?(john) #=> false Any method is there in neo4j.rb for this? if…
Raj Adroit
  • 3,828
  • 5
  • 31
  • 44
1
vote
1 answer

Neo4j.rb query in and out separately for both relationship

Here is my Neo4j Model class User include Neo4j::ActiveNode has_many :both, :followers, type: :following, model_class: 'User' end user1 has 2 out and 1 in like following user1 ---> user2 user1 ---> user3 user1 <--- user3 If I query like…
Raj Adroit
  • 3,828
  • 5
  • 31
  • 44
1
vote
2 answers

Neo4j gem - Handling collection query with index

To avoid making the last question full of edits, I am spinning off a new question on debugging this. Original question was this Neo4j gem - Plucking multiple nodes/relationships This is sorta where I ended up. There is some flaw with the day…
Clam
  • 935
  • 1
  • 12
  • 24
1
vote
1 answer

neo4j will_paginate gem installation issue

Running bundle install after including the gem gives me this Bundler could not find compatible versions for gem "activesupport": In Gemfile: neo4j-will_paginate (>= 0) ruby depends on activesupport (~> 3.0) ruby rails (= 4.1.6) ruby…
Clam
  • 935
  • 1
  • 12
  • 24
1
vote
2 answers

Neo4j gem - Plucking multiple nodes/relationships

This may not be possible as it is right now but I have a query like so events = Event.as(:e).where("(( e.date_start - {current_time} )/{one_day_p}) < 1 ").users(:u, :rel).where("rel.reminded = {reminded_p}" ).params(reminded_p: false, one_day_p:…
Clam
  • 935
  • 1
  • 12
  • 24
1
vote
1 answer

Neo4j gem - Query dependant on parameter values

This might not be as much neo4j as it is rails. But maybe I'm wrong I'm looking for suggestions on handling a situation when parameters are specific values. For example. In my query @friends_events = current_user.friends.events(:e,…
Clam
  • 935
  • 1
  • 12
  • 24