neo4j

Neo4j - calculate & set node property based on relation property

孤者浪人 提交于 2019-12-25 09:06:57
问题 I want to know, if it's possible to calculate & set (update) a node property based relation properties (incoming&outgoing)? In my example, I would like to calculate an user personal "strength factor" (Kind of average) based on his relationships duration (int) divided by the count (int). Thanks for your help in advance, Cheers 回答1: Yes, it's possible. The only trick is that you have to use WITH to first perform the aggregation (for calculating the average): MATCH (n)-[r:RELTYPE]->() WITH n,

Neo4j/Cypher: Match on dynamic property

无人久伴 提交于 2019-12-25 08:38:17
问题 According to the developer manual section 3.2.4 on Parameters: Parameters cannot be used for the following constructs, as these form part of the >query structure that is compiled into a query plan: property keys; so, MATCH (n) WHERE n.$param = 'something' is invalid (source) Is there no way around this (c#, using the official driver)? I have a case where a node of a particular type can contain from a few up to hundreds of properties, and I want the users to be able to search for any of these

Rails Neo4j How to add new field in existing database

拟墨画扇 提交于 2019-12-25 08:29:25
问题 class Invitation include Neo4j::ActiveNode property :email end This is Neo node Invitation node I can see it in the graph database. - If I add some new field in it, for existing nodes it will not reflect in the graph database - If I create a new node I can see it in graph database So the question is if I have to add one field suppose property :valid, type: Boolean, default: true How can I add this so that I can see it in existing nodes in graph database???, same like we do in active record

I need to count the number of connection between two nodes with a certain property

烂漫一生 提交于 2019-12-25 08:28:50
问题 My database contains informations about the nominations for the accademy awards. I want to know how many directors have won an oscar for "best director" more than one time. I can't quite get to the result that i want, a list of nominees. The closest I've been is with this query: MATCH (n:Nominee)-[n1:NOMINATED]->(c:Category) WHERE c.name="Best Director" AND n1.win=true RETURN count(n1.win), n.name ORDER BY n.name; wich returns the directors names and the number of times they won an oscar. I

Neo4j: MERGE creates duplicate nodes

北城以北 提交于 2019-12-25 08:11:22
问题 My database model has users and MAC addresses. A user can have multiple MAC addresses, but a MAC can only belong to one user. If some user sets his MAC and that MAC is already linked to another user, the existing relationship is removed and a new relationship is created between the new owner and that MAC. In other words, a MAC moves between users. This is a particular instance of the Cypher query I'm using to assign MAC addresses: MATCH (new:User { Id: 2 }) MERGE (mac:MacAddress { Value:

Neo4j Spring Data example missing annotation @Indexed

老子叫甜甜 提交于 2019-12-25 07:59:15
问题 Trying to run the neo4j spring data example on http://projects.spring.io/spring-data-neo4j/ <dependencies> <dependency> <groupId>org.springframework.data</groupId> <artifactId>spring-data-neo4j</artifactId> <version>4.1.2.RELEASE</version> </dependency> </dependencies> And @NodeEntity public class Movie { @GraphId Long id; @Indexed(type = FULLTEXT, indexName = "search") String title; Person director; @RelatedTo(type="ACTS_IN", direction = INCOMING) Set<Person> actors; @RelatedToVia(type =

What is the neo4j-rest-graphdb version which supports neo4j-community-2.3.0-M02

只愿长相守 提交于 2019-12-25 07:54:55
问题 What is the neo4j-rest-graphdb version which supports neo4j-community-2.3.0-M02 version? I'm already checked 2.0.0-M06,2.0.0 and 2.0.1 versions but all gives following exception. java.lang.RuntimeException: Error reading as JSON '' at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57) at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62) at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:114) at org.neo4j.rest.graphdb.RequestResult

Extensions for Computationally-Intensive Cypher queries

纵然是瞬间 提交于 2019-12-25 07:31:16
问题 As a follow up to a previous question of mine, I want to find all 30 pathways that exist between two given nodes within a depth of 4. Something to the effect of this: start startnode = node(1), endnode(1000) match startnode-[r:rel_Type*1..4]->endnode return r limit 30; My database contains ~50k nodes and 2M relationships. Expectedly, the computation time for this query is very, very large; I even ended up with the following GC message in the message.log file: GC Monitor: Application threads

Trouble reading neo4j rest api query results interatively

孤街醉人 提交于 2019-12-25 07:29:18
问题 I really hope this hasn't been asked and my search skills lacking. I am currently learning how spring data interacts with the neo4j stand-alone server via the rest api (spring-data-neo4j-rest) and ran into an interesting issue with iterating a query result. I started by creating the neo4j project (using an embedded db) found in the book Instant Spring Tool Suite, verifying that it worked, upgrading the project to the most recent release of Spring, verifying that worked and then pointed it at

Neo4j - Get Level2 or Level3 connections

风格不统一 提交于 2019-12-25 07:27:48
问题 I'm developing a small connections structure to understand the concept of graph databases better, as well learn Neo4J I have few users and the relationship between them is KNOWS as follows I have the following cqls to create the nodes and relationships between then in Neo4j. CREATE (user1:User {name:"User1",mail:"user1@test.com",mobile: 9000090001}) CREATE (user2:User {name:"User2",mail:"user2@test.com",mobile: 9000090002}) CREATE (user3:User {name:"User3",mail:"user3@test.com",mobile: