id property
Identifier of this Node. It's a combination of Relation type and Node ids involved in this Relation, concatenated by a dash.
The logic behind this implementation is that there cannot be more than one Relations of a given type between two given Nodes. If we need to indicate a type of Relation happening more than once between two nodes, they can definitely be represented as additional properties of the same Relation. For example, if the Relation between the Node PLAYER and MATCH is SCORED, and the Relation SCORED can potentially occur more than once between PLAYER and MATCH, then instead of having multiple SCORED Relations between those two Nodes, we need to use multiple properties on SCORED to represent it.
Implementation
String get id => "$type-$fromNodeId-$toNodeId";