neo4j

Neo4J Job execution time

試著忘記壹切 提交于 2019-12-25 02:57:58
问题 I am trying to record the Neo4J algorithm execution. I run an algorithm 10 times, however the first run is always significantly longer than the rest of executions. For example: elapsed time = | 86345.0 | 3417.0 | 3416.0 | 4228.0 | 3369.0 | 3323.0 | 3338.0 | 3370.0 | 3775.0 | 3370.0 //ms Why is this happening? Is Neo4J smart enough to store already visited (read from DB) vertices in memory, thus from the second execution it reads from memory not the database? My datasets are small enough to

Neo4j 2.2.1 server does not start after db is generated via java code

与世无争的帅哥 提交于 2019-12-25 02:57:27
问题 Started with a new graph.db folder. Am using embedded graph db, java and cypher query to create nodes. It seems to create the nodes successfully. Have debugged and checked the result object. I want to now start the neo4j server to check the nodes in the browser. However, it gives the message: bash-4.2$ ./neo4j-community-2.2.1/bin/neo4j start WARNING : Max 1024 open files allowed, minimum of 40 000 recommended. See the Neo4j manual. Starting Neo4j Server... WARNING : not changing user process

get difference between field values and sum in neo4j

守給你的承諾、 提交于 2019-12-25 02:48:21
问题 How can I get difference between 2 fields: r.rating_val and rw.rating_val and sum of these fields using neo4j query?I really appreciate any help. MATCH (a:user{id:"1"})-[r:`rating`]->(b), (w:user{id:"3"})-[rw:`rating`]->(b) RETURN DISTINCT b,r.rating_val ,rw.rating_val 回答1: Just subtract/add them in the return clause MATCH (a:user{id:"1"})-[r:`rating`]->(b), (w:user{id:"3"})-[rw:`rating`]->(b) RETURN DISTINCT b, r.rating_val-rw.rating_val as difference, r.rating_val+rw.rating_val as sum 回答2:

Turn Neo4j into a triplestore

痴心易碎 提交于 2019-12-25 02:37:28
问题 I want to load a RDF file in Neo4j and turn this into a triplestore but I don't know if I can do this with the spqrl-plugin for Neo4j. I have been looking documentation for this plugin in https://github.com/neo4j-contrib/sparql-plugin, but I get 404 error when I try to open the documentation. The thing is, Do I need to develop a program which parse a RDF file and store the tuples in Neo4j with the turtle format I desire, or there is some feature in the sparql-endpoint which allow me to

Neo4j Cypher - Terminating conditions when using variable level paths

允我心安 提交于 2019-12-25 02:01:48
问题 I have a linked list that is modelled in a circular fashion like so: (u:User) -[:LINK]->(a:NODELINK {linkId: 'aa'}) -[:LINK]->(b:NODELINK {linkId: 'bb'}) -[:LINK]->(c:NODELINK {linkId: 'cc'}) -[:LINK]->(d:NODELINK {linkId: 'dd'}) -[:LINK]->(u) When I query it starting at node (b:NODELINK {linkId: 'bb'}) I would like to match all nodes until I get to the end/start of the list. (The User node) When I run the following query: MATCH (u:USER) WITH u MATCH (nl:NODELINK)-[:LINK*]->(m) WHERE nl

How to query the graph when the intended property name is unknown?

余生颓废 提交于 2019-12-25 01:55:07
问题 A related question is here: How to query property value when property name is a parameter? Let's say if I want to ask "Recommend me 500-dollar phones". And in my graph, I have: create (p:Product {name:"iPhone 1", price:"500", color:"white"}) create (p:Product {name:"iPhone 2", price:"400", color:"white"}) create (p:Product {name:"iPhone 3", price:"800", color:"black"}) Based on the language "Recommend me 500-dollar phones", I know I should query on the Product node, but I don't know the

Slowness observed in obtaining connection using neo4j java jdbc driver

天大地大妈咪最大 提交于 2019-12-25 01:49:05
问题 I have my java application deployed in websphere application server. I am successfully able to connect to neo4j from my java application using jdbc driver. But there are some performance issues with the approach i have followed. Currently neo4j server is running on Xms - 8G and Xmx-16GB. I have less amount of data that is aprox 40mb with 3100 nodes. When we test the performance over http with cypher, the performance is outstanding. But in the java application we are using the jdbc driver to

Neo4j cypher query fails with unknown syntax error

こ雲淡風輕ζ 提交于 2019-12-25 01:43:51
问题 I have the following paramObj and dbQuery paramObj = { email: newUser.email, mobilenumber: newUser.telephone, password: newUser.password, category: newUser.category, name: newUser.name, confirmuid: verificationHash, confirmexpire: expiryDate.valueOf(), rewardPoints: 0, emailconfirmed: 'false', paramVehicles: makeVehicleArray, paramVehicleProps: vehiclePropsArray } dbQuery = `CREATE (user:Person:Owner {email:$email}) SET user += apoc.map.clean(paramObj, ['email','paramVehicles',

Neo4j SDN4 entity inheritance and indexes

纵饮孤独 提交于 2019-12-25 01:35:30
问题 I have a following Cypher query: PROFILE MATCH (childD:Decision) WITH childD ORDER BY childD.createDate DESC SKIP 0 LIMIT 10 MATCH (childD:Decision)-[ru:CREATED_BY]->(u:User) OPTIONAL MATCH (childD:Decision)-[rup:UPDATED_BY]->(up:User) RETURN ru, u, rup, up, childD AS decision, [ (childD)-[rdt:BELONGS_TO]->(t:Tag) | t ] AS tags Right now on my Neo4j database (~23k Decision nodes) this query works ~50 ms and I don't understand or it uses index on childD.createDate field. This is PROFILE output

Issue of casting Node neo4j

荒凉一梦 提交于 2019-12-25 01:08:46
问题 My code is below, As per the documentation it should have given me the node values but it is throwing me exception Exception in thread "main" java.lang.ClassCastException: scala.collection.convert.Wrappers$SeqWrapper cannot be cast to org.neo4j.graphdb.Node at com.neo4j.performance.FetchData.main(FetchData.java:32) I'm using Neo4j 2.2.2. import org.neo4j.graphdb.Node; import org.neo4j.graphdb.Result; import org.neo4j.graphdb.Transaction; import java.util.Iterator; import org.neo4j.helpers