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
0
votes
2 answers

How to perform an atomic update on relationship properties with Py2neo

I'm trying to update some properties in a Neo4j graph using Py2neo. I'd like to perform an atomic counter increment, then update some other properties only if the counter is a certain value. I also need to do this in a thread safe way so that other…
LaserJesus
  • 8,230
  • 7
  • 47
  • 65
0
votes
1 answer

How to Set a property on a node based on function argument

Trying to write a generic function in py2neo that can update any node property in Neo4j based on property and value passed in arguments. I tried something like this def updateUserProfile(self, property, value): query = """ MATCH (n {…
jas
  • 1,539
  • 5
  • 17
  • 30
0
votes
2 answers

Cannot import library Graph from python

I installed py2neo on Centos Red-hat .Now i'm trying to connect py2neo with Neo4j. I typed "python" in the Shell to open a python environment.Then "from py2neo import Graph". I get the following error :"cannot import name Graph". I don't know…
0
votes
1 answer

when using py2neo, Java memory keep increasing

I'm using web crawler(Scrapy) in python to continuously downloading data(words), and save the words as nodes into neo4j by py2neo at real time. My code simply looks like: graph = Graph("http://localhost:7474/db/data/") def create(graph,word): …
0
votes
1 answer

create too much relationship in neo4j take too much

I have a Neo4J database that contain about 90K Node (Which inserted using py2neo and collected from twitter). I want to create relationship between all pair of these nodes and initialize a specific value on the relationship base on Node. I do this…
Mohamad MohamadPoor
  • 1,350
  • 2
  • 14
  • 35
0
votes
1 answer

Using python list as node properties in py2neo

I have a list of urls: urls = ['http://url1', 'http://url2', 'http://url3'] Mind you the list can have any number of entries including 0 (none). I want to create new node property for each url (list entry). Example how the node will look…
abruski
  • 851
  • 3
  • 10
  • 27
0
votes
1 answer

UnicodeDecodeError while creating nodes in neo4j using python (py2neo)

Hey I was creating a set of nodes in neo4j using the py2neo package in python. A similar piece of code worked for another set of nodes but isn't working in this case. from py2neo import * rf = open('dataset.txt','r') sf =…
0
votes
1 answer

Specify a 'visit only once condition' on a node in neo4j using py2neo

So I have a graphdb that has multiple nodes and at most a single edge between each of the nodes. For gathering certain data, I need to visit all nodes, say something like a breadth-first search. For that, I am using match method of py2neo like…
gravetii
  • 9,273
  • 9
  • 56
  • 75
0
votes
1 answer

neo4j is taking too much time for the cypher query "MATCH (n:City{name : "hyderabad"})-[:CONTAINS]->(p:BusinessDetails) return p"

i am using neo4j community version , i am having 1 node of "City" , and approx 5000 nodes of "BusinessDetails" connected with realtion "CONTAINS" from "City" to "BusinessDetails" , when 1 am using the cypher query MATCH (n:City{name :…
aditya mathur
  • 75
  • 1
  • 2
  • 6
0
votes
1 answer

Multiple variables in cypher query (name, label) - py2neo

got another problem now. I'd like to create a working HTML form where user can enter name of the node, and through radioboxes to choose the label - and after submit it is created in neo4j. Following works: result = graph.cypher.execute("CREATE…
Pitr
  • 51
  • 1
  • 11
0
votes
2 answers

Create node and relationship given parent node

I am creating a word tree but when I execute this cypher query: word = "MATCH {} MERGE {}-[:contains]->(w:WORD {{name:'{}'}}) RETURN w" .format(parent_node, parent_node, locality[i]) where parent_node has a type Node It throws this…
blackmamba
  • 1,952
  • 11
  • 34
  • 59
0
votes
2 answers

Find node using another node and relationship

How to check whether a node exists using relationship and other node of the relationship? A ->(IN) B I want to check if B is present with node A having relationship IN using py2neo I tried this cypher query: MATCH (a { name:'xyz'…
blackmamba
  • 1,952
  • 11
  • 34
  • 59
0
votes
1 answer

Create relationship on pre-existing node in py2neo

I am trying to create a simple graph in Neo4j. What I'm trying to do is create a node if it doesn't exist, and if it already exists, I want to connect a new node to it instead of creating a similar node. One node is a User node, the others are…
ramez
  • 321
  • 3
  • 22
0
votes
1 answer

Batch loading neo4j

I am batch loading a neo4j graph using py2neo using this script: batch = neo4j.WriteBatch(graph) counter = 0 for each in ans: n1 = graph.merge_one("Page", "url", each[0]) # batch.create(n1) counter +=1 for linkvalue in each[6]: …
Rob
  • 3,333
  • 5
  • 28
  • 71
0
votes
1 answer

Flask API breaks at long Cypher query

I'm building an API in Flask that talks to a neo4j db. One particularly large query (15 minutes+) breaks the API. Breaking means the Docker container in which it runs stops without logging the request. The trouble is I can't reproduce the error when…
Tom Rijntjes
  • 614
  • 4
  • 16