neo4j

How to add edges(relationship) Neo4j in a very big graph

我怕爱的太早我们不能终老 提交于 2019-12-11 10:33:57
问题 I have a simple graph model. In this graph, Each node has an attribute {NodeId} . Each Edge will link two nodes without other attributes. It is an directed graph and has about 10^6 nodes. Here is my situation: I created index on attribute {NodeId} at first.Then I created 10^6 nodes. In this time, I have a graph with 10^6 nodes and no edges. When I want to randomly add edges, I found that the speed is very slow. I can only add about 40 edges per second. Did I miss any configurations? I don't

Neo4j How to insert csv file?

只谈情不闲聊 提交于 2019-12-11 10:32:00
问题 I need to insert data using a CSV file in to a Neo4j database. is there any method possibilities for uploading file or using ftp protocol. I only saw use http protocol. plz I am learning now and still a beginer. neo4j importing CSV files with cypher I an using neo4j-node library for working with Neo4j database with node.js. No use of java. tx 来源: https://stackoverflow.com/questions/25423996/neo4j-how-to-insert-csv-file

Neo4j Cypher match () in java. Find connected nodes

蹲街弑〆低调 提交于 2019-12-11 10:29:07
问题 I have the follwing structure firstNode = graphDb.createNode(); firstNode.setProperty( "person", "Andy " ); Label myLabel = DynamicLabel.label("A"); firstNode.addLabel(myLabel); secondNode = graphDb.createNode(); secondNode.setProperty( "person", "Bobby" ); Label myLabel1 = DynamicLabel.label("B"); secondNode.addLabel(myLabel1); ThirdNode = graphDb.createNode(); ThirdNode.setProperty( "person", "Chris " ); Label myLabel2 = DynamicLabel.label("C"); ThirdNode.addLabel(myLabel2);....

Limiting number of paths the query search in cypher query other than limit

霸气de小男生 提交于 2019-12-11 10:27:09
问题 I want the query to stop as soon as it finds first 10 paths and return those. But by default the limit clause finds all the paths and then just returns first 10 paths. Because total paths in my case will be around 10k to 20k, its not practical to do that. i tried following two queries which dont work match path = (first:Job)-[:PRECEDES*]->(last:Job) where first.name = 'xyz' and last.name = 'abc' return nodes(path) as pathlist match path1 = (first:Job)-[:PRECEDES*]->(middle:Job) where first

How to create edges based on the equality check on vertex attributes in Cypher?

安稳与你 提交于 2019-12-11 10:26:46
问题 How to create edges based on the equality check on vertex attributes in Cypher? For example: lets say I have one object like this Employees {name: "abc, country: "NZ"} and lets say I have the following objects Manager { name: "abc", depatment: "product"} Manager {name: "abc", depatment: "sales"} Manager {name: "abc", depatment: "marketing"} Now I want to create all the edges where Employees.name = Manager.name How do I write the Cypher query to create all 4 vertices and 3 edges? 回答1: Find the

How do I create a Neo4j relationship via the rails console?

こ雲淡風輕ζ 提交于 2019-12-11 10:12:16
问题 I'm currently working through this tutorial and I'm stuck when it comes to creating relationships in the rails console. I've read through the Neo4jrb project documentation and a blog post on jayway.com but still can't figure it out. I've created a rails site and I want to create team nodes, league nodes, and relationships between them in a Neo4j database using my rails scripts. I have two models: One for League class Team include Neo4j::ActiveNode property :name, type: String has_one :out,

“Cannot extract single value from Iterable” with custom query result object

落爺英雄遲暮 提交于 2019-12-11 10:06:13
问题 I'm using SpringDataNeo4J 3.0.0-M1 with Neo4J 2.00-M0.6 . I have BetDAO nodes, linked to a collection of BetAnswerDAO nodes with BET_ANSWER relationship. I'm trying to retrieve a bet and all its answers on the same request. I have a BetRepository with the following request : @Query("start bet=node:BetDAO(id = {betId}) " + "match (bet)-[:BET_ANSWER]->(betAnswer) " + "return bet, collect(betAnswer) as betAnswers") BetWithInfo getByIdWithInfo(@Param("betId") String id); My BetWithInfo object :

neo4j getting slow & stuck on amazon ec2

痴心易碎 提交于 2019-12-11 10:01:38
问题 I have a neo4j running on an ec2 instance (large, ubuntu) and I'm running some scripts on it that do lots of writings. I noticed that after a while that those scripts run (after they wrote couple of thousand nodes) the server starting to run very slow, sometimes to the point it get absolutely stuck. another weird part - resetting the instance from this situation usually ends up in the server taking much longer than usual to init. first I suspected that neo4j uses up all the RAM and this is a

Can Neo4j community edition start in warm up?

空扰寡人 提交于 2019-12-11 09:57:34
问题 I'm using neo4j 2.0 community edition in rest server on ubuntu. Every time a first query is slow response after startup the neo4j. And remain queries which is same the first one are fast response. I guess this behavior is relative to cache. I tried to cache all primitives(node, rel, props) by following query. I executed the query using webadmin after stareted up neo4j server, but the first query performance didn't improve. start n=node(*) match n--m return count(n) or match (n)-[r]-() return

How to store time data type in neo4j?

﹥>﹥吖頭↗ 提交于 2019-12-11 09:55:16
问题 I created some user nodes with some value-time: CREATE (u1:User {name:'user 1', pickUpTime:'10:10', dropOffTime:'10:35'}) I wonder what is a good way (format) to store time, because when i do this kind of queries MATCH (u:User) RETURN u.name AS name, u.pickUpTime AS pickTime Order by pickTime desc I got this as result name pickTime user 3 9:30 user 2 10:20 user 1 10:10 And i need to get an ordered result: name pickTime user 3 9:30 user 1 10:10 user 2 10:20 Any suggestions? Thanks in advance