Search code examples
.netneo4jgraph-databasesgremlintinkerpop

How to use Gremlin in Neo4j for Windows or better alternatives?


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


Solution

  • 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]