Search code examples
neo4jcyphergraph-databases

Querying Property of a relationship in Neo4j using cypher


I have two nodes in neo4j named A and DEF. A and DEF are connected through a relationship named DEFINITION.This relationship has a property named:description(description of what is A).I want to run query like "what is A" which should fetch the property of the relationship DEFINITION.I tried out this query.But it is returning null.any leads?

match (l:A)-[h:DEFINITION]->(r:DEF)
return  h.description;

Solution

  • Make sure the pattern actually exists in the graph. You said the property is Description but you are getting description, make sure your case matches what's actually there. Also double-check the direction of the relationship.