This part of the course covers the elements of EXPRESS-G:
Language elements and examples
EXPRESS-G is a graphical subset of EXPRESS lexical language and has evolved from a variety of sources.
EXPRESS-G may be used anywhere EXPRESS is used. It can be used alone in its own right, but more usually employed with EXPRESS lexical to fill in any missing details.
It is created to achieve:
Graphical display of EXPRESS models.
Stand-alone information modeling iconic language.
Model display at varying levels of abstraction.
Model display at varying levels of granularity.
There were three main proposals for a graphical version of EXPRESS before the EXPRESS Committee started work in earnest. This meant that they had some user experiences to guide them.
1988-10: EXPRESSAM (Bruce Lownsbery of Lawrence Livermore Lab) based on NIAM.
1989-02: GREXP (Peter Wilson of General Electric), a BLA language ("boxes, lines, annotation") with multiple levels of abstraction and any amount of text.
1989-11: ExpressGraph (Curt Parks of NIST, John Zimmerman of Allied Bendix) simplified version of EXPRESSAM.
1990-02: EXPRESS-G (EXPRESS Committee)
The final result is yet another member of the BLA (boxes, lines, and annotations) family. Unlike practically any other BLA language it was based on an existing lexical language — the others were stand-alone.
EXPRESS-G is a subset that is limited to the structural parts of EXPRESS — no representation of constraints, no FUNCTIONs.
Drafted by EXPRESS Committee in January 1990
A combination of ExpressGraph and GREXP.
A subset of EXPRESS.
Modeling of Entity, Attribute, Cardinality, Supertype, Type and Schema.
Limited levels of abstraction.
No ISO ballot issues in mid 1990 (Informative Annex).
February 1991 — Normative Annex to EXPRESS document and extended.
Same standardization status as EXPRESS.
The design goals of EXPRESS-G included:
Subset of EXPRESS.
Intuitive understanding of diagrams.
Support different levels of abstraction.
Mechanism for multi-page models.
Minimal graphic capabilities needed.
Potential automatic EXPRESS-G display of EXPRESS models.
As there was a full lexical language available EXPRESS-G was limited to those things that could be easily represented graphically.
It was hoped that the diagrams could be understood with (practically) no training. (Hopefully even non-technical managers would feel comfortable).
Different levels of abstraction (detail) would be available.
Importantly, it was known that EXPRESS-G models would be published in reports on normal sized paper, so there had to be a means of splitting a large diagram across a number of pages.
The icons had to be simple so simple drawing programs could be used (at one time diagrams were drawn using ASCII art on lineprinters).
It would be useful to be able to develop software to go between EXPRESS and EXPRESS-G modeling.
Example EXPRESS-G model
This is meant to be understandable by the audience — at least the general tenor of the model.
TYPE date = ARAY [1:3] OF INTEGER; END_TYPE; TYPE hair_type = ENUMERATION OF (blonde, brown, black, red, white, bald); END_TYPE; ENTITY person; first_name : STRING; last_name : STRING; nickname : STRING; birth_date : date; children : SET [0:?] OF person; hair : hair_type; DERIVE age : INTEGER := years(birth_date); INVERSE parents : SET [0:2] OF person FOR children; END_ENTITY; SUBTYPE_CONSTRAINT sc_person FOR person; ONEOF(male, female); END_SUBTYPE_CONSTRAINT; ENTITY female SUBTYPE OF (person); INVERSE husband : SET [0:1] OF male FOR wife; END_ENTITY; ENTITY male SUBTYPE OF (person); wife : OPTIONAL female; END_ENTITY; FUNCTION years(past : date): INTEGER (* returns number of years between past and current date *) END_FUNCTION;
These are the symbols for representing the structural elements of EXPRESS, principally TYPE, ENTITY and SCHEMA.
SUBTYPE_CONSTRAINT is a late addition.
Lines are used to indicate relationships between definitions.
The thickness of the line is meant to be indicative of the strength of the relationship.
Thick lines for supertype/subtype relationship
Dashed line for an optional attribute of an ENTITY.
There are 2 kinds of composition symbols:
Page connectors, where a relationship line crosses to or from another page.
Inter-schema references where something is defined in some other schema than the current one.
Expressing a supertype tree
In this example we model a tree of entities composed through subtypes/supertypes.
SCHEMA simple_tree; ENTITY super; END_ENTITY; ENTITY sub1 SUBTYPE OF (super); END_ENTITY; ENTITY sub2 SUBTYPE OF (super); END_ENTITY; SUBTYPE_CONSTRAINT sc_sub2 FOR sub2; ABSTRACT; ONEOF(sub3, sub4); END_SUBTYPE_CONSTRAINT; ENTITY sub5 SUBTYPE OF (super); END_ENTITY; ENTITY sub3 SUBTYPE OF (sub2); END_ENTITY; ENTITY sub4 SUBTYPE OF (sub2); END_ENTITY; END_SCHEMA; -- simple_tree
Expressing retyped attributes
A retyped attribute can be shown in the following diagram.
ENTITY sup_a; attr : sub_b; END_ENTITY; ENTITY sub_a SUBTYPE OF (sup_a); SELF\sup_a.sub_b : sub_b; END_ENTITY; ENTITY sup_b; num : OPTIONAL NUMBER; END_ENTITY; ENTITY sub_b SUBTYPE OF (sup_b); SELF\sup_b.num : REAL; END_ENTITY;
Expressing partial and complete ENTITY models
ENTITY super; END_ENTITY; ENTITY sub_1 SUBTYPE OF (super); attr : from_ent; END_ENTITY; ENTITY sub_2 SUBTYPE OF (super); pick : choice; END_ENTITY; ENTITY an_ent; int : INTEGER; END_ENTITY; ENTITY from_ent; description : OPTIONAL to_ent; values : ARRAY [1:3] OF UNIQUE REAL; END_ENTITY; ENTITY to_net; text : strings; END_ENTITY; TYPE choice = SELECT (an_ent, name); END_TYPE; TYPE name = STRING; END_TYPE; TYPE strings LIST [1:?] OF STRING; END_TYPE;
Expressing schema and entity models
SCHEMA top; USE FROM geom (curve, point AS node); REFERENCE FROM geom (surface); ENTITY face; bounds : LIST [1:?] OF loop; loc : surface; END_ENTITY; ENTITY loop; END_ENTITY; SUBTYPE_CONSTRAINT sc_loop FOR loop; ABSTRACT; ONEOF(eloop, vloop); END_SUBTYPE_CONSTRAINT; ENTITY eloop SUBTYPE OF (loop); bound : LIST [1:?] OF edge; END_ENTITY; ENTITY vloop SUBTYPE OF (loop); bound : vertex; END_ENTITY; ENTITY edge; start, end : vertex; loc : curve; END_ENTITY; ENTITY vertex; loc : node; END_ENTITY; END_SCHEMA; -- top
SCHEMA geom; ENTITY lcs; END_ENTITY; ENTITY surface; END_ENTITY; ENTITY curve; END_ENTITY; ENTITY point; END_ENTITY; END_SCHEMA; -- geom
Expressing subtype constraints
ENTITY p; END_ENTITY; -- person SUBTYPE_CONSTRAINT p_subs FOR p; TOTAL_OVER(m, f); ONEOF(m, f) AND ONEOF(c, a); END_SUBTYPE_CONSTRAINT; ENTITY m SUBTYPE OF (p); END_ENTITY; -- male ENTITY f SUBTYPE OF (p); END_ENTITY; -- female ENTITY c SUBTYPE OF (p); END_ENTITY; -- citizen ENTITY a SUBTYPE OF (p); END_ENTITY; -- alien SUBTYPE_CONSTRAINT no_li FOR a; ABSTRACT SUPERTYPE; ONEOF(l, i); END_SUBTYPE_CONSTRAINT; ENTITY l SUBTYPE OF (a); END_ENTITY; -- legal ENTITY i SUBTYPE OF (a); END_ENTITY; -- illegal