The most suitable way to use Neo4j with Python in 2015

I use the latest Neo4j community (2.2.0-M03) to store my charts. I am interested in accessing it with Python. According to the official Neo4j documentation, there are several alternatives.

From what I understood, checking the docs, playing a little and checking out this post , py2neo is the only one supporting Neo4j 2 (and tags). However, if I want to write and run certain algorithms on Neo4j, I have to use Gremlin via Bulbs, but it doesn't seem to support Neo4j 2.

Now, I would like to use some custom algorithms that are not currently running on Neo4j, for example, Activating Newsletters. Is writing algorithms directly in Neo4j in Java and running them from Python using cypher commands via py2neo the only alternative? Did I miss something?

Greetings

PS. I wanted to publish links to all the software that I cited, but, unfortunately, I need at least 10 reputations to post more than two links ...

+5
source share
1 answer

This is a very complex question, it seems you need a design guide, not a quick neo4j question. Depending on how you use distribution activation, itโ€™s better not to change the server, but I canโ€™t say because your use case is probably involved. Keep in mind that you can always use neo4j as a graph repository, and then put higher-level concepts, such as activating the extension in the application code, rather than on the server.

The question suggests that I think you want to put it on the server. So what are the options? In general, you could write a server plug-in and extend the RESTful API (which would not help you with py2neo). On the other hand, I donโ€™t think that you can now configure your own custom cypher function, so you cannot change the cypher language first, then use the py2neo bindings to use the new cypher functionality. The recommendation given elsewhere suggests that you can consider an unmanaged extension to implement extension activation. If you did, again, I donโ€™t see how py2neo will help you.

In the short term, I think you should think about NOT modifying neo4j itself, but instead include activating the extension in the python code that possibly uses py2neo. Long-term, if neo4j offers a way to do custom cypher (UDF) functions, which I understand is in the development roadmap (maybe?), Then this might be a better option, but I would not recommend it without many more requirements and details.

+4
source

Source: https://habr.com/ru/post/1212244/


All Articles