neo4j

Neo4j: Listing node labels

天涯浪子 提交于 2019-12-13 06:39:39
问题 I have 2 hierarchies in my database. Hierarchy 1: Company{name:'ABC', CompanyId:1,} <-- Category <-- SubCategory <-- Service <-- Asset <-- Anomaly Hierarchy 2: Company{name:'XYZ', CompanyId:21,} <-- Category <-- Service <-- Asset <-- Anomaly What is the best way to query node labels in my hierarchy for a CompanyId? I am looking for an output in the following format: CompanyId:1 Company Category SubCategory Service Anomaly CompanyId:2 Company Category Service Anomaly Thanks. 回答1: Assuming that

Neo4j server failed to start in ubuntu virtual machine

痴心易碎 提交于 2019-12-13 06:26:41
问题 I just want to use Neo4j server in a ubuntu virtual machine, I have installed oracle Java like below: java version "1.7.0_45" Java(TM) SE Runtime Environment (build 1.7.0_45-b18) Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode) and then when I try to start Neo4j server, it has error like this: WARNING: Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual. Using additional JVM arguments: -server -XX:+DisableExplicitGC -Dorg.neo4j.server.properties

Cypher Query not finding Node

↘锁芯ラ 提交于 2019-12-13 06:19:48
问题 I have created an embedded Neo4J in a Java project like this: graphDb = new GraphDatabaseFactory() .newEmbeddedDatabaseBuilder("db") .setConfig(GraphDatabaseSettings.node_keys_indexable, "movieId, userId, rating, genre") .setConfig(GraphDatabaseSettings.node_auto_indexing, "true") .newGraphDatabase(); I have verified that the index is created, and it has the name that I expect: Index<Node> index = graphDb.index().forNodes("movieId"); System.out.println("::: Verify Index Name :::"); System.out

Returning property and count columns together in Neo4jClient Cypher Query

元气小坏坏 提交于 2019-12-13 06:13:19
问题 I have a Cypher query likes this: START n=node:permit_idx(PmtID= "111") Match n-[:Assinged]->m<-[:Assinged]-p RETURN p.PmtID, count(m); I got error when I try to do it using Neo4jClient Cypher Query var results = graphClient .Cypher .Start(new { n = Node.ByIndexLookup("permit_idx", "PmtID", "111") }) .Match("Match n-[:Assigned]->m<-[:Assigned]-p") .Return((m, p) => new { PDPmtID = "p.PmtID", MCount = "count(m)" }) .Results; If only need to return one property or one count, we can use .Return

Cannot configure @Transaction to work with Spring Data Neo4j

若如初见. 提交于 2019-12-13 06:02:02
问题 I'm trying to move away from manually-managed transactions to annotation based transactions in my Neo4j application. I've prepared annotation-based Spring configuration file: @Configuration @EnableNeo4jRepositories("xxx.yyy.neo4jplanetspersistence.repositories") @ComponentScan(basePackages = "xxx.yyy") @EnableTransactionManagement public class SpringDataConfiguration extends Neo4jConfiguration implements TransactionManagementConfigurer{ public SpringDataConfiguration() { super();

How to import data into neo4j (neo4j-community-2.0.0) in windows 7?

China☆狼群 提交于 2019-12-13 05:59:02
问题 I got the below link to do this but the problem is that it's for linux users !!! http://blog.neo4j.org/2013/03/importing-data-into-neo4j-spreadsheet.html Please help me to get this done on windows ? Thanks in advance. I am new to neo4j and got only a little hands on experience on java. I added neo4jtools to my neo4j server from the below link https://github.com/jexp/neo4j-shell-tools then I follow this command to import few data to a graph database neo4jshell -path C:\Program Files\neo4j

Cypher (using bolt) multiple unrelated queries at once - match and modify (set property) of multiple nodes in single query

血红的双手。 提交于 2019-12-13 05:55:41
问题 I have nodes of 5 different labels, say, A, B, C, D, E . I need to match a node of each type based on some property and update some other property of the matched node. The query works perfectly fine if i execute 5 different match and set queries, one for each label type. However, when I try to do everything in one single query, the property seems to get updated multiple times. The property I am updating is an array (the same value gets added to the array multiple times). The following is the

Issues loading data patterns from CSV

≡放荡痞女 提交于 2019-12-13 05:50:21
问题 I try to load data patterns into neo4j from cvs files using cypher command lines. I have two data files, one containing objects, the other containing object parts. Object file: ID ABC-DE DEF Part file: ID ParentID Level Size ABC ABC-DE 1 3 DE ABC-DE 1 2 AB ABC 2 2 BC ABC 2 2 DE DEF 1 2 F DEF 2 1 A AB 3 1 B AB 3 1 B BC 3 1 C BC 3 1 D DE 3 1 E DE 3 1 Cypher command lines used to load data: LOAD CSV WITH HEADERS FROM 'file:///path_to_file/object.csv' as csvLine FIELDTERMINATOR '\t' CREATE (

query for name not like other name in neo4j cypher

六眼飞鱼酱① 提交于 2019-12-13 05:47:40
问题 I'm trying to find nodes where node1's name is NOT contained in node2's name and vice versa. I've tried this and variants of it. getting regex errors, not sure how to include the other node's literal name, and also how to do NOT includes. START node1=node(*) MATCH node1-[r]-node2 WHERE node1.name !~ '.*{node2.name}.*' and node2.name !~ '.*{node1.name}.*' RETURN node1.name, node2.name limit 10; 回答1: I'll try to answer how to get your query to work, but this type of query looks a bit irregular

Neo4j: How to delete all nodes and relationships beyond a node?

可紊 提交于 2019-12-13 05:45:16
问题 Here's a simple graph: (:a)-[:r]->(:b) If want to to delete (:b) , I can do this with: MATCH (a)-[r]->(b :b) DELETE a, r, b However, (b) can have multiple relationships and nodes coming off of it (and those nodes can recursively have more relationships and nodes too). Something like this: (:a)-[:r]->(:b)-[:s]->(x)-[:r]->(y)- ... ->(z) How can I recursively delete every node and relationship beyond (b) ? 回答1: DETACH DELETE is going to be useful here. This first deletes all relationships from a