neo4j

Neo4j Cypher count query performance optimizaztion

别等时光非礼了梦想. 提交于 2019-12-10 19:07:04
问题 I have the following Neo4j Cypher count() query: MATCH (dg:DecisionGroup)-[:CONTAINS]->(childD:Decision) WHERE dg.id = 1 MATCH (childD)-[relationshipValueRel4:HAS_VALUE_ON]-(filterCharacteristic4:Characteristic) WHERE filterCharacteristic4.id = 4 WITH relationshipValueRel4, childD, dg WHERE (ANY (id IN [5, 25, 106] WHERE id IN relationshipValueRel4.optionIds )) WITH childD, dg RETURN count(childD) as total Right now this query works pretty slow: Cypher version: CYPHER 3.3, planner: COST,

How can I specify which relationship type to use as a function of the current node at every step of a traversal with neo4j?

纵饮孤独 提交于 2019-12-10 19:04:36
问题 I'd like to traverse my graph using the neo4j traversal API, but I need to be able to specify which relationship type to use at every step, and the relationship type to use needs to be a function of the current node. Is there a way to do this? 回答1: in the current Traverser API you can't choose the exact relationship to traverse. Instead, you take the more granular approach of node.getRelationships(), chose the one you want and the end onde on it, and so on. The algo gets a bit more verbose

Creating a node in neo4j with one unique property other than ID

人盡茶涼 提交于 2019-12-10 18:54:31
问题 My Project is based on Spring boot + Neo4j . I am trying to create a new Privilege node , but don't want to duplicate Privilege. Now I have a UserRole node which is holds List<Privilege> . Now I want that when I create a Privilege , it check first is another Privilege exists with same privilegeName property. Below are my domain classes. UserRole Class @NodeEntity public class UserRole { public UserRole(User user, Role role) { this.user = user; this.role = role; } /** For Jackson Parsing **/

Unmanaged extensions taking JSON as parameter

霸气de小男生 提交于 2019-12-10 18:53:01
问题 I'm trying to build an extension to dynamically insert some data in neo4j to no avail. This is my extension code : @Path("/inserter") public class Inserter { private final GraphDatabaseService db; public Inserter(@Context GraphDatabaseService db){ this.db = db; } @POST @Consumes(MediaType.APPLICATION_JSON) @Path("/insert") public void insert(Person x){ Transaction tr = db.beginTx(); //Do something tr.success(); tr.finish(); } } And this is my Person object : package org.neo4j.server.plugin

Neo4j on Amazon Marketplace: Unauthorized with default credentials

我怕爱的太早我们不能终老 提交于 2019-12-10 18:44:37
问题 I just deployed Neo4J from Amazon Marketplace on Amazon ECS I can browse to the GUI but the default credentials (neo4j/neo4j) seems to not work. The error message reads: Neo.ClientError.Security.Unauthorized: The client is unauthorized due to authentication failure. What am I missing? 回答1: Just an extract from the Amazone Usage Instruction : The default password is your EC2 instance id So the password is not neo4j ... 来源: https://stackoverflow.com/questions/48010519/neo4j-on-amazon

Cypher query, Load CSV not responding in Neo4j 2.1

对着背影说爱祢 提交于 2019-12-10 18:44:05
问题 While try to upload the data to Neo4j 2.1 through LOAD CSV command, its not responding and even doesn't throw any exception while try with invalid path. Any comments LOAD CSV FROM "file:///d:/import.csv" AS csvLine MERGE (p:Person { name: csvLine[0]}) MERGE (m:Movie { title: csvLine[1]}) CREATE (p)-[:PLAYED { role: csvLine[2]}]->(m) 回答1: Sorry to hear you're having issues. Please refresh the browser's cache to use the LOAD CSV statement. This is a bug in the milestone release. I've opened an

neo4django: AttributeError: type object 'Model' has no attribute '__metaclass__'

吃可爱长大的小学妹 提交于 2019-12-10 18:42:52
问题 I was just trying neo4django's very own example, namely from neo4django.db import models class Person(models.NodeModel): name = models.StringProperty() age = models.IntegerProperty() friends = models.Relationship('self',rel_type='friends_with') However, when running python manage.py syncdb I get the following error: AttributeError: type object 'Model' has no attribute '__metaclass__' Any ideas? (I would use label "neo4django" here in Stackoverflow, but it does not let me create a new label

Neo4j StartService Failed 1053

风流意气都作罢 提交于 2019-12-10 18:32:08
问题 recentely I met a problem about Neo4j. As I start Neo4j Server,it was installed successfully,but when i start the service,error comes,it reports: [SC]StartService FAILED:1053 The service did not respond to the start or control request in a timely fashion. Then I use : Neo4j.bat console ,it works well,but i still can't access localhost:7474 my dev env is: Neo4j-community-1.9.M01 and the os is Win7 64bit Anyone knows the reason? Many Thanks 回答1: Fire up powershell and head to the /bin directory

Installing neo4j-spatial on neo4j 2.3.1

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-10 18:23:15
问题 I cloned the neo4j-contrib/spatial repo on github, but the recommended "mvn install" doesn't work--it breaks on a bunch of missing files and symbols (e.g. "package org.neo4j.index.impl.lucene does not exist"). The pom.xml file in the repo references neo4j 3.0.0, but I'm running neo4j 2.3.1 on Ubuntu 15.04. Neo4j 3.0.0 is not yet listed as a stable release. There is a separate repo of releases for neo4j-spatial at neo4j-contrib/m2, including one targeting neo4j-2.3.0, but having cloned the

org.neo4j.kernel.GraphDatabaseQueryService No dependency satisfies interface

南楼画角 提交于 2019-12-10 18:08:25
问题 I am just writing a simple program where I am uploading my GTFS files to Neo4j Spatial. I believe it's some configuration error or some problem with Neo4j-spatial libraries, which is why I am not uploading my code which is quite basic as specified here: I imported all the required libraries of neo4j: <dependency> <groupId>org.neo4j</groupId> <artifactId>neo4j</artifactId> <version>3.2.8</version> </dependency> <dependency> <artifactId>neo4j-spatial</artifactId> <groupId>org.neo4j</groupId>