You are here

Classification

Classification

Classification is to distinguish different kinds or types of data related to a relevant world. For example, many organizations can consider “department” and “employee” as relevant data types. Also, there can be relationships between different data types. An example is that employees are working for a department. Registering relationships reduces data redundancy and strengthens the meaning or semantics of a data model. In the semantic approach each data item belongs to a type. Examples of types are: “name”, “department”, “date” and “salary”. Applying these types a database may contain (not required by the types themselves) the following data items (instances):

name
john
mary
...
richard
department
1
...
5
6
date
19740211
20041123
...
20050101

In Xplain the types “name”, “department”, “date” and “salary” are defined as follows:

base name (A30).

base department (I4).

base date (D).

base salary (R6,2).

The values domain is specified between brackets after the type name.
A30 implies Alphanumeric string of 30 characters maximum,
I4 implies Integer number of 4 digits maximum,
D implies a Date (in yyyymmdd format),
R6,2 implies Real number with maximum 6 digits before and 2 digits after the decimal separator

It is possible to put additional restrictions on value domains i.e.: range, enumeration or pattern restrictions.
Range restriction example: a mark may have a number in the range 0-10:

base mark (I2) (0..10).

Enumeration restriction example: a day can only have one of 7 possible weekday names:

base day (A9) = “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saterday”, “Sunday”.

Pattern restriction example: a postal code in the Netherlands starts with 4 decimal digits followed by a space and two capitals like 3290 BZ. Notation:

base postcode (A7) “9999 XX”.

See next: Aggregation and Generalization