neo4j

Neo4j Cypher Console Changing Database

泪湿孤枕 提交于 2019-12-08 00:08:44
问题 I've just started to learn the Neo4j graphs db, i am a .net developer and i have downloaded the .net version also the sample MVC project for .net (hour ago), I manage to make the project run and playing with it. Upon playing with the Cyphers Console, somehow i cant find the data's from the sample, maybe the default database of the console is pointing to the default db, how do i move to the database that is created by my sample project. is there such thing as database/schema here just like in

neo4j LOAD CSV returns Couldn't Load external resource

我的梦境 提交于 2019-12-07 22:41:20
问题 Trying CSV import to Neo4j - doesn't seem to be working. I'm loading a local file using the syntax: LOAD CSV WITH HEADERS FROM "file:///location/local/my.csv" AS csvDoc Am wondering if there's something wrong with my CSV file, or if there's some syntax problem here. If you didn't read the title, the error is: Couldn't load the external resource at: file:/location/local/my.csv [Neo.TransientError.Statement.ExternalResourceFailure] 回答1: Neo4j seems to need a full path spec to get a file on the

How to use Neo4j for finding Minimum Spanning Tree?

泄露秘密 提交于 2019-12-07 20:36:29
I am wondering how to use Neo4j to find the MST? Most examplesI found was using Hadoop to find it. I don't think that this is possible in Cypher, given how current algorithms determine an MST (if I'm wrong on this, I'd love to know). Instead, I'd recommend implementing one of the algorithms used for determining an MST, e.g. Prim's Algorithm. It's quite straight forward and, with the help of heaps and adjacency lists, is relatively performant. A quick search for the algorithm will turn up many links. I'm sure leveraging Neo4j's Core API or Traversal API might even help things integrate even

Neo4j regex string matching not returning expected results

烈酒焚心 提交于 2019-12-07 19:51:33
问题 I'm trying to use the Neo4j 2.1.5 regex matching in Cypher and running into problems. I need to implement a full text search on specific fields that a user has access to. The access requirement is key and is what prevents me from just dumping everything into a Lucene instance and querying that way. The access system is dynamic and so I need to query for the set of nodes that a particular user has access to and then within those nodes perform the search. I would really like to match the set of

How to use custom self signed certificates in Neo4j (instead of snakeoil.cert)?

為{幸葍}努か 提交于 2019-12-07 19:47:53
问题 Recently I ran into the problem of generating a custom certificate that does not bind to 0.0.0.0 in Neo4j. It turns out that Neo4j - in contrast to the documentation - expects DER certificates for both the public and private key. I will post lessons learned in respons to this question. Rob 回答1: sudo vi /etc/neo4j/neo4j-server.properties uncomment org.neo4j.server.webserver.address=0.0.0.0 check: org.neo4j.server.webserver.https.enabled=true check: org.neo4j.server.webserver.https.port=7473

Neo4j - Unit testing REST Api calls

给你一囗甜甜゛ 提交于 2019-12-07 19:32:49
问题 I'm about to use Neo4j Server (Rest Api). I've thought to the way of unit testing Neo4j. I found NoSqlUnit that play the same role as DbUnit but dedicated to NoSql database like Neo4j. However, main solutions are easy to set up for those who use the embbeded version of Neo4J (in plain Java, Scala ..). Is there an effective way to unit test Rest Api calls thanks to an embedded database substitution? UPDATE ---------------------- Sorry, I misread the NoSqlUnit documentation. It seems that an

Neo4j shortest path (BFS) distances query variants

不羁岁月 提交于 2019-12-07 19:31:01
问题 I do not know Neo4j so, bear with me. I have a big (1M nodes) undirected, unweighted graph. Assume I magically import this graph to Neo4j. Can the Neo4j query engine (cypher) support those the following types of queries? Range queries. Bring all me nodes (and their distances) that are within 3 hops distance from a specific node Bring the shortest-path (BFS) distance (since the graph is undirected and unweighted) between a specific node and a set of nodes. Bring the shortest-path (BFS)

Return multiple relationship counts for one MATCH statement

╄→尐↘猪︶ㄣ 提交于 2019-12-07 19:06:16
问题 I want to do something like this: MATCH (p:person)-[a:UPVOTED]->(t:topic),(p:person)-[b:DOWNVOTED]->(t:topic),(p:person)-[c:FLAGGED]->(t:topic) WHERE ID(t)=4 RETURN COUNT(a),COUNT(b),COUNT(c) ..but I get all 0 counts when I should get 2, 1, 1 回答1: A better solution is to use size which improve drastically the performance of the query : MATCH (t:Topic) WHERE id(t) = 4 RETURN size((t)<-[:DOWNVOTED]-(:Person)) as downvoted, size((t)<-[:UPVOTED]-(:Person)) as upvoted, size((t)<-[:FLAGGED]-(

How to connect Blueprints to a remote neo4j server

≡放荡痞女 提交于 2019-12-07 19:00:59
问题 I am trying to merge two separate efforts. I have an application that currently uses anormcypher to talk to a remote neo4j database, and I am now developing an application that uses TinkerPop Blueprints . In Blueprints I can create a new embedded Neo4jGraph but I don't know how to connect it to my remote neo4j (community edition, not HA) server. I'm looking for the documentation that tells me how to configure that connection (host::port) . 来源: https://stackoverflow.com/questions/30405929/how

Cypher query execution time with Neo4j java driver

瘦欲@ 提交于 2019-12-07 18:55:02
问题 I am trying to find out execution time of my Cypher query with java driver. Session session = driver.session(); session.run( "CREATE (a:Person {name:'Arthur', title:'King'})" ); StatementResult result = session.run( "Profile MATCH (a:Person) WHERE a.name = 'Arthur' RETURN a.name AS name, a.title AS title" ); But I could not find it anywhere in the StatementResult or in the ResultSummary, which is returned by StatementResult.consume(query) . I could access db hits from ProfiledPlan in