A relationship property is a named value stored as a key-value pair on a graph relationship. It records information about the connection itself, such as when a friendship began or when a social-media interaction occurred. section 2.2.1 section 2.3.2
Use relationship properties when an attribute describes the connection rather than either connected node:
- Store a friendship date with a FRIEND relationship, for example {since: 2016}. section 2.2
- Store a starting date with a WRITES_FOR relationship connecting a person and an organization. section 2.2.1
- Store the creation date of a LIKE relationship when the timing of that interaction matters. section 2.3.2
Friendship with a date
(:Person {name:"Thomas"})-[:FRIEND {since:2016}]->(:Person {name:"Elaine"}) describes two people connected by FRIEND and records 2016 on the relationship. section 2.2
(:Person {name:"Thomas"})-[:FRIEND {since:2016}]->(:Person {name:"Elaine"})
Inspect a complete Cypher pattern showing two Person nodes, a FRIEND relationship, and its since property. section 2.2
