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
2
votes
1 answer

How to use graph.merge() py2neo v3 to replace graph.merge_one() in Nicole White's blog app

I am trying to recreate Nicole White's microblog application powered by Flask and Neo4j tutorial but using py2neo v3 rather than v2. I'm a novice but keen to understand & learn by tinkering... I know that graph.merge_one() has been replaced by…
user1613312
  • 374
  • 2
  • 15
2
votes
2 answers

Adding label in py2neo not working

I am using this code: n1 = Node("X", name=w1) graph.create(n1) n1.add_label(u2) But it's simply not adding this label u2, even from the Python prompt.
ugp
  • 119
  • 11
2
votes
0 answers

python async library for Neo4j

I am using p2neo for querying neo4j DB, some quires are taking more than a second to respond, is there any async library I can use with tornado framework to communicate with neo4j.
user2478236
  • 691
  • 12
  • 32
2
votes
1 answer

Keeping py2neo connection in Flask's application context

I'm using py2neo without a flask extension (since it behaves quite strangely) in my flask project. What I'm trying to do, is to preserve my database connection in the application context (since it is preserved during the entire request handling,…
user7225011
2
votes
1 answer

missing key `scheme` error while doing graph.run() in Neo4j

This is my py2neo code for creating a graph from a txt file: import csv import re from py2neo import Graph,Node,Relationship graph = Graph("http://localhost:7474/browser/") with open("<>") as infile: row_num = 0 for row in infile: …
2
votes
1 answer

py2neo: Get the get the end nodes from relationships and all incoming relationships without cypher

I having trouble finding the node that an node is in a relationship with. I want to be able to find the nodes with a relationship with selected node from the selected node. Here is an example graph Here is the code for the example graph: from py2neo…
James
  • 387
  • 1
  • 11
2
votes
1 answer

py2neo ogm incoming related is None, why?

I'm in trouble when i want to get incoming relation from a node with py2neo ogm. Here an exemple: class A1(GraphObject): rFrom = RelatedFrom("A2", "A2") class A2(GraphObject): rTo = RelatedTo("A1", "A1") a1 = A1() a2 =…
Col
  • 71
  • 7
2
votes
2 answers

Authorization (subgraph access control) in Neo4j with python driver

I have some employee data in which there are 3 different roles. Let's say CEO, Manager and Developer. CEO can access the whole graph, managers can only access data of some people (their team) and developers can not access employee data. How should…
2
votes
0 answers

Memory-exceeding on import in py2neo

I am using py2neo to import a large graph. This consists of over 10M records and relationships. As these are being imported via: tx = graph.begin() ... tx.commit() it seems like the memory used by the transaction is not being released. This brings…
nickygs
  • 47
  • 8
2
votes
1 answer

py2neo "ProtocolError: Server closed connection" when using Bolt

Recently a script which uses py2neo package and connects via the Bolt protocol began failing unexpectedly with a ProtocolError: Server closed connection, and I'm struggling to understand why. Note the script works when using HTTP as the…
John
  • 783
  • 6
  • 12
2
votes
2 answers

Importing neo4j with py2neo

I am unable to import 'neo4j' using py2neo. When I do the following; from py2neo import neo4j I get the error: cannot import name 'neo4j' My py2neo version is 3.1.2 The output for the following is: dir(py2neo) ['BoltDataSource', 'BoltNode',…
Jmj
  • 25
  • 1
  • 4
2
votes
1 answer

Change Node properties with py2neo transaction

I'm trying to update a node using py2neo as part of a transaction. The problem is I can't seem to find an equivalent of Graph.push() such as Transaction.Push(). Am I missing something obvious? My code at the moment looks like this, I'd like to…
c z
  • 7,726
  • 3
  • 46
  • 59
2
votes
0 answers

py2neo: create and export/save graph without using Neo4j in browser

I'm using py2neo with Neo4j v3. I load some CSV files, create indexes and do some matching: graph.run("MATCH (n) DETACH DELETE n") graph.run("LOAD CSV WITH HEADERS FROM 'file:///Users/samshort/Work/asi/project/neo4j-flask/ch_officer.csv' AS row…
Sam Short
  • 183
  • 1
  • 1
  • 9
2
votes
2 answers

py2neo SocketError: Connection refused, but curl works

I'm trying to get a Flask/Neo4j app set up on a remote Ubuntu server, and I've run into a problem that I haven't been able to figure out. My app uses py2neo, but when it tries to connect to the graph, the app crashes and the Neo4j process seems to…
Jeremy G.
  • 81
  • 2
  • 8
2
votes
2 answers

py2neo ogm Relationship with Multiple Node Labels

I would like to use OGM of py2neo to represent a relationship from one node type to two node types. I have a solution (below) that works only to store nodes/relationships in the DB, and I could not find one that works properly when retrieving…
gianko
  • 21
  • 1
  • 4