The association container--contained between GraphElement and DiagramElement--constitutes a further extension to the model of a pure mathematical graph. It allows a hierarchy of nested elements to be built. Each GraphElement is able to contain an unlimited number of DiagramElements, so that it may contain an entire subgraph. The nested hierarchy is especially useful when modeling the representation of complex model elements.
For example, classes are represented by a GraphNode which owns nested GraphNodes as contained DiagramElements to represent the compartments, e.g. operation compartment, attribute compartment. Such a compartment GraphNode, e.g. an attribute compartment, owns further nested GraphNodes as contained DiagramElements which represent attributes. The attribute GraphNode again has nested contained DiagramElements which represent parts of the attribute, e.g. visibility, name, type or initial value.