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

shortest path through weighted graph

I'd like to create a network optimization model that uses probability distributions instead of single-point estimates for the weights between nodes. To get started, I wrote a python script that builds a sample network in Neo4j: from py2neo import…
Alex Woolford
  • 4,433
  • 11
  • 47
  • 80
2
votes
1 answer

GrapheneDB Cypher transactions with py2neo

I'm running an app on Heroku using GrapheneDB, Tornado, py2neo. I'm trying to use py2neo's Cypher transactions. I can run this locally: graphenedb_url = os.environ.get("GRAPHENEDB_URL", "http://localhost:7474/") service_root =…
luisdaniel
  • 907
  • 11
  • 20
2
votes
1 answer

Py2neo cypher query results in _assert_unfinished. Can someone let me know why?

Hi I am trying to run this script by calling the method from another script session = cypher.Session("http://localhost:7474") tx = session.create_transaction() def nodepublish(dpid, port, mac, srcip): tx.append("MATCH (n:Switch) WHERE…
Kiran Vemuri
  • 2,762
  • 2
  • 24
  • 40
2
votes
1 answer

Write python namedtuples to csv to prevent UnicodeEncodeError

I'm using py2neo to export data from my neo4j database. (Using Python 2.7 on MacOS X) Here's the code I've been using: import csv from py2neo import neo4j, cypher, node, rel import pprint ofile = open('mydata.csv', 'wb') writer =…
Jed Christiansen
  • 659
  • 10
  • 21
2
votes
1 answer

Creating a Neo4j Date Tree that will work with py2neo

I'm trying to build a date tree in my Neo4j database that will work with the calendar module in Nigel Small's py2neo library. I used Mark Needham's starter code from here (http://java.dzone.com/articles/neo4j-cypher-creating-time), but that doesn't…
Jed Christiansen
  • 659
  • 10
  • 21
2
votes
1 answer

Batching in py2neo

I have started working with Node4j and I was exploring a bit the batch processing, but unfortunately, I am having some problems in creating relations between nodes. My problem is the following. I have a list of websites and users that I read from a…
Gorbag
  • 253
  • 1
  • 8
2
votes
2 answers

py2neo, neo4j: How to create relation between two existing node

I am following this tutorial to access neo4j db using python. According to this tutorial I have created 2 relations among 4 nodes. The code is given below alice, bob, rel = graph_db.create( {"name": "Alice"}, {"name": "Bob"}, …
Quazi Marufur Rahman
  • 2,603
  • 5
  • 33
  • 51
2
votes
1 answer

finding shortest path that excludes particular edges?

I'm using Py2neo, but that probably doesn't matter since this will most likely need to be done by writing a Cypher query. Essentially, I want to find a shortest path in a subgraph, where the subgraph is most of the whole graph but with a very small…
user3391564
  • 576
  • 1
  • 5
  • 16
2
votes
0 answers

Neo4j: Create multiple relationships with cypher and parameters

I try to create a lot of relationships (16k) with one cypher statement and parameters in py2neo by a WriteBatch. If try to create only 10 (or so) relationships, it works without problems. But with 16k relationships, the Neo4j server hung at 100% CPU…
mawey
  • 93
  • 5
2
votes
2 answers

Check whether nodes exist in a neo4j graph

NOTE I let this become several questions instead of the simple one I asked, so I am breaking the follow-ups off into their own question here. ORIGINAL QUESTION I'm receiving a list of IDs that I am first testing whether any of them are in my graph,…
Mittenchops
  • 18,633
  • 33
  • 128
  • 246
2
votes
3 answers

Importing large dataset into neo4j (with a twist) - slow

I'm working with approx 17mm prescription claims each containing the following fields (subset) : claim_id (one record per claim) patient_id drug_id provider_id My nodes are same as the fields above and the relationships are: patient - [:FILLED] ->…
kgu87
  • 2,050
  • 14
  • 12
2
votes
1 answer

How should I add labels in batches using py2neo

I am creating a lot of nodes in neo4j using python's py2neo. I am using neo4j version 2 which has support for labels. I would like to add a label to the node I have created in batches. Is there a way to do that ? a =…
gaurav.singharoy
  • 3,751
  • 4
  • 22
  • 25
2
votes
0 answers

Creating a numeric index using py2neo?

Using neo4j via py2neo. I need to be able to query using CYPHER for numeric values, using an index. For example, START n=node:field_index("subdomain:Football AND type:Competition AND weight>10") RETURN n; Weight should be indexed as a numeric field…
gingerwizard
  • 184
  • 5
2
votes
1 answer

py2neo: index.get_or_create() or graph_db.get_or_create_indexed_node()

When you add an indexed node in py2neo 1.6.0, you have two options: graph_db = neo4j.GraphDatabaseService("http://localhost:7474/db/data/") Option 1: index = graph_db.get_or_create_index('Myindex') indexed_node = index.get_or_create('key', 'value',…
Martin Preusse
  • 9,151
  • 12
  • 48
  • 80
2
votes
1 answer

Batch create or get path in py2neo

I'm trying to create a date/time tree in neo4j as Nigel Small described here. I want to pre-populate all dates for a certain period of time, and as such, want to run multiple get_or_create_path()s in a go. However, I can't seem to find a batch…
user965586
  • 563
  • 5
  • 22