Skip to main content

Concrete Syntax

The concrete syntax is the visual representation of a model: where and how its model elements are drawn. It is organized into three kinds of element:

  • a Diagram groups the visual representation of a model (or part of it);
  • a View represents a single occurrence of one model element in a diagram; and
  • a Shape describes the actual drawing — position and dimensions — of a view.

The separation of view from shape is deliberate: a view decides what of a model element is shown (for example, whether a property's cardinality is displayed), while a shape decides how it is rendered (position, width, height, the points of a line). The same model element can be shown in several diagrams, each occurrence being a distinct view.

Identity, but no name

Views and shapes are OntoUML elements, so they carry the identity properties id, created, and modified. Unlike named elements, they do not carry descriptive properties such as name or description. Diagrams, being named elements, do carry both.

Each element type summarized below also has a dedicated reference page:

Diagram​

A named element that contains the visual representation of an OntoUML model, or of a portion of it. In addition to the identity and descriptive properties of a named element, a diagram defines:

PropertyTypeDescription
type"Diagram"Discriminator.
ownerid or nullThe model element that owns the diagram, if any.
viewsid[]The views contained in the diagram.
{
"type": "Diagram",
"id": "diagram_1",
"name": { "en": "Main Diagram" },
"owner": null,
"views": ["classview_1", "classview_2", "relationview_1"],
"created": "2024-09-04",
"modified": null,
"alternativeNames": [],
"description": null,
"editorialNotes": [],
"creators": [],
"contributors": []
}

Views​

A view represents a single occurrence of a model element in a diagram, tying that model element to the shapes needed to draw it. Every view specializes the abstract View type, which contributes one property.

PropertyTypeDescription
isViewOfidThe model element that the view represents.

The concrete view types fall into two groups: views backed by a rectangular region (class, package, note, generalization set, n-ary relation) and binary connector views backed by a line (binary relation, generalization, anchor).

Class view​

Represents a single occurrence of a class.

PropertyTypeDescription
type"ClassView"Discriminator.
rectangleidThe rectangle shape that renders the class.
{
"type": "ClassView",
"id": "classview_1",
"isViewOf": "class_1",
"rectangle": "rectangle_1",
"created": "2024-09-04",
"modified": null
}

Package view​

Represents a single occurrence of a package.

PropertyTypeDescription
type"PackageView"Discriminator.
rectangleidThe rectangle shape that renders the package.

Note view​

Represents a single occurrence of a note.

PropertyTypeDescription
type"NoteView"Discriminator.
textidThe text shape that renders the note.

Generalization set view​

Represents a single occurrence of a generalization set.

PropertyTypeDescription
type"GeneralizationSetView"Discriminator.
generalizationsid[]The generalization views grouped by this view.
textidThe text shape that renders the set's label.

N-ary relation view​

Represents a single occurrence of an n-ary relation. Its central diamond joins three or more paths, each running to a participating class view.

PropertyTypeDescription
type"NaryRelationView"Discriminator.
membersid[]The class views connected by the relation, ordered to match the relation's properties. At least three.
diamondidThe diamond shape where the paths join.
pathsid[]The path shapes, one per member, ordered to match the relation's properties. At least three.

Binary connector views​

A binary connector view is a view drawn as a line between two other views. All binary connector views share three properties (from the abstract BinaryConnectorView type):

PropertyTypeDescription
sourceViewidThe view at the source end of the connector.
targetViewidThe view at the target end of the connector.
pathidThe path shape that renders the connector.

There are three concrete binary connector views, each distinguished only by its type:

TypeRenders
"BinaryRelationView"a binary relation
"GeneralizationView"a generalization
"AnchorView"an anchor
{
"type": "BinaryRelationView",
"id": "relationview_1",
"isViewOf": "relation_1",
"sourceView": "classview_1",
"targetView": "classview_2",
"path": "path_1",
"created": "2024-09-04",
"modified": null
}

Shapes​

A shape describes how to render a view, or a portion of one, in a diagram. A shape is either a path (a line) or a rectangular shape (a box). Coordinates are expressed with the point datatype, whose origin (0, 0) is the top-left corner of the diagram, with values increasing downwards and rightwards.

Path​

A shape defined by an ordered list of points connecting two other shapes.

PropertyTypeDescription
type"Path"Discriminator.
pointspoint[]At least two points, ordered from the edge of the source shape to the edge of the target shape.
{
"type": "Path",
"id": "path_1",
"points": [
{ "x": 100, "y": 50 },
{ "x": 260, "y": 50 }
],
"created": "2024-09-04",
"modified": null
}

Rectangular shapes​

A rectangular shape is defined by a top-left position and a size. All rectangular shapes share three properties (from the abstract RectangularShape type):

PropertyTypeDescription
topLeftpointThe coordinates of the shape's top-left corner.
widthintegerThe shape's width; zero or greater.
heightintegerThe shape's height; zero or greater.

There are three concrete rectangular shapes, each distinguished only by its type:

TypeRenders
"Rectangle"a class view or package view
"Diamond"the joining diamond of an n-ary relation view
"Text"a generalization set view or note view
{
"type": "Rectangle",
"id": "rectangle_1",
"topLeft": { "x": 813, "y": 20 },
"width": 95,
"height": 40,
"created": "2024-09-04",
"modified": null
}

Putting it together​

A single class drawn in one diagram involves a ClassView (which references the Class it depicts and the Rectangle that positions it), plus that Rectangle. Rendering a binary relation adds a BinaryRelationView (referencing the two class views it connects and a Path), plus that Path. All of these elements live side by side in the Project's elements array and refer to one another by id, exactly as described in Document Structure.