neo4j

How to do relative node ordering using Neo4J Cypher?

假装没事ソ 提交于 2020-01-06 07:16:07
问题 I'm building a Maven dependency graph using Neo4J. One of the queries I need to support is finding all nodes that depend on a particular dependency. So if C depends on B and A, and B depends on A, findByDependency(A) should return B and C. I implemented this using the following query, and it's working: MATCH (v1)-[:DEPENDS_ON]->(v2) WHERE EXISTS (v1.gav) AND v2.gav = "A" RETURN DISTINCT v1.gav However, in my example above, C also depends on B in addition to depending on A. I'd like the result

How to add multiple values to a property in neo4j

老子叫甜甜 提交于 2020-01-06 06:57:53
问题 I am new to neo4j and trying to add multiple values to a property of a node.How to do it? create (e:Employee{name:"Sam",languages:["C","C#"]}) Tried this but didn't find any proper way to add multiple values to an attribute. 回答1: Properties cannot have object values. If you're looking to store multiple properties on language , and those properties all belong to the language and not any other entity, then you should model Language as a node. You can store properties on the relationship between

neo4j update query using post method

回眸只為那壹抹淺笑 提交于 2020-01-06 06:57:31
问题 I am using neo4j javascript driver .need update query using post req when. Post req contains updated JSON data. Which I need to update to existing data using an update query app.use('/api/companyDetails/edit', function (req, res, next) { if (req.method === 'POST') { console.log(req.body); session // query here .then(function (result) { console.log(result); res.status(200).send({success: true, message: 'Data Updated Successfully'}); }); res.set('content-type', 'application/x-www-form

How to add multiple values to a property in neo4j

江枫思渺然 提交于 2020-01-06 06:57:00
问题 I am new to neo4j and trying to add multiple values to a property of a node.How to do it? create (e:Employee{name:"Sam",languages:["C","C#"]}) Tried this but didn't find any proper way to add multiple values to an attribute. 回答1: Properties cannot have object values. If you're looking to store multiple properties on language , and those properties all belong to the language and not any other entity, then you should model Language as a node. You can store properties on the relationship between

Spring Data Neo4j: filter by LocalDate doesn't work

时光毁灭记忆、已成空白 提交于 2020-01-06 06:52:10
问题 My small Neo4j playground application (based on Spring Boot 2, Spring Data Neo4j and the embedded driver) is a small note-keeping software. The users can filter their notes by creation date. To get a better understanding of Cypher I wrote the Cypher query using SDN's @Query ( NoteRepo.findByDay(day) ). However I can't get the filtering working. I'm confused that the LocalDate was transformed into a map (last line of the console output). In the previous query ( NoteRepo.findBySnoozeUntil(day)

Neo4j. Dynamic query with multiple filters on nodes

我的未来我决定 提交于 2020-01-06 05:26:25
问题 I have nodes like this and I need apply filter to them { "value": "ma", "object_field_id": 2293 } { "value": 2, "object_field_id": 2294 } MATCH (:UserData {user_id:19})-[:CARD]-(c:Card)-[:FIELD_GROUP]-()-[:FIELD]-(fi:Field) WHERE fi.object_field_id IN [23,24] AND (fi.value=~('(?iu).*149.*') AND fi.value=~('(?iu).*gb.*')) RETURN c but it doesn't work with AND Where is my mistake? 回答1: Here Is Query data for to build relations and nodes: CREATE (a:UserData {user_id: 19})-[r:CARD]->(b:Card {name

How to calculate rank for float values in Neo4j?

核能气质少年 提交于 2020-01-06 04:50:11
问题 I am calculating a set of paths using apoc.algo.dijkstra. My goal is to assign a rank to each of the suggested paths. Important is all the weights among nodes are floats. Cypher code: ... WITH origin, target CALL apoc.algo.dijkstra(origin, target, 'link', 'Weight') yield path as path, weight as weight ... what I have now: Path 1 - Weight: 1.2344332423 Path 2 - Weight: 0.8432423321 Path 3 - Weight: 0.9144331653 Something what I need is: rank: 1, weight: 1.2344332423 rank: 2, weight: 0

neo4j in JEE (JBoss) environment:

丶灬走出姿态 提交于 2020-01-06 04:29:10
问题 I have built a RESTful web service for Wildfly using Neo4j OGM, but when I access it I get a NullPointerException . It seems that a Map that should be populated with my model classes has not been initialized by the time it is accessed. Why is this happening? Upfront I have to say that this module, salessupport-ui , is currently implemented as a fat client using javafx and it works fine connecting to the neo4j community edition 2.2.4, reading, writing, no problem. What I would like to do now

Neo4j Community Edition 3.0.1 failed to start

拥有回忆 提交于 2020-01-06 03:41:06
问题 I populated Neo4j database using Gremlin console 3.1.2. Checked that data is persistent by exiting the above console and then go back to it pointing to my local database location: >graph=Neo4jGraph.open('/MyNeo4jDB/graphdb') >g = graph.traversal() >g.V() ==>v[0] ==>v[1] ==>v[2] ==>v[3] Working on Windows 7 Professional. I also checked that directory C:\MyNeo4jDB\graph.db has been created and populated with files. I would like to see visual representation of my data by using "Neo4j Community

Build a dynamic query using neo4j client

自闭症网瘾萝莉.ら 提交于 2020-01-06 02:58:06
问题 I read many questions on this topic and created the following almost dynamic query: var resQuery = WebApiConfig.GraphClient.Cypher .Match("(movie:Movie {title:{title}})") .WithParam("title", title) .Return(() => new { movie = Return.As<string>("movie.title") }).Results; Unfortunately this isn't dynamic since I'm declaring the movie property in the Return anonymous type. In all the examples I found the only option is to return the nodes as an object matches the node properties, like: movie =