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 - How to display a property on a node, to identify easily in browser?

I have a sample graph, where it has two types of nodes, servers and services. Server and properties looks like: Server:{ "ip":"0.0.1.1"}, "location":"india", "uptime":"120", "services":["httpd","IPsec","irqbalance"], } Where the services…
Jack Daniel
  • 2,527
  • 3
  • 31
  • 52
3
votes
3 answers

Relationship to multiple types (polymorphism) in neomodel

Since 2014, there was an issue that relationship to multiple object types is not available: https://github.com/robinedwards/neomodel/issues/126 It's now 2016, and still I'm not aware of any solution regarding this critical issue. Example for…
Joe Down
  • 31
  • 3
3
votes
3 answers

Can we create a node in Neo4j having properties as dictionary using Python package py2neo?

I want to create a node having properties in dictionary using py2neo. query = CREATE (movie:Movie {'a': 'b', 'c': 'd'}) RETURN movie graph_db.cypher.execute(query) Then it given an error. So I need to change the properties of my node to {a: 'b',…
Har
  • 31
  • 1
  • 3
3
votes
1 answer

Neo4j: Multiple Relationships Merge Issue

I've a neo4j schema in which I've 3 nodes. e.g. p,b,c I want to write a Merge query such that MERGE (p)-[:has_b]->(b), MERGE (p)-[:has_c]->(c1), MERGE (p)-[:has_c]->(c2) where c1 and c2 are instance of c node having different property values. i.e.…
randomuser
  • 1,201
  • 2
  • 10
  • 19
3
votes
1 answer

import for py2neo.error.CypherExecutionException

I'm expectedly getting a CypherExecutionException. I would like to catch it but I can't seem to find the import for it. Where is it? How do I find it myself next time?
Tony Ennis
  • 12,000
  • 7
  • 52
  • 73
3
votes
1 answer

How do I count all the other nodes related to a specific node

The path is representing for users' browse history. The upper path means there's one user who has browsed page A -> page B -> page C The lower path means, one user browsed page X-> page Y -> page B -> page C For example, If I want to calculate the…
newBike
  • 14,385
  • 29
  • 109
  • 192
3
votes
1 answer

How could I create unique node with py2neo

Suppose I need to create unique node with email, If I run the following code, it will creat 2 nodes with the same email person_nod = Node("person", email="bob123@gmail.com") graph.create(person_nod) person_nod = Node("person",…
newBike
  • 14,385
  • 29
  • 109
  • 192
3
votes
1 answer

Py2neo - Drop all schema uniqueness constraints

I was wondering if there is a function to remove all uniqueness constraints of a SchemaResource, without specifying its labels and properties keys. It may be possible by retrieving Graph.node_labels, then iterate through them to find…
3
votes
3 answers

Can't delete neo4j nodes with a relationship using py2neo

I'm learning neo4j through the py2neo module. Modifying the example, I'm confused on why I'm getting an error here. If I want to delete all nodes of the Person type, why can I not iterate through the graph and remove the ones that match my criteria?…
Hooked
  • 84,485
  • 43
  • 192
  • 261
3
votes
1 answer

Python/Py2neo: weakref exception

I create relationships using Py2neo in the following way: article = graph.merge_one("Article", "id", aid) article2 = graph.merge_one("Article", "id", aid2) graph.create_unique(Relationship(article, "RELATED", article2)) But I get the following…
nickbusted
  • 1,029
  • 4
  • 18
  • 30
3
votes
1 answer

py2neo raised finished(self) error

Working with py2neo and I'm getting the error below when trying to append a transaction: statement ="MERGE (a:Person {name:\""+actorName+"\"}) "\ "\n"\ "MERGE (b:Series {title:\""+actorsFields[3]+"\",…
3
votes
1 answer

Neo4J / py2neo -- create `Relationship` in transaction?

Outside of a transaction I can do this: from py2neo import Graph, Node, Relationship graph = Graph() graph.create(Relationship(node1, "LINKS_TO", node2)) Can I do something analogous inside a transaction?: tx =…
Andrew Magee
  • 6,506
  • 4
  • 35
  • 58
3
votes
1 answer

Neo4J / py2neo -- cursor-based query?

If I do something like this: from py2neo import Graph graph = Graph() stuff = graph.cypher.execute(""" match (a:Article)-[p]-n return a, n, p.weight """) on a database with lots of articles and links, the query takes a long time and uses all my…
Andrew Magee
  • 6,506
  • 4
  • 35
  • 58
3
votes
1 answer

Creating unique relationship property in a FOREACH in neo4j

I am trying to accomplish something quite simple in python but not so in Neo4j. I'd appreciate any comment and suggestions to improve the procedure! Within Python script, I am trying to create a relationship as well as its property for every pair…
user4279562
  • 669
  • 12
  • 25
3
votes
2 answers

(py2neo) How to check if a relationship exists?

Suppose I have the following code: link = neo4j.Path(this_node,"friends",friend_node) #create a link between 2 nodes link.create(graph_db) #add the link aka the 'path' to the database But let's say later I call: link2 =…
V_TS
  • 149
  • 1
  • 11