neo4j

Travis-CI “The command ”bundle exec rake“ exited with 1.” + mystery 404 error

时间秒杀一切 提交于 2019-12-24 15:01:21
问题 bundle exec rake runs all tests perfectly fine locally . However, Travis CI keeps blowing up with Problem accessing /authentication without giving much more info to go on. Here's one of the failed builds: https://travis-ci.org/Nase00/Horizon/builds/48094102 For the life of me, I cannot figure out what is causing an authentication error when Travis tries to run bundle exec rake . Here's the project repo: https://github.com/Nase00/Horizon 回答1: I'm not sure what version of Neo4j Travis uses (

Delete several nodes in Neo4j

亡梦爱人 提交于 2019-12-24 14:42:55
问题 I have an array of multiple IDs of nodes to delete. Every Cypher example I can find either deletes one node or all nodes. How would one delete nodes that match an array of IDs, in a single query? Something like this... (pseudocode) : MATCH (n:Node) WHERE (n.id in ['id_a', 'id_b']) DELETE n; 回答1: You can use the IN list operator: If id is a property: WITH [1,2,3,4] AS ids MATCH (n) WHERE n.id IN ids DETACH DELETE n; If by id you mean the internal node id: WITH [1,2,3,4] AS ids MATCH (n) WHERE

Implementing Lazy Loading in Spring Data Neo4j

拟墨画扇 提交于 2019-12-24 14:41:52
问题 Spring Data Neo4j doesn't have lazy loading. I want lazy loading in my project anyway. After all, what's really the point of having a getter if I can't rely on it to actually get what I want it to get every time? So to make my domain models be lazy loaded, I was thinking of annotating them as spring components and adding logic to my getters that lazy loads fields when I try to access them. I know this will strongly couple my models to neo4j, but I'd rather have that strong coupling than no

cypher PROFILE via neo4j REST API

孤街醉人 提交于 2019-12-24 14:28:35
问题 Can anyone tell me how to run a PROFILE'd query using teh neo4j REST API such as PROFILE MATCH (n:LABEL) return n; When I run this either in Java using the RestCypherQueryEngine or the even using a raw HTTP post directly I get message: "Invalid input 'P': expected SingleStatement (line 1, column 1) "PROFILE MATCH (n:LABEL) return n;" ^" exception: "SyntaxException" I though I had read somewhere that this is possible not only through the server console 回答1: The old cypher endpoint (i.e /db

Creating Relationships in Neo4J using Spring-Data

落爺英雄遲暮 提交于 2019-12-24 14:09:48
问题 I want to create a relationship in neo4j where a Person has a list of friends. I can do this in two ways using spring-data. a) Create a class Person with a List repesenting friends and annotate the same with @Relationship. @NodeEntity(label="Person") public class Person { @GraphId private Long id; private String firstName; private String lastName; private String email; @Relationship(type = "FRIEND_WITH") List<Person> friends; } b) Create the Person object without any List and create the

Neo4j manual/explicit indexes and non-string range queries

时光总嘲笑我的痴心妄想 提交于 2019-12-24 14:06:12
问题 I was able to port my Neo4j 3.4.0 application to use manual indexes and APOC procedures instead of queries over the indexles relationship properties. Everything is working like a charm except one last thing - I ran into the issue with non-string Lucene range queries. They are not working as expected Lucene query language and numeric range For example: I'm applying the following Lucene query predicate in order to get all inclusive numbers in 2 to 6 range: value:[2 TO 6] and receive the

neo4jclient merge query cause unhandled exception

与世无争的帅哥 提交于 2019-12-24 13:57:13
问题 I want to use merge in my neo4jclient c# application, so I read this link and create a query like the below one : resultList.ForEach( tweets => client.Cypher .Merge("(tweet:Tweet {newtweet})") .OnCreate() .Set("tweet = {newtweet}") .WithParams(new Tweets(tweets)) .ExecuteWithoutResults()); But it crash and I don't know what I am missing. Which part of my code is wrong? 回答1: First define your tweet class: public class Tweet { public long StatusId { get; set; } public string Author { get; set;

neo4j partial dump with cypher in java

你。 提交于 2019-12-24 13:38:36
问题 Yesterday i asked a question but it was unclear, so i created a new one with really better explanations to find the answer i need :). So, in my Java Application, i need to do a neo4j copy System, here is an example: A <--- this is a project / \ <--- With relationships B C <--- and subnodes + Labels / \ / \ <--- with a depth unknown ......... I need to do a copy of this in my database, with another id, like this: A A1 / \ / \ B C B1 C1 / \ / \ / \ / \ ......... .......... In neo4j shell, i can

Java - Check if index already exists neo4j (if clause)

浪尽此生 提交于 2019-12-24 13:35:38
问题 I'm actually building onto the question: How to check if a schema index already exists for a node's property in neo4j? I can however not find how to do the actual if clause. For example: label = DynamicLabel.label("Label"); Iterable<IndexDefinition> indexes = schema.getIndexes(label); for(IndexDefinition index : indexes) { if(index.equals(schema.indexFor(label).on("id"))) { // index exists on property "id" on label "Label"! } } This however isn't working! 回答1: The following snippet should

neo4j - Issue converting gremlin query to cypher

一个人想着一个人 提交于 2019-12-24 13:26:39
问题 I've been using NEO4j database for a recent project at work. Recently, we noticed that Cypher queries run faster than Gremlin so we decided to convert our queries. We are running the queries using the .Net graph client. There is one Gremlin query that I'm having trouble converting to Cypher. ----Gremlin(this works and produces a result of Node(CustomerNode)....should be brackets around CustomerNode but the editor won't take it) var results2 = graphClient.RootNode .Out<ApplicationNode>(