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

Dynamic properties for GraphObject in py2neo.ogm

With the ogm module of py2neo you can build objects for nodes in neo4j: class Person(GraphObject): __primarykey__ = 'name' name = Property() def __init__(self, name): self.name = name peter =…
Martin Preusse
  • 9,151
  • 12
  • 48
  • 80
2
votes
1 answer

How to pass parameter as property name in py2neo?

I get error while passing parameter as property name. I did not get any error while passing parameter as property value by writing {param}. But this is not working in the case of passing parameter as property name. Here is my code. query =…
2
votes
1 answer

ISSUE IN CONNECTING py2neo v4 to my neo4j server

I want to connect my neo4j's project server to py2neo in jupyter I actually have 2 problems: Given below is a picture of my neo4j browser connected with bolt//:localhost:11004, username: neo4j, password: password But i am not able to connect to…
2
votes
1 answer

Which neo4j python driver to use for a spatial GraphQL project

I’m starting a new project that will provide geographic data through a read-only GraphQL api. The proposed technology stack currently consists of: Neo4J Python 3.6 Flask Graphene Where I’m having trouble is deciding on which driver to use: The…
geoAndrew
  • 347
  • 1
  • 12
2
votes
2 answers

How I can close the connection in py2neo?

Just I want to know how to close the connection in py2neo. graph = py2neo.Graph(password = 'xxxxx',host = 'xxxx') I try to use graph.close() But I receive the next msg. AttributeError: 'Graph' object has no attribute 'close' Lib version :…
nguaman
  • 925
  • 1
  • 9
  • 23
2
votes
1 answer

Unable to connect py2neo v3 with neo4j 3.4.1

I have been trying to connect to my local neo4j server using py2neo v3 and neo4j version 3.4.1. The commands I used are:- from py2neo import Graph, Node, Relationship graphURL='http://localhost:7474/db/data/' graphUser = "neo4j" graphPassphrase =…
2
votes
1 answer

How to create one node in py2neo correctly?

I just test py2neo demo,but failed,code is : from py2neo.data import Node, Relationship import py2neo g = py2neo.Graph('http:/172.18.0.52:7474', user='neo4j',password='123') a = Node("Person", name="Alice") b = Node("Person", name="Bob") ab =…
Cherrymelon
  • 412
  • 2
  • 7
  • 17
2
votes
2 answers

collapsing two nodes to one node in py2neo & neo4j

I need to collapse two nodes to a one node. I have gone this far "below" but I could not achieve what i want. For example I want to collapse "guy" node and "love" node to a new node preserving the path.
practitioner
  • 412
  • 1
  • 5
  • 12
2
votes
1 answer

Efficient way to create relationships in neo4j

I have a neo4j database populated with thousands of nodes without any relationship defined. I have a file which contains relationships between nodes, so I would like to create relationships between these nodes created in the database. My current…
Jausk
  • 325
  • 1
  • 3
  • 11
2
votes
1 answer

py2neo connection error (authentication error)

I've been trying to connect to neo4j, authenticate and create nodes with various properties. neoj is working fine in http://localhost:7474/. I've subbed mypassword in for my actual password below (I'm pretty sure its not a password issue as I've…
Owen
  • 169
  • 4
  • 16
2
votes
2 answers

neo4j: Failed to connect to DB [py2neo]

I was trying to connect neo4j by py2neo. But got some errors saying hostname or nodename not found...... I tried the below codes to connect but neither was working graph = Graph() #graph =…
mlo0424
  • 359
  • 2
  • 4
  • 16
2
votes
1 answer

Cypher - Convert graph result to list or JSON

I have the following Neo4j graph result. I 'm using the multiple relationship -[RELATED_TO*]- command to obtain that. Match(n:Comment) MATCH(n)-[RELATED_TO*]-(d:Comment) return n, d; I want to display the results in a List where I could say…
Felipe Santiago
  • 414
  • 6
  • 16
2
votes
1 answer

Create multiple nodes with a parameter for their properties in Neo4j with Python

I am trying to implement this very same scenario in Python: https://neo4j.com/docs/developer-manual/current/cypher/clauses/create/#create-create-multiple-nodes-with-a-parameter-for-their-properties What I am trying to do is to insert in a graph all…
bidi
  • 150
  • 1
  • 14
2
votes
1 answer

Print critical path IDs using both Python and py2neo

I ran this query by using py2neo myQuery = "MATCH p=(:Task {activity: 'Start'})-[:RELATIONSHIP*]->(:Task {activity: 'Finish'}) "\ "WITH p, REDUCE(x=0, a IN NODES(p) | x + a.duration) AS cum_duration ORDER BY cum_duration DESC "\ …
2
votes
1 answer

py2neo query subgraph from Neo4j

I want to query a subgraph from a large graph data base with a given source. Say I want the top 25 neighbors of a given node, along with all the relations among this set of nodes, how should my query be? At the moment I have: MATCH (source…
thomas zhang
  • 165
  • 1
  • 1
  • 7