3

Currently I am doing research about graph databases. A requirement was that it must have stable bindings with C#/.NET, and should have the possibility to use in production. So I stumbled on Neo4j with the .NET community driver. Which is great, but I need to traverse the tree imperative which could only achieved with the Traversal Framework of Neo4j. Then I stumbled on Gremlin / Tinkerpop. I know Neo4j supports Tinkerpop (or atleast in previous versions). I have tried several approaches to accomplish this, but none seems to work.

So my question is: Is there anyway to use Gremlin for Neo4j 3.5.0 (on windows 10)? And how can this be achieved? And if this is not possible anymore? Do you know any alternatives (CosmosDB is to expensive for a proof of concept)?

Thanks in advance!

Jeroen

M1sterPl0w
  • 193
  • 3
  • 14
  • What did you try so far ? Have you followed the documentation : https://tinkerpop.apache.org/docs/current/reference/#neo4j-gremlin – logisima Feb 08 '19 at 09:12
  • @logisima Thanks for you reaction and time. I have followed this documentation, but this didn't worked out for me. First I've tried to install the plugin in the Gremlin console. Because that looked more convenient, rather than use the Gremlin server and host Neo4j on it. I saw some messages (sorry I have seen to much pages, articles and documentation to remember where) that on Neo4j server a Tinkerpop plugin must be installed, and the current one is outdated. Maybe I should mention it earlier but I'm using a community desktop version. In the Gremlin console the plugin was installed succesful, – M1sterPl0w Feb 08 '19 at 10:20
  • @logisima ...but I cannot connect to a database. The databases are stored in a strange path: C:\Users\user\.Neo4jDesktop\neo4jDatabases\database-26283eeb-8011-49b7-b62a-432ede2b5e4d\installation-3.5.0. – M1sterPl0w Feb 08 '19 at 10:21

1 Answers1

4

This issue almost always boils down to one of two things:

  1. The Neo4j version - you must connect to a Neo4j version that is compatible with the one bound to the neo4j-gremlin dependency which at this point is 3.2.3. There is an effort to upgrade that here. If 3.2.3 does not work with the version you are using, you will have problems (i.e. the same problems you would have if you tried to use Neo4j 3.2.3 with that newer version).
  2. The path to the database - Opening the database requires that Gremlin can find it. To start consider copying the Neo4j database directory to somewhere less "strange" and try to connect it. Then, once that is confirmed as working, figure out what Windows pathing might be causing the problem. Some searches of the gremlin-users mailing list should reveal solutions to many of these problems as this issue has come up before - here is a recent one for example.

Here's a working example:

gremlin> graph = Neo4jGraph.open('c:\\tmp\\neo4j')
==>neo4jgraph[community single [c:\tmp\neo4j]]
gremlin> g = graph.traversal()
==>graphtraversalsource[neo4jgraph[community single [c:\tmp\neo4j]], standard]
gremlin> g.addV('person').property('name','stephen')
==>v[0]
gremlin> g.V()
==>v[0]
stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • Thanks for your reaction. I have tried what you suggest and I have some questions regarding it: 1) Is neo4j-gremlin save for production? 2)I tried to install an older version of Neo4j (neo4j CE 3.2.13 (I couldn't find 3.2.3). I've followed the documentation Logisima refereed too. So I used the Gremlin Console, installed and used the neo4j-gremlin 3.4.0. Now I want to connect with the database and again without success. Path to DB is: '/neo4j/data/databases/graph.db' everything is default except credentials, those are neo4j and pass is root. Sorry for my noobness. – M1sterPl0w Feb 11 '19 at 08:16
  • 1. i have no reason to believe that you cant use it in production. 2. please consider simplifying things. forget about downloading/install old versions of neo4j or including credentials. start with just this: http://tinkerpop.apache.org/docs/current/reference/#neo4j-gremlin and get neo4j working in the console. – stephen mallette Feb 11 '19 at 12:07
  • 1
    Like a mentioned before: tinkerpop.apache.org/docs/current/reference/#neo4j-gremlin didn't worked out for me. This includes the simplified approach. I have been scrolling for a week through similar problems from other people and newbie unfriendly documentation, without any results. So I will stick to and advice Cypher en Neo4jClient (.NET). Anyway, thanks for your time. – M1sterPl0w Feb 11 '19 at 13:15
  • you don't say what error you are getting with those instructions. – stephen mallette Feb 11 '19 at 14:13
  • I do not get any useful errors. But here is a [screenshot](https://i.imgur.com/H9zG5Ff.png) of my Windows terminal. Also I cannot display the stack trace. Which makes debugging impossible. – M1sterPl0w Feb 11 '19 at 14:50
  • huh - interesting that "y" doesn't display the stack trace on windows. wasn't aware of that, but that's probably a problem with groovysh and not Gremlin. anyway, just aren't setting a proper windows file path. updated my answer a little bit to include an example. – stephen mallette Feb 11 '19 at 15:40
  • Thanks for your help. I think I found the problem. I downloaded the gremlin console from [the official Apache Tinkerpop page](http://tinkerpop.apache.org/downloads.html). I downloaded from the [Tinkerpop GitHub page](https://github.com/apache/tinkerpop) and build the console. This console works right away [screenshot](https://i.imgur.com/GTXGeMU.png). I am not sure that it uses the actual neo4j database because I cannot get Stephen in the Neo4j browser (MATCH (n) RETURN n). – M1sterPl0w Feb 12 '19 at 08:00