If I have the cypher query
MATCH (a)-[r]->(b)
I can get the labels of a and b fine line so
MATCH (a)-[r]->(b) RETURN labels(a), labels(b)
But when I want the label of r
using the same syntax
MATCH (a)-[r]->(b) RETURN labels(r)
I get
Type mismatch: expected Node but was Relationship
How do I return the label of r
, the relationship?
"When people 'label' a relationship, essentially they are defining their connection and agreeing on how they will refer to their connection and each other. Labels are helpful heuristics (mental shortcuts) for describing or communicating about a relationship," she explains.
As a rough rule, two months should be a safe amount of time to broach the subject. But every relationship is different, so if it feels right earlier, go for it. If it doesn't feel right at that stage, there are a few steps you can take to build yourself up for the conversation.
It takes six weeks from on average for new couples to 'have the talk' and finally put a label on the relationship, according to new research.
In Neo4j, relationships don't have labels - they have a single type, so it would be:
MATCH (a)-[r]->(b) RETURN TYPE(r)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With