How do I connect to a remote Neo4j database using gremlin python?

随声附和 提交于 2019-12-07 03:26:45

问题


From what I've read Neo4j implements apache tinkerpop which leads me to think I can use gremlin python and rather than connect to a gremlin server I can point the python code at a neo4j server and treat it like a gremlin server.

However I can't find any information online which shows how to do this so I'm thinking maybe I've misunderstood something.

  • a) Can I use gremlin python directly with a neo4j db instance?
  • b) If yes to (a) then how?

Thanks

Alex


回答1:


You can not connect gremlin-python to Neo4j Server. gremlin-python contains drivers that connect to Gremlin Server so you must have that installed for gremlin-python to work. Given that you need Gremlin Server you must choose one of the following options all of which are just Gremlin Server configurations:

  1. Configure Neo4j in embedded mode within Gremlin Server. An example of this is here where that file points to a Neo4j configuration file. Note that these files are packaged in the Gremlin Server distribution as samples so you can run them directly quite easily.
  2. Modify the aforementioned Neo4j configuration file to run Neo4j in HA mode effectively turning Gremlin Server into a node in the Neo4j cluster.
  3. Configure a neo4j-gremlin-bolt instance which will use the Neo4j Bolt protocol to connect to the running Neo4j Server. While I"m not completely familiar with this implementation, I can see that you would change the gremlin.graph to com.steelbridgelabs.oss.neo4j.structure.Neo4JGraph and that you would discern Bolt configuration options from this class (which instantiates that graph instance).

Once you've chosen one of those configuration options you can then use gremlin-python to work with Neo4j.



来源:https://stackoverflow.com/questions/47843862/how-do-i-connect-to-a-remote-neo4j-database-using-gremlin-python

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!