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

neo4j: Deleting nodes within transaction causes exception

I have put together a simple test case: account = EmailAccount() account.email = "some@mail" assert db.account_by_mail("some@mail") == [] db.add_node(account) assert db.account_by_mail(account.email) == [account] db.delete_node(account)) assert…
poe123
  • 1,188
  • 8
  • 11
3
votes
1 answer

neo4j - localhost:7474 browser - which nodes are coloured? (py2neo)

neo4j - localhost:7474 browser - which nodes are coloured? (py2neo) I am creating a complex neo4j database with py2neo. So far I have 6 node indices and labels, and 5 relationship indices and labels. When I look through the localhost:7474/browser ,…
akrueger
  • 365
  • 3
  • 16
3
votes
1 answer

Multiple Databases in neo4j using py2neo

Is it possible to create multiple databases or instances in neo4j, similar to the way one can create multiple databases in mysql? I found the commentary at the link below, but despite the promising title, it did not seem to answer my question. I…
ELamar
  • 114
  • 11
3
votes
2 answers

How to insert Bulk data into Neo4j using Python

I want to insert some data into Neo4j using py2neo . Link to data file. I am new to Neo4j. Can someone tell me how to insert bulk data into Neo4j.Actually i want to do performance testing of Neo4j..... I have tried this but this is just for small…
Vaibhav Jain
  • 5,287
  • 10
  • 54
  • 114
3
votes
2 answers

The right way to hydrate lots of entities in py2neo

this is more of a best-practices question. I am implementing a search back-end for highly structured data that, in essence, consists of ontologies, terms, and a complex set of mappings between them. Neo4j seemed like a natural fit and after some…
thefurman
  • 31
  • 2
3
votes
1 answer

Are all data types strings in Neo4j accessed by py2neo through the REST API?

I have a query of this form creating a new node in neo4j: cypher.get_or_create_indexed_node(index="person", key="name", value="Fred", properties={"level" : 1} However, when I query Fred to inspect his properties, his level = "1" /with quotes/. It…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
2
votes
0 answers

When I import data to neo4j I got this error "AttributeError: 'NodeMatch' object has no attribute 'exists' "

The error is here result1 = matcher.match("regain", name=str(date_time[0])).exists() **This is my code:** import pandas as pd from py2neo import Graph, Node, Relationship, NodeMatcher graph = Graph("http://localhost:7474", username="neo4j",…
gxyme
  • 21
  • 2
2
votes
0 answers

Py2neo IndexError: index out of range on Graph.run with gds.alpha.allShortestPaths.stream

I'm try to run gds.alpha.allShortestPaths.stream in a py2neo.Graph instance That is my code: cypherCode = """CALL gds.alpha.allShortestPaths.stream({ nodeQuery: 'MATCH (n:AUTHOR) RETURN id(n) AS id', relationshipQuery: 'MATCH…
L.Stefan
  • 341
  • 1
  • 14
2
votes
1 answer

how do I create unique constraints on two properties in neo4j?

I'm using nodes as intermediate path elements, but I want to make sure the start/end are unique. How do I create a constraint that requires TWO values to be checked? I can set individual ones but can't see syntax for a two-part constraint. …
dcsan
  • 11,333
  • 15
  • 77
  • 118
2
votes
1 answer

No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER

Im using py2neo(2020.1.0) to connect and make queries in Neo4j, Getting below error No write operations are allowed directly on this database. Writes must pass through the leader. The role of this server is: FOLLOWER I use neo4j+s: scheme to…
Selvakumar Ponnusamy
  • 5,363
  • 7
  • 40
  • 78
2
votes
1 answer

Get the nodes which are all connected with my input node using py2neo and flask

I want to fetch the connected nodes from ny neo4j database. For example If I give the input as 2 and then I have to fetch 1,3,4 and 5.I tried to explore the question but answer is related to neo4j only. I need a query with py2neo. is there anyway i…
user11862294
2
votes
1 answer

The Id column get a value of None in py2neo.ogm

I'm working with the interface py2neo to access the neo4j database out of python. I want to used the autogenerated Id column in an OGM model as a property. But my idea doesn't work. Please look a the example: from py2neo import Graph, Node,…
Ralf
  • 21
  • 1
2
votes
1 answer

Neo4j query taking long time

I am currently working on a social media site which exactly the same in terms of users' timeline, like user can follow, create, share the posts, block, unblock, etc. So for that, we have created 2 types of labels "User" and "Post" and have several…
Amit Sharma
  • 2,297
  • 3
  • 19
  • 25
2
votes
1 answer

Insert Property Value using Py2neo

I have one label say User,and one property say Email.I am trying to insert one property value based on user input like "abcd@gmail.com" . My code is below db=Graph("bolt://localhost:1234", user="", password="") db.evaluate('''Create (u:User) WHERE…
Soham
  • 4,397
  • 11
  • 43
  • 71
2
votes
0 answers

Create node only if it doesn't exist in py2neo v4

My understanding of neo4j is that we can use Merge to add a node in such a way that we won't get duplicates. The py2neo v4 documentation says that For a GraphObject, create and merge are an identical operation Yet when I execute the following…
theQman
  • 1,690
  • 6
  • 29
  • 52