neo4j

how to get the last node in path in neo4j?

送分小仙女□ 提交于 2019-12-21 09:02:29
问题 In this cypher query,the longest path/paths between nodes which have relationship with STATUS="on" property with each other,will be returned,but I want to get also the last node of the path/paths. query: START n=node(*) MATCH p=n-[rels:INCLUDE*]->m WHERE ALL (rel IN rels WHERE rel.status='on') WITH COLLECT(p) AS paths, MAX(length(p)) AS maxLength RETURN FILTER(path IN paths WHERE length(path)= maxLength) AS longestPaths how should I add it to the query? thanks. 回答1: This would give two arrays

org.xml.sax.SAXParseException: src-resolve: Cannot resolve the name 'repository:auditing-attributes' to a(n) 'attribute group' component

不羁岁月 提交于 2019-12-21 07:55:17
问题 Getting following error while running maven test on project. I am building a test application using Spring Data Neo4j. java.lang.IllegalStateException: Failed to load ApplicationContext at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:157) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109) at org.springframework.test.context.support

sudoers is world writable error [closed]

六眼飞鱼酱① 提交于 2019-12-21 07:28:22
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 7 years ago . I changed the /ect file permissions on Ubuntu 12.10 so that i could edit bash.bashrc so that neo4j can see the JVM but now I am getting errors when i try run the neo4j server I entered the code below and I managed to edit bash.bashrc but now i cant use sudo at all! sudo chmod -R ugo+rw /ect sudo -u neo4j /home

neo4j: Is there a way/how to select random nodes?

假如想象 提交于 2019-12-21 07:09:05
问题 I would like to retrieve a specific number of random nodes. The graph consists of 3 000 000 nodes where some of them are sources, some are target and some are both. The aim is to retrieve random sources and as I don't know how to select random, the program generates k random numbers from 1 to 3 000 000 which represent node IDs and then discards all randomly selected nodes that are not sources. As this procedure is time-consuming, I wonder whether it is possible to directly select random

How can I make a string contain filter on Neo4j Cypher

霸气de小男生 提交于 2019-12-21 07:02:52
问题 I need to make a string contain filter in Neo4J. The idea is simple. A good example is that I need to retrieve from a database of persons all the people that contain in his name the car substring. How can I do this? 回答1: You can use regular expressions to match a part of a name, for example: MATCH (n) WHERE n.name =~ '.*car.*' RETURN n If you have the label 'Person' assigned to all people in your database, the query would be: MATCH (n:Person) WHERE n.name =~ '.*car.*' RETURN n For further

Neo4J - Traveling Salesman

一世执手 提交于 2019-12-21 06:57:31
问题 I'm trying to solve an augmented TSP problem using a graph database, but I'm struggling. I'm great with SQL, but am a total noob on cypher. I've created a simple graph with cities (nodes) and flights (relationships). THE SETUP: Travel to 8 different cities (1 city per week, no duplicates) with the lowest total flight cost. I'm trying to solve an optimal path to minimize the cost of the flights, which changes each week. Here is a file on pastebin containing my nodes & relationships. Just run

Lucene in Neo4j has some misbehaviours in terms of reliable search querys - compared to OrientDB

余生颓废 提交于 2019-12-21 06:28:13
问题 I'm still in the evaluation of Neo4j vs. OrientDB . Most importantly I need Lucene as full-text index engine. So I created on both databases the same schema with the same data (300Mio lines). I'm also experienced with querying different things in both systems. I used the Standard Analyzer on both sides. The OrientDB test query results are all fine and really good in terms of reliability and speed. The speed of Neo4j is also ok but the results are kind of bad in most of the cases. So let's

The difference between Legacy Indexing/Auto Indexing and the new indexing approach in Neo4j

ぃ、小莉子 提交于 2019-12-21 05:31:48
问题 I'm having trouble understanding the difference between the legacy indexing approach and the new indexing approach so perhaps someone could clarify these points for me. My only concern is really how it relates to the Java API and not Cypher queries. Sub-Questions 1) Is Legacy Indexing the same thing as auto-indexing? 2) Is it true that if you are not using auto-indexing then every time you add a node to the graph you must specify whether or not it should be indexed? 3) Am I correct in

The difference between Legacy Indexing/Auto Indexing and the new indexing approach in Neo4j

試著忘記壹切 提交于 2019-12-21 05:31:26
问题 I'm having trouble understanding the difference between the legacy indexing approach and the new indexing approach so perhaps someone could clarify these points for me. My only concern is really how it relates to the Java API and not Cypher queries. Sub-Questions 1) Is Legacy Indexing the same thing as auto-indexing? 2) Is it true that if you are not using auto-indexing then every time you add a node to the graph you must specify whether or not it should be indexed? 3) Am I correct in

Neo4j / Cypher: create relationship if certain condition is met

ⅰ亾dé卋堺 提交于 2019-12-21 05:17:20
问题 I am doing a sum operation in my graph DB: I compare a couple of nodes, calculate a figure to represent how similar certain regions of the graph are and if that figure is big enough, I want to create a relationship between the nodes. I've got a query which does all that, except for the check if the figure is big enough; it currently also creates similarity relationships whose similarity score is 0 - and I don't want that. My full cypher query is somewhat longish, so I've simplified it for