Sha256: 69ae1dc65c8bb1a1047b6ed66becf2b5355ab6719f0981102d771aa54258618f

Contents?: true

Size: 986 Bytes

Versions: 1

Compression:

Stored size: 986 Bytes

Contents

vocabulary Supervision;

/*
 * Value Types
 */
CompanyName is written as String;
EmployeeNr is written as Signed Integer(32);

/*
 * Entity Types
 */
Company is identified by its Name;

Employee is identified by Company and EmployeeNr where
	Employee works for one Company,
	Company employs Employee,
	Employee has one EmployeeNr,
	EmployeeNr is of Employee;

Manager is a kind of Employee;
Manager supervises Employee,
	Employee reports to at most one Manager;

CEO is a kind of Manager;
CEO runs Company,
	Company is run by one CEO;

/*
 * Constraints:
 */
either Employee reports to Manager(2) or Employee is a Manager(1) that is a CEO that runs Company but not both;
Employee is a Manager that is a CEO that runs Company
	if and only if
	Employee works for Company;

// This constraint cannot be expressed in NORMA until it adds explicit join paths:
Employee(2) reports to Manager that is a kind of Employee(1) that works for Company
	if and only if
	Employee(2) works for Company;

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activefacts-0.8.10 examples/CQL/Supervision.cql