py2neo

How to get Neo4j 2.2 Auth/API Token

女生的网名这么多〃 提交于 2020-01-05 11:43:11
问题 Is there a way to retrieve the API token from the REST API? I want to use the py2neo set_auth_token method. A blog post stated that the server command would return the api token but it does not. :server connect It only lists my user. I installed a completely new Neo4j 2.2 and did not change any configuration. Unforntunately the docs are not very detailed in regards to the api token feature or i did not find the correct page. All i found was: http://neo4j.com/docs/snapshot/rest-api-security

How to get Neo4j 2.2 Auth/API Token

ぃ、小莉子 提交于 2020-01-05 11:40:03
问题 Is there a way to retrieve the API token from the REST API? I want to use the py2neo set_auth_token method. A blog post stated that the server command would return the api token but it does not. :server connect It only lists my user. I installed a completely new Neo4j 2.2 and did not change any configuration. Unforntunately the docs are not very detailed in regards to the api token feature or i did not find the correct page. All i found was: http://neo4j.com/docs/snapshot/rest-api-security

finding shortest path that excludes particular edges?

孤街浪徒 提交于 2020-01-04 09:58:06
问题 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 fraction (a millionth or less) of the edges removed. For example, say I have nodes A, B, and C, and edges (A->B), (A->C), (B->C). Of course, the shortest path from A to C is via the direct connection. But if I wanted to find the shortest path that

finding shortest path that excludes particular edges?

◇◆丶佛笑我妖孽 提交于 2020-01-04 09:57:50
问题 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 fraction (a millionth or less) of the edges removed. For example, say I have nodes A, B, and C, and edges (A->B), (A->C), (B->C). Of course, the shortest path from A to C is via the direct connection. But if I wanted to find the shortest path that

Searching for node in py2neo

对着背影说爱祢 提交于 2020-01-04 09:38:12
问题 Is there a way to search for a node with a specific property using py2neo? (I have a bunch of nodes with {"word": "some word"}, and I want to be able to search through nodes to find a node whose word attribute has a specific value) 回答1: I suggest that you consider using an index for this kind of requirement. You can index the nodes against the properties you need to search for and then refer to this index for your search. Otherwise, you're left with a reasonably non-performant Cypher query:

Batching in py2neo

限于喜欢 提交于 2020-01-04 09:10:26
问题 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 file. I may have repeated websites and users in that file, so I do not want to insert new nodes for those repeated entries. But as the file is big, I want to batch the processing of the nodes and relations. Basically, I have these two functions to

Failed WriteBatch Operation with py2neo

瘦欲@ 提交于 2020-01-02 01:31:08
问题 I am trying to find a workaround to the following problem. I have seen it quasi-described in this SO question, yet not really answered. The following code fails, starting with a fresh graph: from py2neo import neo4j def add_test_nodes(): # Add a test node manually alice = g.get_or_create_indexed_node("Users", "user_id", 12345, {"user_id":12345}) def do_batch(graph): # Begin batch write transaction batch = neo4j.WriteBatch(graph) # get some updated node properties to add new_node_data = {"user

Python py2neo SocketError: Connection Refused

非 Y 不嫁゛ 提交于 2019-12-25 04:15:28
问题 I'm trying to follow along to this neo4j tutorial and I'm having a problem connecting to the API. Here's my traceback: >>> graph.delete_all() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.7/site-packages/py2neo/core.py", line 748, in delete_all statement = StartOrMatch(self).relationship("r", "*").string + "DELETE r" File "/usr/local/lib/python2.7/site-packages/py2neo/cypher/util.py", line 45, in string if self.graph.supports_start_clause:

py2neo - Neo4j - System Error - Create Batch Nodes/Relationships

只愿长相守 提交于 2019-12-24 17:07:13
问题 Attempting to batch create nodes & relationships - batch creation is failing - Traceback at end of the post Note code functions with smaller subset of nodes - fails when get into massive number of relationships, unclear at what limit this is occurring. Wondering if I need to increase ulimit above 40,000 open files Read somewhere where persons were running into Xstream issues with REST API while conducting batch create - unclear if the problem set is on the py2neo end of the spectrum, or on

Py2neo Neo4j Batch submit error

天大地大妈咪最大 提交于 2019-12-24 15:27:27
问题 I have a json file with data of around 1.4 million nodes and I wanted to construct a Neo4j graph database for that. I tried to use py2neo's batch submit function. My code is as follows: # the variable words is a list containing node names from py2neo import neo4j batch = neo4j.WriteBatch(graph_db) nodedict = {} # I decided to use a dictionary because I would be creating relationships # by referring to the dictionary entries later for i in words: nodedict[i] = batch.create({"name":i}) results