0
votes

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;
2
Do you get any results on this query match (l:A)-[h:DEFINITION]->(r:DEF) return l,h,r; ? - Davy de Vries
No.Nothing is returned.Only this is what I am getting:(no changes, no records) - reshmak
If you're looking through the neo4j browser I suggest that you only match on :A match (l:A) return l and expand this node. Do you then have any results? - Davy de Vries
Here it is returning the label named "A" - reshmak
So if you break the query in separate queries like: match (l:A) return l, match (r:DEF) return r, match ()-[h:DEFINITION]-() return h do you have results on every query? - Davy de Vries

2 Answers

0
votes

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.

0
votes

try this

match (l:A)-[h:definition]->(r:DEF)
return  h.named