cypher

Cypher query gives unnecessary relationships

瘦欲@ 提交于 2019-12-29 09:13:07
问题 I am trying to display only one relevant relationship in the cypher query web browser but it displays all the relationships in between nodes. I am running following query: MATCH (emp:Employee)-[e:EMPLOYED {dateendrole:"Current"}]->(c:Company {companyname:"xyza"}) MATCH (emp)-[ea:EDU_ASSOCIATED]->(ec:Company) MATCH (another_emp:Employee)-[ea1:EDU_ASSOCIATED {overlapyearstart:ea.overlapyearstart, overlapyearend:ea.overlapyearend}]->(:Company {comp_id:ec.companyId}) RETURN emp, e, c, ea, ec,

Update to: Adding node to Neo4j Spatial Index

独自空忆成欢 提交于 2019-12-29 04:28:07
问题 I'm hoping someone can provide some updated clarification on adding nodes to Spatial. The best instructions I can find is: Neo4j Spatial 'WithinDistance' Cypher query returns empty while REST call returns data However it's almost 2 years old and has some contradictory information with an acknowledged bug (https://github.com/neo4j-contrib/spatial/issues/106), which appears to still be open. I also found this tutorial: http://mattbanderson.com/setting-up-the-neo4j-spatial-extension/ Which says

How to create unique constraint involving multiple properties in Neo4J

瘦欲@ 提交于 2019-12-28 16:32:18
问题 I know I can create a unique constraint on a single property with Cypher like CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE . But I was wondering whether it is possible to create a unique constraint which involves multiple properties. If so, how? 回答1: neo4j (2.0.1) does not currently support a uniqueness constraint that covers multiple properties simultaneously. However, I can think of a workaround that might be acceptable, depending on your use cases. Let's say you want properties

How to create unique constraint involving multiple properties in Neo4J

雨燕双飞 提交于 2019-12-28 16:32:07
问题 I know I can create a unique constraint on a single property with Cypher like CREATE CONSTRAINT ON (p:Person) ASSERT p.name IS UNIQUE . But I was wondering whether it is possible to create a unique constraint which involves multiple properties. If so, how? 回答1: neo4j (2.0.1) does not currently support a uniqueness constraint that covers multiple properties simultaneously. However, I can think of a workaround that might be acceptable, depending on your use cases. Let's say you want properties

NeoClientPHP Issue when retrieving data from Neo4J

别说谁变了你拦得住时间么 提交于 2019-12-25 16:58:27
问题 Currently, I am still learning the Neo4J Graph Database and plan to migrate my current RDBMS into Graph Database. So I was searching the methodology of how to connect Neo4J in PHP/Codeigniter until i found out that Neoxygen-NeoClient was the answer. After I installed it using composer then i planning to test it. I created a new page called connection.php and placed in a root folder. Unfortunately right now i'm having some problem when to get data from Neo4J in my localhost and And below is

Neo4j List Consecutive

有些话、适合烂在心里 提交于 2019-12-25 16:46:54
问题 I am currently working with a football match data set and trying to get Cypher to return the teams with the most consecutive wins. At the moment I have a collect statement which creates a list i.e. [0,1,1,0,1,1,1] where '0' represents a loss and '1' represents a win. I am trying to return the team with the most consecutive wins. Here is what my code looks like at the moment: MATCH(t1:TEAM)-[p:PLAYS]->(t2:TEAM) WITH [t1,t2] AS teams, p AS matches ORDER BY matches.time ASC UNWIND teams AS team

How to create an index on a property of a relation

前提是你 提交于 2019-12-25 16:27:10
问题 I need a query to fetch all properties of a relation that are not empty, e.g. MATCH ()-[r:TYPE]-() WHERE r.attr <> "" RETURN r.attr I would guess that CREATE INDEX ON :TYPE(attr) creates an Index on a Node with the label TYPE and not on a relation property? Or is it not necessary to create an index on a relation property? I am using neo4j 2.2.3. 回答1: Indexes on relationships are only possible by using manual indexes. Bevor creating those I strongly recommend rethinking your graph model.

Neo4j Cypher node filtering by pattern comprehension

爷,独闯天下 提交于 2019-12-25 16:00:13
问题 I have a following SDN 4 entities: Decision , Characteristic and Value : @NodeEntity public class Value extends Votable { private final static String SET_FOR = "SET_FOR"; private final static String SET_ON = "SET_ON"; private final static String CONTAINS = "CONTAINS"; @Relationship(type = SET_FOR, direction = Relationship.OUTGOING) private Decision decision; @Relationship(type = SET_ON, direction = Relationship.OUTGOING) private Characteristic characteristic; @Index(unique = false) private

How to create conditional relationships?

折月煮酒 提交于 2019-12-25 14:14:15
问题 I have a system that is run by an organization to implement a certain function, thus I have the relationship: Organization → Function → System but sometimes the function remains unknown, in which case I want to bind the system directly to the organization: Organization → System how do I write this kind of thing? the System contains attributes that are used for creating these relationships e.g. create (s:System {id: 'x', Organization: 'MST', Function: 'CM'}) or create (s:System {id: 'x',

neo4j cypher toInt function

别来无恙 提交于 2019-12-25 12:14:46
问题 In the neo4j Cypher refcard (http://docs.neo4j.org/refcard/2.0/) under Functions sections there is this definition: toInt({expr}) Converts the given input in an integer if possible; otherwise it returns NULL. If I try it in Cypher console I get this: neo4j-sh (?)$ match (n:Document) return toInt(n.date); ==> SyntaxException: Unknown function 'toInt' (line 1, column 27) ==> "match (n:Document) return toInt(n.date)" ==> ^ neo4j-sh (?)$ (In my case n.date is a string representation of that date.