neo4j

Spring Data Neo4j- using transactions causes infinite loop

时光怂恿深爱的人放手 提交于 2020-01-06 15:57:07
问题 I am trying to integrate SDN with my spring-hibernate app. With minimal <neo4j:config> and <neo4j:repositories> configuration, it works fine. But when i include either @Neo4jTransactional or write a custom transactionManager i get an infinite loop in creating nodeEntityStateFactory bean in the intercept method in ConfigurationClassEnhancer class. Here is the exception i get. java.lang.IllegalStateException: Singleton 'nodeEntityStateFactory' isn't currently in creation Here is the intercept

Graph or Relational DB specifically recursion

大城市里の小女人 提交于 2020-01-06 15:21:33
问题 I am about to develop a solution for a customer where the basic entity is a member and members can have different multiple social relationships with other members. For instance Lets say we have four types of members Doctors, Specialist, Nurses and Patients. So one or more Doctors can consult one or more Specialists, One or more Doctors can treat one or more Patients. One or more Doctor is in Charge of one or more Nurses. So if I were to use a Relational DB a high degree of recursion would be

Add a map as property in node or relationship

こ雲淡風輕ζ 提交于 2020-01-06 15:10:13
问题 Is there a way to add a map as property? I want to store address line 1, 2 etc inside the address property itself. something similar to this - RETURN {address: {firstline:"a", secondline:"b"}, name:"ABC"} However when I try this in CREATE or SET it gives me error. I tried this - create (a:Person {name: "ABC", address: {firstline:"a", secondline:"b"}}) Error - Property values can only be of primitive types or arrays thereof 回答1: It is not possible to add map as a property. You should either

Is it possible to force a neo4j transaction to timeout?

断了今生、忘了曾经 提交于 2020-01-06 14:59:07
问题 This might be typical Java 7 boilerplate for accessing some Neo4j data. Is there any mechanism in existence whereby you can set up the transaction to automatically fail and rollback based upon a timeout? try (Transaction tx = graphdb.beginTx()) { Node node = // Get some Nodes ... Iterable<Relationship> rels = node.getRelationships(...); for (Relationship rel : rels) { // Oh no! This is a super-node with a billion Relationships! } tx.success(); return data; } I guess just have int count = 0

NEO4J中COLLECT的用法

拈花ヽ惹草 提交于 2020-01-06 14:33:02
将查询的结果显示到一行记录中,以一个字符串数组的形式展示( 看起来很方便 ) 查询所有电影的名字,并显示到一个数组中; MATCH (n:Movie) RETURN collect(n.title) 还可以和ORDER BY 一起使用,对数组内的结果排序后显示出来 MATCH (n:Movie) with n order by n.title desc RETURN collect(n.title) 来源: CSDN 作者: 陆家嘴的BA 链接: https://blog.csdn.net/fengjssy/article/details/103847287

崛起于SpringBoot2.X + 集成Neo4j图形数据库(70)

会有一股神秘感。 提交于 2020-01-06 14:12:32
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 《SpringBoot2.X心法总纲》 码云地址: https://gitee.com/mdxl/blog.git 提前安装好neo4j,使用Springboot2.1.5版本 1、依赖添加 <dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <optional>true</optional> </dependency> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-neo4j</artifactId> </dependency> 2、配置文件 server.port=8084 #neo4j spring.data.neo4j.uri=bolt://localhost:7687 spring.data.neo4j.username=neo4j spring.data.neo4j.password=76521 3、配置类 import org.neo4j.driver.v1.AuthTokens; import org.neo4j.driver.v1.Driver

Strange neo4j-shell issue connecting to Neo4j in a docker instance

微笑、不失礼 提交于 2020-01-06 13:07:13
问题 I have a really strange problem connecting to a Neo4j instance running in a docker instance. But first things first, here is my set up: Everything runs on a MacOS. I use boot2docker, so the actual Docker instances run in a VirtualBox. I am able to reproduce this issue with Neo4j 2.1.5 and with Neo4j 2.2.0-M04. Additionally, I installed Neo4j locally via homebrew and it is version 2.1.7. It is installed to have a neo4j-shell available. The docker instances are accessible from the outside via

how to use unwind in neo4jclient for updating data?

偶尔善良 提交于 2020-01-06 07:44:20
问题 I want to update some of my records in the neo4j DB. In order that I wrote this query in Neo4jClient in C#: _client.Cypher .Unwind(skills, "updatedSkill") .Match("(s : Skill {Name: updatedSkill.Name}") .Set("s = updatedSkill"); .ExecuteWithoutResults(); Where skills is a simple list of Skill objects: public class Skill { public string Name { get; set; } public string Phrase { get; set; } } But this code throws exception when I call it. Its translated Cypher query is: UNWIND [{ "Name": "name1"

Fiddler4 in windows server 2012 provokes RestSharp Requests to be null

为君一笑 提交于 2020-01-06 07:37:28
问题 So I'm testing Neo4J in pure REST (no Neo4JClient) and I have this code: var client = new RestClient("http://url"); string requestText = "{ \"query\" : \"start x = node(1) match path = (x--IsFriendOf) return path, IsFriendOf.name\", \"params\" : { }}"; var request = new RestRequest(); request.Method = Method.POST; request.RequestFormat = DataFormat.Json; request.Resource = "/foo/bar"; request.AddHeader("Content-Length", requestText.Length.ToString()); request.AddHeader("Host", "ip:port");

Convert Neo4j query in c# using optinal match and merge

半世苍凉 提交于 2020-01-06 07:19:12
问题 Im trying to convert a Neo4j Cypher query that works in Neo4j Desktop but when im trying to use it on c# it doesn't work, can someone help me? C# query: var type = typeof(T).Name; var client = Graph.GetClient(); client.Cypher .Match("(location:Location") .Where((Location location) => location.GeoNameId == entityGiven.GeoNameId) .OptionalMatch("()-[r:HAS]->(location)") .Delete("r") .With("l") .Match("admin:" + type + ")") .Where((Admin admin) => admin.GeoNameId == geoNameId) .Merge("(admin)-[