neo4j

Neo4j - Cypher return 1 to 1 relationships

我的未来我决定 提交于 2019-12-13 04:46:02
问题 Using neo4j 1.9.2, I'm trying to find all nodes in my graph that have a one to one relationship to another node. Let's say I have persons in my graph and I would like to find all persons, that have exactly one friend (since 2013), and this one friend only has the other person as friend and no one else. As a return, I would like to have all these pairs of "isolated" friends. I tried the following: START n=node(*) MATCH n-[r:is_friend]-m-[s:is_friend]-n WHERE r.since >= 2013 and s.since >= 2013

how to solve Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException

China☆狼群 提交于 2019-12-13 04:44:45
问题 I get this error: Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException at graph_traversing.search_string.search_btnActionPerformed(search_string.java:84) at graph_traversing.search_string.access$000(search_string.java:12) at graph_traversing.search_string$1.actionPerformed(search_string.java:45) at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018) at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341) at javax.swing

Query performance when adding a new node in Neo4j

∥☆過路亽.° 提交于 2019-12-13 04:43:59
问题 I am wondering why my Cypher query is taking an exorbitant amount of time. Basically, I have a small family tree (two families), and I'm trying to add to each one a new node that carries some small bit of metadata so that the families are easier to keep isolated from each other when they are queried. (Thanks to @Tim Kuehn for this advice). Once I run the query to populate my two families, I have this, which is built quickly with no problems: Next, I want to create the aforementioned new nodes

How to return COLLECT([role, app]) using Neo4jClient?

自作多情 提交于 2019-12-13 04:41:44
问题 I have the following Cypher which I am struggling to translate into the fluent syntax: MATCH (u:User)-[:HAS_ROLE]->(r:Role)-[:ROLE_OF]->(a:App) RETURN u AS User, COLLECT([r, a]) AS Roles This is what I have so far, but I can't figure out how to return the COLLECT([r, a]) as Roles. I am using a UserDetails class to enable passing the results to a View. var results = _graphClient.Cypher .Match("(user:User)-[:HAS_ROLE]->(role:Role)-[:ROLE_OF]->(app:App)") .Return((user,role,app) => new

Neo4j breadth first search is too much slow

我的未来我决定 提交于 2019-12-13 04:41:10
问题 I need breadth first search in my database. There are 3.863 nodes, 2.830.471 properties and 1.355.783 relationships. N is my start point and m is my end point in the query but It's too much slow, so I can't get result while I started the query that is in the following segment: start n=node(42),m=node(31) match p=n-[*1..]->m return p,length(p) order by length(p) asc limit 1 How can I optimize that query? Because It must finish maximum in 20 seconds. I have 8gb ram in my own computer but I

Neo4j Hello World Tutorial and webadmin

a 夏天 提交于 2019-12-13 04:38:48
问题 I'm learning Neo4j via their tutorials. I've got the Hello World tutorial working, but I'm wondering how to view the graph in the webadmin on localhost. I assume the first step is not to call removeData() and shutDown(), but just doing that isn't accomplishing it. Basically, how can I run the the Hello World tutorial and then view/query it through webadmin? 回答1: Calling shutdown won't destroy your data. Can you share your code? Also make sure your Neo4j server points to the same database used

How to improve performance while committing nodes in bulk with Neo4j 2.0 RC1?

和自甴很熟 提交于 2019-12-13 04:37:29
问题 I am interested to know if the program(below) can be improved to perform faster. Seems like, a lot of time is spent in Transaction's close() when we have constraints in place ( 90 secs with constraint , and 1 sec without ) Following is the output of the program: 2013-12-05 14:30:20,399 [main] INFO net.ahm.graph.Lab - ############# WAVE 1 ############# 2013-12-05 14:30:20,399 [main] INFO net.ahm.graph.Lab - TIME TO BEGIN TX (m-sec): 0 2013-12-05 14:30:45,296 [main] INFO net.ahm.graph.Lab -

neo4j transaction not rolling back

♀尐吖头ヾ 提交于 2019-12-13 04:33:28
问题 I am using neo4j 2.1.7 with java. try(Transaction transaction = this.graphDatabaseService.beginTx()) { Node user = this.graphDatabaseService.createNode(); user.setProperty("userId", userId); transaction.failure(); } So I am getting the object of GraphDatabaseService and creating a new transaction and marking it to rollback. According to their javadocs: void failure() Marks this transaction as failed, which means that it will unconditionally be rolled back when close() is called. Once this

Cypher sum property on incoming & outgoing relationships (Neo4j)

青春壹個敷衍的年華 提交于 2019-12-13 04:29:16
问题 I have multiple incoming & outgoing relationships for a node (Neo4J). Each relationship has a numeric property "weight" I need to get the difference between the incoming & outgoing weights for the node. I tried this query, but return 0 for both sums, even though sum of incoming weights is 20. MATCH out=(n:Person)-[r:FRIEND]->(), in=(n:Person)<-[s:FRIEND]-() WHERE n.personid='12345' RETURN sum(r.fweight), sum(s.fweight); Also, I tried this... and it crashes/doesnt return MATCH (n:Person)-[r

neo4j clean build failed

旧时模样 提交于 2019-12-13 04:27:29
问题 I was trying to build Neo4j from https://github.com/neo4j/community.git I'm building with Maven 3.05 and java 1.7.0_17 Running command: mvn clean install -Dlicense.skip=true -DminimalBuild [ERROR] Failed to execute goal org.neo4j.build.plugins:licensing-maven-plugin:1.7.5:check (list-all-licenses) on project neo4j-kernel: Generated file differs from the existing file. [ERROR] Generated: E:\neo4j\clone\gitBuild\community\kernel\target\neo4j-kernel-1.9-SNAPSHOT-NOTICE.txt [ERROR] Existing: E: