cypher

Return nodes who are connected by a common set of nodes

ⅰ亾dé卋堺 提交于 2019-12-24 07:37:15
问题 Is there a way in Neo4j, using either cypher or gremlin, to return a list of nodes that have a common set of nodes between them? An example would be Person1-[KNOWS]->Friend1 Person1-[KNOWS]->Friend2 Person1-[KNOWS]->Friend3 Person2-[HATES]->Friend2 Person2-[HATES]->Friend3 I want to start at Person1 and say, "Find me the people who hate all the people I know", which should return Person2 since Person1 knows Friend2,Friend3 and Person2 hates Friend2,Friend3 . I've started by finding the

Adding 5834580 of node to Spatial Layer

不羁的心 提交于 2019-12-24 07:24:08
问题 I am trying to create an R-TREE of 5834580 of nodes. I found in this question a similair problem and i tried it's solution, so this is my code : call apoc.periodic.commit("MATCH (pl:pickup_location) WITH collect(pl) AS pickup CALL spatial.addNodes('nyc',pickup) YIELD count RETURN count",{limit:1000}) however, since yesterday the computer didn't finish loading the result. today, i tried the second answer with iterate : CALL apoc.periodic.iterate( "MATCH (pl:pickup_location) RETURN pl", "CALL

Adding 5834580 of node to Spatial Layer

瘦欲@ 提交于 2019-12-24 07:21:12
问题 I am trying to create an R-TREE of 5834580 of nodes. I found in this question a similair problem and i tried it's solution, so this is my code : call apoc.periodic.commit("MATCH (pl:pickup_location) WITH collect(pl) AS pickup CALL spatial.addNodes('nyc',pickup) YIELD count RETURN count",{limit:1000}) however, since yesterday the computer didn't finish loading the result. today, i tried the second answer with iterate : CALL apoc.periodic.iterate( "MATCH (pl:pickup_location) RETURN pl", "CALL

Adding 5834580 of node to Spatial Layer

牧云@^-^@ 提交于 2019-12-24 07:21:07
问题 I am trying to create an R-TREE of 5834580 of nodes. I found in this question a similair problem and i tried it's solution, so this is my code : call apoc.periodic.commit("MATCH (pl:pickup_location) WITH collect(pl) AS pickup CALL spatial.addNodes('nyc',pickup) YIELD count RETURN count",{limit:1000}) however, since yesterday the computer didn't finish loading the result. today, i tried the second answer with iterate : CALL apoc.periodic.iterate( "MATCH (pl:pickup_location) RETURN pl", "CALL

Neo4j Cypher query for many to many relationship

℡╲_俬逩灬. 提交于 2019-12-24 07:03:08
问题 I have a graph that looks like the following: Brand--SOLD_BY-->Store One brand of a certain item can be sold by multiple stores. Similarly, a single store can sell multiple brands of items. What I want to achieve is find all the stores that sell a particular brand but in the result along with the store, I would also like the other brands that are sold by that particular store. For example: Brand1 is sold by StoreA, StoreB, StoreC. The result should look something like.. StoreA - Brand1,

Neo4j: find degree of connection

寵の児 提交于 2019-12-24 06:49:51
问题 I'm using Neo4j to find the degree of connection between users. I have data in the follower shape: (user)-[:INTERACTS_WITH]->(user) So if user_1 interact with user_2 and user_2 interacts with user_3, then user_1 and user_3 share a second-degree connection. Ideally, I would like to get the following dataset like this in return: degree count NULL 123 1 1050 2 3032 3 2110 ... ... Is there a better way to do this than to simply run shortestPath() function for every pair of users? If not, then

Neo4j query result cache

北战南征 提交于 2019-12-24 06:46:19
问题 I've noticed that when I run a heavy query over and over again, it takes the same duration to finish. This is not typical behavior of databases. Does neo4j cache queries? 回答1: Neo4j caches the store files, node and relationship objects and query plans. However it does not query results by itself, this needs to be done on application side. 来源: https://stackoverflow.com/questions/31646017/neo4j-query-result-cache

Add Unique Nodes and relationship between them from Existing Setup in Neo4j

南笙酒味 提交于 2019-12-24 04:55:10
问题 This is in continuation of the problem defined here Query case-specific nodes in Neo4j So the situation looks like the image below(please bear with the crappy image) The blue links denotes the [:RELATES_TO] relationship with the number in black boxes denoting the value of Length property. Similar values also exists for all such other [:RELATES_TO] relationship which is not shown here. Now I would like to find and create unique Nodes based on 'Name' property of Performer Nodes . Continuing

Write or token create operations are not allowed in procedure using cypher projection

一个人想着一个人 提交于 2019-12-24 04:19:24
问题 When calling a procedure using an evaluated inner query (cypher projection)which would be creating an node or edge a forbidden error is thrown for the admin user. It is possible to run the query outside the procedure. Maybe it is something of an configuration issue? I am trying to run a query using the timetree procedure of GraphAware and the LabelPropagation of Neo4j. But I've been able to get the forbidden error using a much simpler query. I am using Neo4j Desktop. I have tried giving the

Cypher - matching two different possible paths and return both

白昼怎懂夜的黑 提交于 2019-12-24 04:18:38
问题 I have a a data set that I have represented here as an example: http://console.neo4j.org/?id=3dq78v What I am trying to do is for every Z node in my graph (the example only has one but I have many) I want to capture a set of properties that cover all all of the associated A, B, C and D nodes and relationships. I have come across two issues trying to do this. The first is that the C nodes are either connected to the to the B nodes OR the A nodes. Second the D nodes are connected to C nodes but