cypher

The cypher PROFILE keyword asks for a transaction even if there is already one

落花浮王杯 提交于 2019-12-12 02:35:13
问题 I am trying to profile the following query on the neo4j server console (community edition, version 1.9.2): PROFILE START ungrouped=node(1) CREATE (grouped{__type__:'my.package.Grouped'})<-[:HAS_NEXT]-(ungrouped) MATCH (ungrouped)-[:LEAF]->(leaf) WITH leaf.`custom-GROUP` as groupValue, grouped, leaf CREATE UNIQUE (grouped)-[:GROUP]->({__type__:'my.package.Group',groupKey:'GROUP',groupValue:groupValue,groupOrigin:ID(ungrouped)})-[:LEAF]->(leaf) RETURN DISTINCT grouped; When I run the above

neo4j 2.0 - startnode(r) and union all

北战南征 提交于 2019-12-12 01:39:36
问题 I have created relationship named 'friend' between 2 node and want to know, which node is request sender? I seen some post on stackoverflow regarding startnode(r), but I cannot understand how to use? can some one explain me with use case? One more thing, I want to join 2 result sets with "union/union all" clause. How can I do this? thanks. 来源: https://stackoverflow.com/questions/18051685/neo4j-2-0-startnoder-and-union-all

logging the cypher query for spring neo4j

a 夏天 提交于 2019-12-12 01:37:43
问题 I tried to log the cypher query generated by the spring data neo4j by using the following log4j configuration: log4j.rootLogger=DEBUG, stdout log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.category.org.springframework.data.neo4j=DEBUG However, I couldn't see there are cypher queries shown in the log. Anyone has ideas on the ways of investigating the cypher query generated for the spring neo4j data mapping? 回答1: they are

Neo4J - count outermost nodes

╄→гoц情女王★ 提交于 2019-12-12 01:37:17
问题 Given a graph (or subgraph), in this case root Neo... How do I get the nodes which are the furthest depth from the root (i.e not directly connected to nodes of greater depth) which have a specific attribute. eg ... how do I get the green "Get Me" nodes when I'm not interested in the other green ones (they're not the outermost layers) or the orange ones (furthest out on their branch but not green). I don't care about depth .... Thanks for your help Chris 回答1: Another approach to Franks would

Neo4j label index searches with wildcards

情到浓时终转凉″ 提交于 2019-12-12 01:13:40
问题 I'm trying out the new label feature in Neo4j 2.0 (M3), especially in combination with indexing. Lucene indexes seem to be referred to as legacy, so I guess Label indexes are the way to go. How should I write wildcard queries with this new approach? Am I missing something in the code below or is this feature yet to be implemented? You could do this with regex (as shown below), but than you don't use the schema index. public class IndexedLabelTest { public static void main(final String[] args)

Why the query works in neo4jshell but not in neoclipse?

六月ゝ 毕业季﹏ 提交于 2019-12-12 00:39:44
问题 QUERY START t=node(17) MATCH player-[:PLAYED_WITH_TEAM]->t-[:CONTESTED_IN]->league WITH player.name as playerName, league.startDate as startDate, league.name as leagueName ORDER BY startDate RETURN playerName, collect(leagueName); NeoClipse ERROR NeoShell Output neo4j-sh (0)$ START t=node(17) > MATCH player-[:PLAYED_WITH_TEAM]->t-[:CONTESTED_IN]->league > WITH player.name as playerName, league.startDate as startDate, league.name as leagueName > ORDER BY startDate > RETURN playerName, collect

spring neo4j: how can I search data by index field case insensitive?

杀马特。学长 韩版系。学妹 提交于 2019-12-12 00:11:45
问题 Domain class as following: @NodeEntity public class Product{ private Long nodeId; @Indexed(indexName = "productCode") private String code; ... } Repository class: public interface ProductRepository extends GraphRepository<Product>{ @Query(value="start product=node:productCode(code={0}) return product") public Set<Product> findProducts(String code); } how can I make code lookup case insensitive? I try regular expression and fail.Code as following: public interface ProductRepository extends

is it possible to iterate though property of relationship cypher

♀尐吖头ヾ 提交于 2019-12-11 23:48:05
问题 This is related to this question: How to store properties of a neo4j node as an array? I would like to iterate through a property of a relationship and check max of that value and assign a new relationship of node1 and node2 and delete node1 from the pool and move to the second one. In other words as in the context of my previous question, How to assign a given employee to a given position based max(r.score) and move to the other employee who has a maximum r.score for another position? Thanks

Convert multiple relationships between 2 nodes to a single one with weight

淺唱寂寞╮ 提交于 2019-12-11 23:24:12
问题 I have the following graph, describing co-occurrence of car brands in documents: CREATE (`0` :Car {value:"Ford"}) , (`1` :Car {value:"Subaru"}) , (`2` :Car {value:"VW"}) , (`0`)-[:`DOCUMENT` {value:"DOC-1"}]->(`1`) , (`0`)-[:`DOCUMENT` {value:"DOC-2"}]->(`1`) , (`1`)-[:`DOCUMENT` {value:"DOC-3"}]->(`2`); If there are many relationships between two nodes - for the purpose of visualization - I want to replace it with a single one and calculate the weight: VW ---1--- Subaru ---2--- Ford How can

Cypher query with infinite relationship takes forever

﹥>﹥吖頭↗ 提交于 2019-12-11 22:12:39
问题 I'm trying to implement a simple graph db for NYC subway. There are a total of 493 stops with a label :STOP and a property {name:" stop name "}, eg: (n:STOP {name:"Van Cortlandt Park - 242 St"}) -[:DIRECT {dist:0.5}]-> (m:STOP {name:"238 St"}) with a total of 566 relationships [:DIRECT {dist: ...} ] What I'm trying to get is a list of nodes and sum(dist) between them starting from a particular stop and return only the ones with a certain sum(dist) away, the cypher query runs perfectly when I