neo4j

Find Neo4j nodes where the property is not set

╄→гoц情女王★ 提交于 2019-12-10 12:29:08
问题 Using Cypher, how can I find a node where a property doesn't exist? For example, I have two nodes: A = {foo: true, name: 'A'}, B = { name: 'B'} Now I'd like to find B, selecting it on the basis of not having the foo property set. How can I do this? 回答1: As Michael Hunger mentioned MATCH (n) WHERE NOT EXISTS(n.foo) RETURN n On older versions of Neo4j you can use HAS: # Causes error with later versions of Neo4j MATCH (n) WHERE NOT HAS(n.foo) RETURN n 回答2: MATCH (f) WHERE f.foo IS NULL RETURN f

Neo4j SPARQL-plugin REST usage

时光毁灭记忆、已成空白 提交于 2019-12-10 12:16:13
问题 Im trying to run a SPARQL-query on my neo4j database by using the REST API. For getting a SPARQL-endpoint, Ive installed the Noe4j SPARQL-plugin (https://github.com/neo4j-contrib/sparql-plugin). My system now exposes these sparql-endpoints: http://localhost:7474/db/data/ext/SPARQLPlugin/graphdb/insert_quad http://localhost:7474/db/data/ext/SPARQLPlugin/graphdb/execute_sparql Im trying to use the sencond one to execute queries. The HTTP POST Request is supposed to be like "Example 2" in http:/

How to use Create Unique with Cypher

时间秒杀一切 提交于 2019-12-10 12:06:22
问题 My target is to create node + set new property to it in case not exists if it's exist I just want to update it's property Tried this: MATCH (user:C9 {userId:'44'}) CREATE UNIQUE (user{timestamp:'1111'}) RETURN user *in case the node with the property userId=44 already existed I just want to set it's property into 1111 else just create it and set it. error I am getting: user already declared (line 2, column 16 (offset: 46)) "CREATE UNIQUE (user{timestamp:'1111'})" should I switch to Merge or?

How to deal with the Neo4j ReferenceNode when using Tinkerpop

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-10 12:03:23
问题 ... always getting exceptions when creating a edge/relation between a vertex and the Neo4j - ReferenceNode. How to handle something like this? GraphDatabaseService neoGraphDbService = new EmbeddedGraphDatabase( "d:/testDb" ); System.out.println(neoGraphDbService.getReferenceNode()); // Node[0] Graph tiGraphDb = new Neo4jGraph(neoGraphDbService); Vertex referenceNode = tiGraphDb.getVertex(0); //throws Exception: //org.neo4j.graphdb.NotFoundException: Node[0] System.out.println

File Lock Exception

╄→гoц情女王★ 提交于 2019-12-10 11:58:18
问题 I am using neo4j grails plugin for embedded mode. I am getting file lock exception.i make sure,no other process is using this file. i have tried to give super user permission to file use chmod but it didn't work. so how can i resolve it Exception stack follows -> Caused by OverlappingFileLockException: null >> 1154 | tryLock in java.nio.channels.FileChannel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | 113 | tryLock in org.neo4j.kernel.impl.nioneo.store

Increase Heap Space Available for JVM: OutOfMemoryError: Requested array size exceed VM limit Ubuntu 64Bit Neo4j 2.0

本小妞迷上赌 提交于 2019-12-10 11:54:08
问题 My specs: -Ubuntu 64bit -Neo4j 2.0 -32 GB of Ram -AMD FX-8350 Eight COre Processor The problem: I'm making a request to my Neo4j server with the following query: MATCH (being:my_label_2) RETURN being And gives me this error: OutOfMemoryError Requested array size exceeds VM limit StackTrace: java.lang.StringCoding$StringEncoder.encode(StringCoding.java:300) java.lang.StringCoding.encode(StringCoding.java:344) java.lang.String.getBytes(String.java:916) org.neo4j.server.rest.repr.OutputFormat

Mysql vs Cypher vs Gremlin on union query

谁说胖子不能爱 提交于 2019-12-10 11:52:50
问题 I working on a project where I have to make real time recommandation based on filters. I decided to take a look on graph db and started to play with neo4j and compared it performance with mysql. rows are about : "broadcast": 159844, "format": 5, "genre": 10, "program": 60495 the mysql the query look like : select f.id, sum(weight) as total from ( select program.id, 15 as weight from broadcast inner join program on broadcast.programId = program.id where broadcast.startedAt > now() and

neo4j windows desktop: Unrecoverable authentication error

此生再无相见时 提交于 2019-12-10 11:46:51
问题 I run ne04j-desktop-1.0.6-setup.exe to install the desktop neo4j application, and it proceeds through the install up to the point where it opens, and then gives the message (in a red warning rectangle with only a dismiss button) "Unrecoverable authentication error". How can I find out what the error is and try to fix it? 回答1: I had this problem too, try to put the comptability mode on Windows 7. If it don't work immediatly, try to reload the app by clicking on "Reload" in the "Developper" tab

performance of time filters in neo4j where

无人久伴 提交于 2019-12-10 11:42:58
问题 So this is a neo4j graph database design question. Is having a where filter on a date property relatively performant or should I start to create nodes and relationships to help filter that. For instance, using the neo4j movie graph example. MATCH (nineties:Movie) WHERE nineties.released > 1990 AND nineties.released < 2000 RETURN nineties.title If there were millions of movies, would this query be doing what would be akin to a table scan of all movies and then filtering - would creating an

Neo4jClient - Merge within ForEach with 1000 very slow (Unique Constraint)

a 夏天 提交于 2019-12-10 11:40:57
问题 This stems off of this SO question: Map params with Merge or build a Batch operation via the client? This query: FOREACH (n in {set} | MERGE (c:Label {Id : n.Id}) SET c = n) Works well for being able to update or create new nodes based on a unique key (in this case, Id). It is, however, very slow. When I try to process a list of 42000 items, in batches of 1000, it takes about 2 minutes to complete. In terms of hardware, this is running on my laptop (i7, 8GB RAM, Samsung 840 Pro SSD). By the