Editing a Sketch

Sketch Editing Actions

This section outlines the actions available when editing a sketch. (See opening a sketch to edit.) Note that any action specified to be in a popup menu can also be found in the Easik Edit menu. If the action requires information about position on the sketch (such as adding an entity), a random position is used.
Edit Sketch - Popup Menus

Add Entity

Right-click at the position on the canvas where the new entity should be placed. Select Add entity... from the popup menu.

Add Edge

Easik supports four types of edges: edge, injective edge, partial edge, and self-referencing edge. To add an edge to the sketch, highlight the desired entities and select Add <edge-type> from the popup menu. Note that self-referencing edges require only one node, while the others require two. A dialog appears prompting for the edge's name and cascade behaviour.

Add Constraint

Easik supports five types of constraints: commutative diagrams, sum constraints, product constraints, pullback constraints and equalizer constraints. Select Add <constraint type> from the Constraint menu of Easik to add the constraint to the sketch. See notes on each constraint type for details on adding them to a sketch.

Add Attribute

Right click on an entity and select Add Attribute from the popup menu. A dialog pops up prompting for the new attribute's name and type.

Edit Attribute

Right click on the attribute in the information tree located at the right of the sketch window and select Edit Attribute from the popup menu. The selected attribute can then be renamed, and its type redefined.

Delete Attribute

Right click on the attribute in the information tree located at the right of the sketch window and select Delete Attribute from the popup menu. The selected attribute will then be deleted from its entity.

Add Unique Key

Right click on an entity that has at least one attribute or at least one non-injective edge and select Add Unique Key from the popup menu. A dialog pops up prompting for the key's name, attributes and edges. Control-click to select multiple attributes/edges.

Edit Edge

Right click on an edge and select Edit edge from the popup menu. A dialog pops up allowing the edge to be renamed and its cascade behaviour specified.

Rename Entity

Right click on an entity and select Rename Entity from the popup menu. A dialog pop up prompting for the entity's new name.

Delete

Right click with any combination of entities and edges highlighted. Choosing Delete from the popup menu will remove the highlighted selection from the sketch.

Edge Types

This section describes the four types of edges available within Easik. See Add Edge for details on adding an edge.
Sketch edge types

Normal edges

The normal edge type in Easik is a non-nullable reference to a row of another entity. This represents a many-to-one relationship between entities.

Injective edges

Injective edges are non-nullable, unique references to a row of another entity. Because the reference must be unique, this represents a one-to-one relationship between entities, and is often used to "is-a" relationships between entities.

Partial edges

Partial edges are like normal edges, but may be null; that is, they may not reference a tuple of another entity at all.

Self-referencing partial edges

Self-referencing edges allow tuples of an entity to refer to other tuples of the same entity. These edges must be partial: it would not be possible to insert the first tuple of a table if a null value for the reference value was not permitted. Self-referencing edges can be useful for representing tree or graph structures within a database.