neo4j

Neo4j 4.2 graph repo save method is now ambiguous

被刻印的时光 ゝ 提交于 2019-12-12 15:00:48
问题 I have just updated from Spring Data Neo4j 4.1.3 to 4.2.7 But, I have not been able to get my project to start running again after changing the maven dependency. I have fixed many issues as described in this tutorial: https://graphaware.com/neo4j/2016/09/30/upgrading-to-sdn-42.html But I cannot figure out why this issue has emerged. In my service > GenericService.java > createOrUpdate ... @Override public T createOrUpdate(T entity) { getRepository().save(entity, DEPTH_ENTITY_NEXT); //ERROR

Neo4j Unmanaged Extension and GuardTimeoutException

百般思念 提交于 2019-12-12 14:27:37
问题 I am in great need of some advice regarding an issue I'm running into with a Neo4j unmanaged extension that I'm building in Java. I have created a very simple code sample that highlights my issue. The basic premise is that I'd like to set the org.neo4j.server.webserver.limit.executiontime for the neo4j server to a reasonable amount of time for user queries (lets say 2 minutes) which are coming in through Cypher, other endpoints, etc. But I also have some batch jobs that I need to run through

Neo4j unmanaged extension - add custom request Filter to web server

眉间皱痕 提交于 2019-12-12 14:21:37
问题 We have unmanaged extension. We implemented custom communication API between server and client. Now we need to ensure that client and server have same API version. One solution - verify version in each resource. But this approach is messy and leads to code duplication. What we want is to implement our own Filter and add it to Neo server. Is this possible? If yes - then how? 回答1: This is possible! Approach is a bit tricky and fragile, but it's working (blog post). Dependency You need neo4j

Auto Increment in Neo4j

痞子三分冷 提交于 2019-12-12 14:17:38
问题 Is there a way to set an auto_increment just like you would in MySQL for Neo4j? For example, I want nodes to start with numbers like 1000000000 when I create them with the GraphDatabaseService object. Thank you very much. 回答1: Checkout this answer: Can I create a node in neo4j with specified id? The ID that Neo4J assigns each object different than the PK assigned to a row in a database. the location in the Node index is reflected in the ID that Neo4J assigns. In a Relational Database the

Compare dates with Spring Data neo4j

旧街凉风 提交于 2019-12-12 13:46:15
问题 When querying for relationships on a java.util.Date property, what syntax should I use? I tried just using a query like (this is just an example to show what I'm trying to do, so please don't pay attention to variable names there): @Query("start n1=node({0}) match n1-[r:TYPE]->n2 where r.dateCreated>={1} return r") Page<Relationship> findAll(Node node, long date, Pageable pager); But it throws the following error: Caused by: Don't know how to compare that. Left: 1339845862883; Right:

Cannot deserialize datetime property Neo4j using C# client

一笑奈何 提交于 2019-12-12 13:09:41
问题 I'm trying to get strongly typed objects back out of Neo4j using the C# client. This all works until I add a DateTime property. I've successfully inserted data into the Neo4j database and I can see it using the console. I can also query the data, but I can't return any strongly typed objects because the deserialization seems to fail. I'm using parameters to insert the data: _graphClient.Cypher .WithParams(new { id = node.Id, createdAt = node.CreatedAt, lastModified = node.LastModified })

spring data neo4j 5 - no bean named 'sessionFactory' available

断了今生、忘了曾经 提交于 2019-12-12 12:28:11
问题 I'm using spring data neo4j (5.0.7.RELEASE) and spring (5.0.6.RELEASE) with configuration from the docs https://github.com/spring-projects/spring-data-neo4j#quick-start When I try to start the application it fails with this exception: Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sharedSessionCreatorBean': Cannot resolve reference to bean 'sessionFactory' while setting constructor argument; nested exception is org.springframework.beans

Neo4j OGM example with Scala

本秂侑毒 提交于 2019-12-12 12:06:54
问题 I tried the example mentioned in Luanne's article The essence of Spring Data Neo4j 4 in Scala. The code can be found in the neo4j-ogm-scala repository. package neo4j.ogm.scala.domain import org.neo4j.ogm.annotation.GraphId; import scala.beans.BeanProperty import org.neo4j.ogm.annotation.NodeEntity import org.neo4j.ogm.annotation.Relationship import org.neo4j.ogm.session.Session; import org.neo4j.ogm.session.SessionFactory; abstract class Entity { @GraphId @BeanProperty var id: Long = _

Write a Cypher query to CREATE links between random nodes

此生再无相见时 提交于 2019-12-12 11:50:16
问题 To seed a database, I would like to create a small set of Person nodes... WITH ["Amy","Bob","Cal","Dan","Eve"] AS names FOREACH (r IN range(0, size(names)-1) | CREATE (:Person {name: names[r]}) ) ... and I would like to create a random connection for each Person. Is it possible to do this in a single query? I imagine that I would need to add each new Person to a collection, and work with a variable created from FLOOR(RAND() * size(names)), but the official documentation does not give many

How to calculate a rank in Neo4j

守給你的承諾、 提交于 2019-12-12 11:44:58
问题 I am having two types of nodes ( game & player ) and one relationship (PLAYED). PLAYED relationship is having a property 'points'. Sample Data: Player (309274) scored 10 points Player (309275) scored 20 points Player (309276) scored 30 points Player (309277) scored 40 points Player (309278) scored 50 points I want to calculate a rank of a Player 309278 i.e. 5 from the cypher query. Can anybody help me here to generate cypher query? 回答1: MATCH (p:Player)-[pl:PLAYED]->(:Game {id:{game-id}})