neo4j

Neo4j slow? I must be doing something wrong, please tell me what it is

此生再无相见时 提交于 2020-01-04 02:52:11
问题 I'm seeing some rather improbable performance results from the embedded Neo4j, on the surface it's orders of magnitude slower than expected so I'm assuming I'm "doing it wrong", although I'm not doing anything complicated. I'm using the latest embedded python bindings for Neo4j (https://github.com/neo4j/python-embedded) from neo4j import GraphDatabase db = GraphDatabase('/tmp/neo4j') I've created fake 1500 products with simple attributes: fake_products = [{'name':str(x)} for x in range(0,1500

neo4j-shell can not connect to neo4j Server

≡放荡痞女 提交于 2020-01-04 02:41:14
问题 I'm using docker version of neo4j (v3.1.0) and I'm having difficulties connecting to neo4j server using neo4j-shell. After running an instance of neo4r:3.1.0 docker, I run a bash inside the container: $ docker exec -it neo4j /bin/bash And from there I try to run the neo4j-shell like this: /var/lib/neo4j/bin/neo4j-shell But it errors: $ /var/lib/neo4j/bin/neo4j-shell ERROR (-v for expanded information): Connection refused -host Domain name or IP of host to connect to (default: localhost) -port

Java Neo4J out of memory

偶尔善良 提交于 2020-01-04 01:28:09
问题 This is a bit like this: Neo4j OutOfMemory problem But it's outdated and apparently so are the solutions as far as I can tell. So I'm trying to insert around 100K nodes with 5.5M relations (I actually cut down my data set so it's now more like <100K nodes with 2.8M relations). After a while, it runs out of memory and I get an exception like so: Exception in thread "GC-Monitor" java.lang.OutOfMemoryError: Java heap space at java.util.Arrays.copyOfRange(Unknown Source) at java.lang.String.<init

How do i retrieve a relationship in Neo4j graph database

吃可爱长大的小学妹 提交于 2020-01-03 19:37:28
问题 Please bear with me I'm new to this: I'm currently using the .Net neo4jClient. Currently I have a Share node and a Customer node. I'm creating a relationship CustomerOwnsShare between them and persisting it. Here's my Relationship class public class CustomerOwnsShare : Relationship, IRelationshipAllowingSourceNode<Customer>, IRelationshipAllowingTargetNode<Share> { public CustomerOwnsShare(NodeReference targetNode) : base(targetNode) { } public int Quantity { get; set; } public float

Return value after deleting node or relationship in neo4j

馋奶兔 提交于 2020-01-03 18:21:52
问题 I have experienced that when I delete some node (which may have relationships) or relationship in neo4j using cypher query, it do not give anything in return like in mysql db. is there any way which can give the confirmation about the number of affected node (like number of node deleted) in cypher ? 回答1: Below query works (I have tried this with neo4j 1.8.1 and 1.9.3 both community and enterprise version) START root=node(1) MATCH root-[r:?]->() WHERE root.Id=12 DELETE r,root return count(root

Return value after deleting node or relationship in neo4j

我们两清 提交于 2020-01-03 18:21:12
问题 I have experienced that when I delete some node (which may have relationships) or relationship in neo4j using cypher query, it do not give anything in return like in mysql db. is there any way which can give the confirmation about the number of affected node (like number of node deleted) in cypher ? 回答1: Below query works (I have tried this with neo4j 1.8.1 and 1.9.3 both community and enterprise version) START root=node(1) MATCH root-[r:?]->() WHERE root.Id=12 DELETE r,root return count(root

Neo4j match multiple relationships

穿精又带淫゛_ 提交于 2020-01-03 17:34:27
问题 How can I write a query that gets nodes that have relationships to ALL nodes of a set. For example: START n=node:people("username:*"), g=node:groups("groupname:A groupname:B") MATCH n-[:M]->g RETURN n This returns users that have relationships to A or B. But I want users that have relationships to A and B. I can't figure out how to do it though. Edit: I need to do this for an arbitrary number of groups, not just A and B. And the reason I'm using index syntax is that this is from user input,

neo4j cypher single vs multiple labels performance

痴心易碎 提交于 2020-01-03 17:32:07
问题 Consider the following example: a neo4j based wiki with lots of articles and much, much more article versions (the history of all edits). How much of a difference does using multiple labels to identify each node article:Article:Public article:Article:Version and querying then the db with MATCH article:Article:Public compared to a db organized like article:ArticlePublic article:ArticleVersion that will then query the relevant documents without having to do an interception of the two groups

How to connect Gremlin Server to a remote Neo4j Database?

笑着哭i 提交于 2020-01-03 17:21:05
问题 I have a Question about the Gremlin Server. Is it possible to connect a Gremlin Server to a Neo4j Server (remote database)? At the Moment I have a Neo4j database in my fileysystem and a Gremlin Server which connect to it. Now I want both Servers running with the same Neo4J Database I use: Gremlin Server 3.1.1 Neo4J Community 2.2.8 (can update to 2.3.2) I've found another Question but without answers How to connect Blueprints to a remote neo4j server 回答1: You can use the SteelBridgeLabs/neo4j

Neo4j/Cypher effective pagination with order by over large sub-graph

故事扮演 提交于 2020-01-03 16:43:33
问题 I have following simple relationship between (:User) nodes. (:User)-[:FOLLOWS {timestamp}]->(:User) If I paginate followers ordered by FOLLOWS.timestamp I'm running into performance problems when someone has millions of followers. MATCH (u:User {Id:{id}})<-[f:FOLLOWS]-(follower) WHERE f.timestamp <= {timestamp} RETURN follower ORDER BY f.timestamp DESC LIMIT 100 What is suggested approach for paginating big sets of data when ordering is required? UPDATE follower timestamp --------------------