neo4j

Neo4j Cypher manual relationship index, APOC trigger and data duplication

旧时模样 提交于 2019-12-24 09:52:29
问题 I have the following query that uses plain relationship operations for node filtering: MATCH (dg:DecisionGroup)-[:CONTAINS]->(childD:Decision) WHERE dg.id = 1 MATCH (childD)-[relationshipValueRel2:HAS_VALUE_ON]->(filterCharacteristic2:Characteristic) WHERE filterCharacteristic2.id = 2 WITH relationshipValueRel2, childD, dg WHERE (ANY (id IN [".NET"] WHERE id IN relationshipValueRel2.value )) RETURN childD.name which returns only one node(as it was expected): "Candidate1" PROFILE output: I'd

neo4j Neo.ClientError.Transaction.TransactionHookFailed

你。 提交于 2019-12-24 09:27:03
问题 I was trying to change a property to a node using MATCH (n:User) where n.firstname = 'Mark' set n.school = 'MIT' return n but I got this error: Neo.ClientError.Transaction.TransactionHookFailed Why are we getting this error? The neo4j documentation does not contain any explanation for this. Thank you. 回答1: try merge MATCH (n:User) where n.firstname = 'Mark' merge n.school = 'MIT' ; you won't have any return, you should re query using match ... return as per https://neo4j.com/docs/cypher

Spring Data Neo4j 5 update dynamic properties

大兔子大兔子 提交于 2019-12-24 09:05:55
问题 I have the following entity: @NodeEntity public class Value { @Properties(prefix = "property", allowCast = true) private Map<String, Object> properties; } I have added the following properties: Map<String, Object> properties1 = new HashMap<>(); properties.put("key1", "one"); properties.put("key2", "two"); value.setProperties(properties1); Right now on the database level, I have the Value node with two properties: property.key1 = "one" property.key2 = "two" Now, I'd like to update the

NEO4J Cypher Query: Multiple Aggregates

 ̄綄美尐妖づ 提交于 2019-12-24 08:56:54
问题 Sample Data Sample Query: At the end of this post Objective: Searches similar to 'who knows exactly 2 Cust and works at 1 company' Step 1 : I just did a print of the number of connected Cust and Comp and its all good till now MATCH (from:Cust), (a:Cust), (b:Comp), p1=((from)-[r1]-(a)), p2=((from)-[r2]-(b)) WITH from, count(DISTINCT a) as knows, count(DISTINCT b) as works RETURN from.title, knows, works Step 2 : I went and added WHERE clause to filter the count, so far so good MATCH (from:Cust

Neo4j Spatial - How To Delete A Node

◇◆丶佛笑我妖孽 提交于 2019-12-24 08:55:16
问题 Having successfully created a spatial index, created a node and added it to my index, I'd now like to be able to delete the node (easy) and remove it from the spatial index (not so easy). At time of writing, the documentation does not cover this. Looking at the index i can see what to clear up, but on my simple DB i'm not confident if this is a protocol to follow or just a rule of thumb. My node (within the index) is two "rtree" relationships away from the root of the layer, which i can clean

Neo4j: Speed up Relationship matching by property inequality

我的未来我决定 提交于 2019-12-24 08:48:47
问题 I'm using Neo4j 3.0.5. My query looks as follows: MATCH (cd:ConnectionDay)-[c:Connection]->() WHERE id(cd)= { id } AND c.departure <= { departure } RETURN c In my graph, the number of Connection relations is very high and I'm looking for a way to speed up the retrieval. Is there a way to create an index for the departure property? I'm using the Embedded Java API anyway, so solutions that aren't using Cypher are ok, too. 回答1: Aside: It is not recommended that you use native neo4j IDs to find

'Error 401 Unauthorized' for Neo4j REST url on Heroku

让人想犯罪 __ 提交于 2019-12-24 08:24:59
问题 I am using correct NEO4J_URL environment variable as shown in heroku config . If I use the same neo4j url via a browser, it works fine (no auth failure). However my application fails to start with below error on heroku. (I am using spring-data-neo4j) The URL looks like http://username:password@123456ac6.hosted.neo4j.org:1234/db/data/ . Tried without '/db/data' at the end and also with and without trailing slash. Didn't help. Please help if anyone has already faced/resolved this issue. The

Neo4j grouping with two relationships

僤鯓⒐⒋嵵緔 提交于 2019-12-24 07:58:49
问题 I have a chart that will represent hierarchy for nodes like this one. Lets say that this one is representing the complete hierarchy but I also need to create intermediate result by grouping at different levels. Suppose I'm requesting data for node A. I wish to regroup nodes at the nearest Group relationship. I'd to get something like this: Basically users will be allowed to associate nodes to group and I need to represent the data in the convenient way to display an Org Chart. I don't know

Neo4j Cypher comparing dates in Cypher query

好久不见. 提交于 2019-12-24 07:56:37
问题 Right now I'm designing a system with Neo4j database where I have to be able to have a query check if a Date property in a node is before, equal or after the provided Date . How should I store the Date inside of Neo4j Node property to be able to do a comparison with Cypher query based for example on simple operators like == , > , < Is it okay to store Date like Long timestamp ? Will it work this way ? If no, please suggest a better decision. UPDATED Queries I have tried with no luck: MATCH

Neo4j long lasting query to be split/executed in smaller chunks?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 07:46:41
问题 My import.csv creates many nodes and merging creates a huge cartesian product and runs in a transaction timeout since the data has grown so much. I've currently set the transaction timeout to 1 second because every other query is very quick and is not supposed to take any longer than one second to finish. Is there a way to split or execute this specific query in smaller chunks to prevent a timeout? Upping or disabling the transaction timeout in the neo4j.conf is not an option because the