Questions tagged [py2neo]

Py2neo provides Python bindings for the Neo4j graph database via its REST web service interface.

Py2neo provides Python bindings for the Neo4j graph database via its REST web service interface. With more detailed information available from py2neo.org, the source code can be found on GitHub and an installable package from the Python Package Index.

The library provides both in-depth support for the Cypher query language as well as the Geoff graph data notation.

729 questions
3
votes
0 answers

Working with Python objects and Neo4j - ability to store objects such as pandas dataframes/dictionaries

I'm working with a neo4j graph, using py2neo. I understand that neo4j only supports simple properties, but I have a use case where I need to store dictionaries and pandas dataframes with a large number of nodes. For dictionaries I can encode the…
ceharep
  • 419
  • 1
  • 5
  • 12
3
votes
1 answer

connection pool life cycle of py2neo.Graph: would the connections be released when the instance is no longer referenced by programmer?

Recently I found a possible http connection leak issue in my code. I received "Connection pool is full, discarding connection" message in my log but there is few concurrent request in my code. Actually I'm creating a py2neo.Graph instance every…
Alex
  • 335
  • 2
  • 12
3
votes
0 answers

py2neo MERGE causes ConstraintValidationFailed Node already exists when parallelizing

I am trying to parallelize a graph creation query using MERGE using multiple processes, in py2Neo. Here is the request: def add_edge(start_node_name, start_type, end_node_name, end_type): statement = """MERGE (A:Entity{Name:{Start},…
Spider
  • 875
  • 2
  • 9
  • 27
3
votes
1 answer

How to check connection from Python to Neo4j

I'm doing a microservice in Python 3.7 that connects to a Neo4j database. It's the first time I work connecting Python with Neo4j and I'm using py2neo version 4.3.0. Everything works OK, but now to adhere to the standard, I need to create a…
alejomarchan
  • 368
  • 1
  • 10
  • 20
3
votes
0 answers

how do i avoid over witting of relationship in neo4j using python, py2neo.ogm

So i have an array already defined and want to create relationship between the array objects and the nodes already created using python py2neo model ( i am using loop ), but i am unable to do so. the outcome is the relationship keeps on getting…
3
votes
1 answer

how can I refactor this py2neo v4 code to use neo4j 3.4 temporal data types?

I'm stuck trying to add a date_accepted property to an upload node that represents a scientific paper. Previously, I would have just added a timetree node. However, py2neo v4 no longer supports GregorianCalendar (shame). How would I convert this…
user1613312
  • 374
  • 2
  • 15
3
votes
1 answer

Query writing performance on neo4j with py2neo

Currently im struggle on finding a performant way, running multiple queries with py2neo. My problem is a have a big list of write queries in python that need to be written to neo4j. I tried multiple ways to solve the issue right now. The best…
Bierbarbar
  • 1,399
  • 15
  • 35
3
votes
4 answers

Py2neo (V4) - AttributeError: 'Graph' object has no attribute 'find_one'

I am trying to update the neo4j-flask application to Py2Neo V4 and i could not find how the "find_one" function has been replaced. (Nicole White used Py2Neo…
otluk
  • 317
  • 1
  • 4
  • 16
3
votes
4 answers

Py2Neo Merge using multiple property keys

I have been trying to use the merge method to create a node using the Py2Neo driver but am having issues. I try tx.merge(a,"Person",('name','age')) but get the error: TypeError: tuple In the merge documentation: here it says "Note that multiple…
John
  • 118
  • 3
  • 11
3
votes
0 answers

Flask extensions, context and Neo4j

The goal is to write a simple Flask extension. I'm using the Flask Extension Development reference as a guide. I've also studied the flask-sqlalchemy and flask-mongoengine source code for clues. My problem is using the Neo4j connection outside of…
Jason Strimpel
  • 14,670
  • 21
  • 76
  • 106
3
votes
3 answers

How to convert py2neo.database.cursor class to a dictionary or list in python?

Using graph.run() py2neo v3 to connect to neo4j DB: How can I convert an instance of py2neo.database.Cursor class to a dictionary or list in python? Was simple in py2neo v2 using py2neo.cypher.core.RecordList class which is what…
user1613312
  • 374
  • 2
  • 15
3
votes
1 answer

How to combine cypher queries into a transaction in Py2neo v3

In py2neo v2.0, it was possible to use a transaction to execute Cypher statements: tx=graph.cypher.begin() tx.append("MERGE (n:Process {proc_nm : {proc_nm}}) ON CREATE SET n.count = 1 ON MATCH SET n.count = n.count +1", {proc_nm :…
3
votes
2 answers

How to get automatic node ID from py2neo?

I'm using py2neo 3.1.2 version with Neo4j 3.2.0 and I have a question about it. At Neo4J's web interface I can run the following query to get the nodes ids: MATCH (n:Person) RETURN ID(n) I'd like to know if there's something at py2neo API that…
bernardofontes
  • 327
  • 4
  • 10
3
votes
1 answer

bulk write in py2neo from a list

I have the following data, which represents the distances between two objects. data = [[('123','234'), 10], [('134','432'), 12], ] I would like to insert this into neo4j via py2neo v3: for e, p in enumerate(data): # id_left …
elelias
  • 4,552
  • 5
  • 30
  • 45
3
votes
2 answers

outputiing py2neo query as JSON

I have tried looking all over but to no avail. Below is my cypher query in py2neo: graph = Graph() In [6]: query = """Match (C:Customer)-[r:Customer_Send]->(Send:Customer) where C.Galactic_ID = '2000000000084001287' return Send.Galactic_ID """ In…
mysterious_guy
  • 425
  • 11
  • 23