contractis the name of the relation,
Orderis the source concept of the relation,
ContractIDis the target concept of this relation, and
TOTare constraints of this relation.
owneris the name and
[Person*Building]is the type of the relation. Relation names start with a lower case character, to avoid confusion with concept names. The signature of this relation is
owner[Person*Building]. The signature identifies the relation within its context. The left hand concept,
Person, is called the source of the relation and the right concept,
Building, is called the target.
name[Book*Name]can be specified in the same context as
name[Person*Name]. Because they have different source concepts, these are different relations.
<properties>-part is meant for writing multiplicity constraints in a comma separated list between square brackets '[' and ']'. E.g.
[UNI,TOT]. The following properties can be specified on any relation
PRAGMAis followed by two or three strings. It is used to construct sentences in natural language, using pairs from the actual population of a relation. A pragma specifies how we speak (in natural language) about any pair in the relation. Ampersand also uses pragmas to generate examples in the functional specification. Example of a pragma with three strings:
(John,Amsterdam)results in the sentence
"Student John flies the flag of Amsterdam in top.". The two atoms are fitted in between the three strings. A pragma with two strings is identical to a pragma in which the third string is empty.
PRAGMAkeyword will become obsolete in a future version of Ampersand. It will be replaced by the
VIEW-statement which offers more flexibility in composing sentences.)
PRAGMAtells us that it makes sense to utter the phrase
"Provider Mario's Pizza's has accepted order 12345."