toGraph method
Converts this entity to a graph-like structure, including references to parents.
Implementation
@override
Map<String, dynamic> toGraph() {
final graph = super.toGraph();
graph['attributes'] =
attributes.toList().map((attribute) => attribute.toGraph()).toList();
graph['parents'] =
parents.toList().map((parent) => parent.toGraph()).toList();
graph['children'] =
children.toList().map((child) => child.toGraph()).toList();
return graph;
}