Edges
Edges link nodes together. Like nodes, edges have a unique ID and type, and a versioned key-value map of attributes. Additionally, they carry information about the nodes they link together.
- Unique Identifier and Type: Gives each edge its distinct identity.
- Versioned Attributes: Tracks the changes to the edge's attributes over time.
- Connective Information: Includes the 'nodeFromType', 'nodeFromId', 'nodeToType', and 'nodeToId' of the linked nodes.
Lets model example of blog:
var userNode = new Node("User");
var blogNode = new Node("Blog");
var authorEdge = new Edge(
userNode,
"isOwnerOf",
blogNode
);
You can also add attributes:
var userNode = new Node("User");
var blogNode = new Node("Blog");
var authorEdge = new Edge(
userNode,
"isAuthorOf",
blogNode,
new LeafAttribute<>("role", new StringAttributeValue("Writer")),
new LeafAttribute<>("since", new StringAttributeValue("2023-01-01"))
);