cypher

Multiple relationships in Match Cypher

。_饼干妹妹 提交于 2019-12-23 03:51:43
问题 Trying to find similar movies on the basis of tags. But I also need all the tags for the given movie and its each similar movie (to do some calculations). But surprisingly collect(h.w) gives repeated values of h.w (where w is a property of h ) Here is the cypher query. Please help. MATCH (m:Movie{id:1})-[h1:Has]->(t:Tag)<-[h2:Has]-(sm:Movie), (m)-[h:Has]->(t0:Tag), (sm)-[H:Has]->(t1:Tag) WHERE m <> sm RETURN distinct(sm), collect(h.w) Basically a query like MATCH (x)-[h]->(y), (a)-[H]->(b)

Upload files to Graphileon InterActor as node background

怎甘沉沦 提交于 2019-12-23 03:37:08
问题 I installed Graphileon InterActor using Docker on Windows. The Styling Documentation says that files can be uploaded using the following command in style menu: "image": "(%).properties.file", // image as node background When starting InterActor I follow this command: You can run the InterActor image using the following command, which will also create a volume "interactor" where persistent data (the config, and files you upload to InterActor) will be stored. And type in: $ docker run -t -d -p

Error creating relationships over huge dataset

懵懂的女人 提交于 2019-12-23 03:32:12
问题 My question is similar to the one pointed here : Creating unique node and relationship NEO4J over huge dataset I have 2 tables Entity (Entities.txt) & Relationships (EntitiesRelationships_Updated.txt) which looks like below: Both the tables are inside an import folder within the Neo4j database. What I am trying to do is load the tables using the load csv command and then create relationships. As in the table below: If ParentID is 0, it means that ENT_ID does not have a parent. If it is

SDN4/OGM Cypher query and duplicates at Result

和自甴很熟 提交于 2019-12-23 03:24:07
问题 I have a following Cypher query: MATCH (parentD)-[:CONTAINS]->(childD:Decision) WHERE parentD.id = 1 OPTIONAL MATCH (childD)-[sortValue1:HAS_VALUE_ON]->(sortCharacteristic1:Characteristic) WHERE sortCharacteristic1.id = 1 WITH * MATCH (childD)-[ru:CREATED_BY]->(u:User) OPTIONAL MATCH (childD)-[rup:UPDATED_BY]->(up:User) WITH ru, u, rup, up, childD , sortValue1 ORDER BY sortValue1.value ASC SKIP 0 LIMIT 100 RETURN ru, u, rup, up, childD AS decision, [ (parentD)<-[:DEFINED_BY]-(entity)<-[

Finding triplets having highest common relationships in Neo4j

北战南征 提交于 2019-12-23 03:18:23
问题 I have two types of nodes in my graph. One type is Testplan and the other is Tag. Testplans are tagged to Tags. I want most common pairs of Tags that share the same Testplans with a Tag having a specific name. I have been able to achieve the most common Tags sharing the same Testplan with one Tag, but getting confused when trying to do it for pairs of Tags. The cypher returning the list of single tags is shared below MATCH (kw1:Tag)<-[e:TAGGED]-(tp1:Testplan)-[e2:TAGGED]->(kw2:Tag) WHERE kw1

Modify or change relationship properties in py2neo

只愿长相守 提交于 2019-12-23 02:36:30
问题 Is there a way to change a relationship property once it has been set using py2neo or cypher? I'm creating an inventory tracker and once an item is "CHECKED_OUT" a property called "status" in the relationship is set to "True". Ideally, once the item is returned or checked in, I'd like to change the "status" property to "False". This way I can keep track of the item and prevent it from being checked out twice. Here is my code for creating the relationship for a checkout transaction: def check

Is it possible to determine if a Cypher MERGE results in a create or a match?

自古美人都是妖i 提交于 2019-12-23 02:35:03
问题 Consider the Neo4J 2.0 Cypher query MERGE (u:User {id_str:"123"}) ON CREATE SET u.name="Bob", ON MATCH SET u.phone_num="555-4152" RETURN u It's a silly query - don't worry about the intent here. The question is, how do I understand whether this query created or simply found a node? UPDATE Perhaps I should further motivate why I want this behavior. Here's why: If the node already exists, then don't have to go to a remote server (Twitter API in my case) and download all of the user's metadata.

BFS traversal using cypher

穿精又带淫゛_ 提交于 2019-12-23 02:26:32
问题 I need to traverse a directed acyclic graph (DAG) using BFS. I am using neo4j via REST API, so my main way of commuication with neo4j is using Cypher. With Cypher I can retrieve a set of all the paths from a starting node, and from them derive a BFS traversal. I was wondering if there's a simpler way of getting a BFS traversal using Cypher. What I expect as output would be an array of sets of nodes. 回答1: Couldn't you then just order resulting paths after length, maybe take the last node from

How do I provide multiple queries in Neo4j Cypher?

十年热恋 提交于 2019-12-23 01:52:50
问题 I want to use the results from the first query in the second query. I am not sure how to do this in Cypher? Current code, START user1=node:USER_INDEX(USER_INDEX = "userA") MATCH user1-[r1:ACCESSED]->docid1<-[r2:ACCESSED]-user2, user2-[r3:ACCESSED]->docid2 WHERE r2.Topic=r3.Topic RETURN distinct docid2.Label; I want to have different conditions checked in the WHERE clause for the same docid2 set of nodes and accumulate the results and perform order by based on a date field. I am not able to

Time/date based searches in neo4j

99封情书 提交于 2019-12-23 01:27:09
问题 while playing around with neo4j a couple of questions arisen. At present time there are 2 of them: How can I limit the relationships/edges while searching for a specific path from node X to node Y (RegEx?/Wildcard?)? For instance all edges have 2 time attributes, "begin" and "end". I would like to find a path between nodes which occured between 2 am and 3 am in the morning.? How can track a time path? Lets say a car drove from 'A' to 'B'. The route took one hour, namely from 5 am to 6 am. The