WissDB . since Jun 15 . Index . DOCs TOP TOC

ERD Notation: A formal Language to specify Data Models


ERD Design Notation is a formal language

 

–      to specify Entity Relationship Data Structures of the most general type,

 

i.e. also those in which

 

–      Relationships may have attributes, and

–      Relationships may be n-ary (i.e. may not be just binary relationships).

 

What you describe are:

 

–      Entity types (= entity name, and a sequence of typed entity attributes), and

–      Domain types.

 

A typed attribute in this sense is

 

–      an attribute with values in a specified Domain, or

–      an attribute with values in a specified Entity type (generating relationships).

 

In order to avoid redundancy, you can - for abbreviation -

 

–      use structures (i.e. named sets of domain-valued attributes), and

–      use subclassing (i.e. see an entity type as a set of attributes which is a subset of another, more specific entity type)

 

Whenever you want to refer to a specific domain, entity type, attribute, or set of attributes, you give its typed name, i.e. its name prefixed by

 

–      D_            for   Domain

–      E_  e_             for   Entity Type  respectively  Entity Type seen as a Set of Attributes

–      A_            for   Attribute

–      S_            for   Set of Attributes

 

The code generator takes for input an ASCII file but will see only lines of the following form (if the hyphen is in the first column of the file and is followed by one and only one space):

 

 

- ec        E_name

- eca       A_           e_name

- eca       A_name       D_name

- eca       A_name       S_name

- d         D_name       Name of an SQL_type supported by your DBMS

 

 

  Instead of

 

- eca

 

  you are to write

 

- eca,pk   

 

  if these attribute (or set of attributes) is part of the primary key of the

  entity in question. You are to write

 

- eca,kn

 

  n a positive integer, if the attribute (or set of attributes) is part of

  a secondary key called kn. Because keys (seen as sets of attributes) may

  overlap, you can have lines such as, e.g.

 

- eca,pk,k2,k5

 

  If an attribute must not be allowed to have NULL values, say so by saying

 

- eca,nn

 

  in the line specifying a name for this attribute (or set of attributes).

 

 

 

A small Sample Specification

 

 

-  ec             E_Book [?]

                  |

-  eca,pk         A_Title              D_Title

-  eca            A_Author             E_Person [?]

 

 

-  ec             E_Person [?]

                  |

-  eca,pk         A_FirstName          D_Name

-  eca,pk         A_LastName           D_Name

-  eca,nn         A_Gender             D_Gender

 

 

-  d              D_Title            CHAR(80)

-  d              D_Name            CHAR(20)

 

 

-  d              D_Gender          INT

                  Valid values are:

-  v              .  male

-  v              .  female

 

 



End of Document ...