neo4j

Neo4j display subgraph based on multiple paths

天大地大妈咪最大 提交于 2019-12-25 00:46:06
问题 I want to display a subgraph in Neo4j(COMMUNITY EDITION on localhost) based on multiple paths. The paths are the result of a custom traversalDescription() with a special evaluate(Path path) . The intention was to ignore a special sequence of relationships and nodes(details to sequence). As far as i know its not possible in a cypher query. The result looks like this: (268911) (268911)<--[REL1,151]--(276650) (268911)<--[REL1,151]--(276650)<--[REL2,715]--(276651) (268911)<--[REL1,151]--(276650)<

How to set read timeout per query using Java REST binding?

放肆的年华 提交于 2019-12-25 00:39:23
问题 I am using Neo4j 1.9.1 and Kernel 1.8, I want to specify read time out for few queries ... Thanks in advance. 回答1: I'm not sure if that is directly possible. You need to enable guards by config in your server and set a http header max-execution-time as described in Mark's blog post at http://www.markhneedham.com/blog/2013/10/17/neo4j-setting-query-timeout/. Java Rest bindings need to be tweaked, see https://github.com/neo4j-contrib/java-rest-binding/blob/master/src/main/java/org/neo4j/rest

Access neo4j nodes and relationships through java

点点圈 提交于 2019-12-25 00:37:58
问题 I have already loaded 50k nodes and established relationships between them through talend. I wrote java code to connect to neo4j and try to execute cypher query. It is connecting to neo4j but showing wrong results. My java code is: package com.Neo4J; import org.neo4j.cypher.javacompat.ExecutionEngine; import org.neo4j.cypher.javacompat.ExecutionResult; import org.neo4j.graphdb.GraphDatabaseService; import org.neo4j.graphdb.Transaction; import org.neo4j.graphdb.factory.GraphDatabaseFactory;

Issue of casting Node neo4j

a 夏天 提交于 2019-12-25 00:32:23
问题 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

Spring Data Neo4j - relationship properties on complex type class members

扶醉桌前 提交于 2019-12-24 22:07:12
问题 I have a class annotated with @RelationshipEntity. This class contains of object defined by me with some integer values. Is it possible somehow to define that members of the nested object will be saved as properties on the relationship? Justyna. 回答1: Yes, but they should be converted to strings providing customized Spring converters. To avoid declaring a converter for each class you need to embed, you could extend a common interface (even an empty one, just to declare the converters). The

Exception thrown when connecting Neo4j+HA and Spring Data"org.neo4j.kernel.extension.KernelExtensions@3b756db3'

对着背影说爱祢 提交于 2019-12-24 21:27:56
问题 I am trying to create a sample node in Neo4j Graph DB but getting an exception when starting tomcat. I am using Neo4j+HA+Spring Data Graph Repository to create a node. I am sure there is something wrong on how I configured. I am getting below exception. All my 3 neo4j clusters are configured and started.I used exact configuration as specified in the link Neo4j HA Conf Tutorial Let me know if you want me to paste any of other code/classes. I also see that "org.neo4j.kernel

Neo4j create graph that some nodes have more than one relationships

给你一囗甜甜゛ 提交于 2019-12-24 21:05:57
问题 Over my Neo4j I want to create this graph: SO I tried to create some nodes and relationships with: MERGE (D:POINT {NAME:'d'})<-[:LINKS]-(A:POINT {NAME:'a'})-[:LINKS]->(B:POINT {NAME:'b'})-[:LINKS]->(C:POINT {NAME:'c'}) But I cannot find out how I will create the relationships between D and B points also I cannot find out how I will link the A and C as well. Do you have any Idea how to do that? 回答1: In order to avoid unintentionally creating duplicate nodes and/or relationships, you must

How to extract a graph out of Neo4J and reconstruct it in the programming language

狂风中的少年 提交于 2019-12-24 20:12:22
问题 Consider I have a bunch of connected nodes in Neo4J, forming a tree or a graph or whatever, and I want to have them in the programming language that I'm using (I'm using Java but that's not important). I know I can have them all with a single cypher query like this: MATCH (n0:Root)-[:Child*0..]->(nx:Node) WHERE ID(n0) = 1 RETURN nx; But the problem I have here is that once returned to Java, I don't know which node is connected to which! How can I return the data so I can reconstruct the graph

How to count the numbers of node types in the Neo4j graph?

若如初见. 提交于 2019-12-24 19:37:01
问题 MATCH (p:Product), (s:Student), (b:Boy), (a:Attribute) RETURN count(distinct(p)), count(distinct(s)), count(distinct(b)), count(distinct(a)) I want to know how many counts of each node types in the graph using this query. However, the Neo4j Browser gives a warning saying that this query produces a cartesian product. Is there a better way to write the query? 回答1: To get a variety of statistics for your DB, including a count of the number of nodes for every label, you can use the APOC function

neo4j console how to specify local path of existing db?

♀尐吖头ヾ 提交于 2019-12-24 19:15:55
问题 Suppose I have a graph database created with Neo4j Desktop in the path path/neo4jDatabases/database-abc/installation-3.5.5 In a different path I have the neo4j-community-3.5.5 folder (I am on OSX). I am trying to start the path/neo4jDatabases/database-abc/installation-3.5.5 database with neo4j-community. I am trying this command: sudo ./bin/neo4j console -path path/neo4jDatabases/database-abc/installation-3.5.5 but the started database is using the directories of neo4j-community-3.5.5 instead