activefacts-examples 1.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +10 -0
- data/.rspec +1 -0
- data/.travis.yml +4 -0
- data/Gemfile +10 -0
- data/LICENSE.txt +21 -0
- data/README.md +22 -0
- data/Rakefile +6 -0
- data/activefacts-examples.gemspec +26 -0
- data/cql/Address.cql +44 -0
- data/cql/Astronomy.cql +35 -0
- data/cql/Blog.cql +54 -0
- data/cql/CinemaBookings.cql +64 -0
- data/cql/CinemaTickets.cql +127 -0
- data/cql/CompanyDirectorEmployee.cql +56 -0
- data/cql/Death.cql +17 -0
- data/cql/Diplomacy.cql +48 -0
- data/cql/Genealogy.cql +98 -0
- data/cql/Health.cql +78 -0
- data/cql/Insurance.cql +320 -0
- data/cql/Marriage.cql +18 -0
- data/cql/Metamodel.cql +567 -0
- data/cql/Monogamy.cql +24 -0
- data/cql/MultiInheritance.cql +22 -0
- data/cql/MultipleSubtyping.cql +30 -0
- data/cql/NonRoleId.cql +14 -0
- data/cql/OddIdentifier.cql +18 -0
- data/cql/OilSupply.cql +53 -0
- data/cql/OneRoleNesting.cql +38 -0
- data/cql/OneToOnes.cql +17 -0
- data/cql/Orienteering.cql +111 -0
- data/cql/PartyModel.cql +38 -0
- data/cql/PersonPlaysGame.cql +18 -0
- data/cql/RedundantDependency.cql +34 -0
- data/cql/SchoolActivities.cql +33 -0
- data/cql/SeparateSubtype.cql +30 -0
- data/cql/ServiceDirector.cql +276 -0
- data/cql/SimplestUnary.cql +12 -0
- data/cql/Supervision.cql +34 -0
- data/cql/VenueSeating.cql +45 -0
- data/cql/WaiterTips.cql +33 -0
- data/cql/Warehousing.cql +101 -0
- data/cql/WindowInRoomInBldg.cql +28 -0
- data/cql/unit.cql +474 -0
- data/diagrams/json/Address.json +41 -0
- data/diagrams/json/Astronomy.json +31 -0
- data/diagrams/json/Blog.json +46 -0
- data/diagrams/json/CinemaBookings.json +53 -0
- data/diagrams/json/CinemaTickets.json +101 -0
- data/diagrams/json/CompanyDirectorEmployee.json +44 -0
- data/diagrams/json/Death.json +20 -0
- data/diagrams/json/Diplomacy.json +34 -0
- data/diagrams/json/Genealogy.json +78 -0
- data/diagrams/json/Insurance.json +259 -0
- data/diagrams/json/Marriage.json +21 -0
- data/diagrams/json/Metamodel.json +318 -0
- data/diagrams/json/Monogamy.json +22 -0
- data/diagrams/json/MultiInheritance.json +25 -0
- data/diagrams/json/MultipleSubtyping.json +22 -0
- data/diagrams/json/OilSupply.json +49 -0
- data/diagrams/json/OneRoleNesting.json +37 -0
- data/diagrams/json/Orienteering.json +94 -0
- data/diagrams/json/PersonPlaysGame.json +22 -0
- data/diagrams/json/RedundantDependency.json +33 -0
- data/diagrams/json/SchoolActivities.json +28 -0
- data/diagrams/json/SeparateSubtype.json +29 -0
- data/diagrams/json/SimplestUnary.json +15 -0
- data/diagrams/json/Supervision.json +27 -0
- data/diagrams/json/VenueSeating.json +40 -0
- data/diagrams/json/WaiterTips.json +29 -0
- data/diagrams/json/Warehousing.json +86 -0
- data/diagrams/json/WindowInRoomInBldg.json +31 -0
- data/images/Address.SQL.png +0 -0
- data/images/Address.png +0 -0
- data/images/Blog.png +0 -0
- data/images/CinemaBookings.png +0 -0
- data/images/CinemaTickets.png +0 -0
- data/images/CompanyDirectorEmployee.png +0 -0
- data/images/Death.png +0 -0
- data/images/Diplomacy.png +0 -0
- data/images/DumpMetamodel.bat +2 -0
- data/images/Genealogy.png +0 -0
- data/images/Insurance/Claim.png +0 -0
- data/images/Insurance/Insurance.png +0 -0
- data/images/Insurance/Person.png +0 -0
- data/images/Insurance/Policy.png +0 -0
- data/images/Insurance/Related.png +0 -0
- data/images/Insurance/VehicleIncident.png +0 -0
- data/images/Marriage.png +0 -0
- data/images/Metamodel/Concepts.png +0 -0
- data/images/Metamodel/Constraints.png +0 -0
- data/images/Metamodel/ContextNote.png +0 -0
- data/images/Metamodel/Diagrams.png +0 -0
- data/images/Metamodel/Language.png +0 -0
- data/images/Metamodel/Legacy.png +0 -0
- data/images/Metamodel/Objects.png +0 -0
- data/images/Metamodel/Populations.png +0 -0
- data/images/Metamodel/Query.png +0 -0
- data/images/Metamodel/Units.png +0 -0
- data/images/Metamodel/ValueConstraints.png +0 -0
- data/images/Metamodel/ValueTypes.png +0 -0
- data/images/MetamodelER.bcp +1 -0
- data/images/MetamodelER.pdf +0 -0
- data/images/MultiInheritance.png +0 -0
- data/images/NorthwindER.png +0 -0
- data/images/OilSupply.png +0 -0
- data/images/Orienteering/Administration.png +0 -0
- data/images/Orienteering/Registration.png +0 -0
- data/images/Orienteering/Scoring.png +0 -0
- data/images/PersonPlaysGame.png +0 -0
- data/images/RedundantDependency.png +0 -0
- data/images/SchoolActivities.png +0 -0
- data/images/SeparateSubtype.png +0 -0
- data/images/SimplestUnary.png +0 -0
- data/images/Supervision.png +0 -0
- data/images/VenueSeating.png +0 -0
- data/images/WaiterTips.png +0 -0
- data/images/Warehousing.png +0 -0
- data/images/WindowInRoomInBldg.png +0 -0
- data/metadata/json/Astronomy.json +175 -0
- data/metadata/json/CinemaBookings.json +354 -0
- data/metadata/json/CinemaTickets.json +768 -0
- data/metadata/json/CompanyDirectorEmployee.json +270 -0
- data/metadata/json/Diplomacy.json +186 -0
- data/metadata/json/Metamodel.json +3214 -0
- data/metadata/json/OilSupply.json +411 -0
- data/metadata/json/SeparateSubtype.json +157 -0
- data/metadata/json/Supervision.json +128 -0
- data/metadata/json/VenueSeating.json +209 -0
- data/orm/.gitignore +11 -0
- data/orm/Address.orm +1268 -0
- data/orm/Astronomy.orm +925 -0
- data/orm/Blog.orm +1711 -0
- data/orm/CinemaBookings.orm +1998 -0
- data/orm/CinemaTickets.orm +5060 -0
- data/orm/CompanyDirectorEmployee.orm +2094 -0
- data/orm/Death.orm +386 -0
- data/orm/Diplomacy.orm +1478 -0
- data/orm/ExampleModels2010.csproj +764 -0
- data/orm/ExampleModels2010.sln +16 -0
- data/orm/Genealogy.orm +3209 -0
- data/orm/Health.orm +2407 -0
- data/orm/Insurance.orm +12727 -0
- data/orm/Marriage.orm +493 -0
- data/orm/Metamodel.orm +20998 -0
- data/orm/Monogamy.orm +328 -0
- data/orm/MultiInheritance.orm +537 -0
- data/orm/MultipleSubtyping.orm +347 -0
- data/orm/OilSupply.orm +2533 -0
- data/orm/OneRoleNesting.orm +1237 -0
- data/orm/Orienteering.orm +3976 -0
- data/orm/PersonPlaysGame.orm +426 -0
- data/orm/RedundantDependency.orm +844 -0
- data/orm/SchoolActivities.orm +961 -0
- data/orm/SeparateSubtype.orm +821 -0
- data/orm/SimplestUnary.orm +172 -0
- data/orm/Supervision.orm +734 -0
- data/orm/VenueSeating.orm +1289 -0
- data/orm/WaiterTips.orm +789 -0
- data/orm/Warehousing.orm +3792 -0
- data/orm/WindowInRoomInBldg.orm +772 -0
- data/rails/models/Astronomy.models +17 -0
- data/rails/models/CinemaBookings.models +123 -0
- data/rails/models/CinemaTickets.models +192 -0
- data/rails/models/Diplomacy.models +126 -0
- data/rails/models/Metamodel.models +894 -0
- data/rails/models/OneRoleNesting.models +18 -0
- data/rails/models/SeparateSubtype.models +49 -0
- data/rails/models/VenueSeating.models +70 -0
- data/rails/schema/Astronomy.schema.rb +25 -0
- data/rails/schema/CinemaBookings.schema.rb +78 -0
- data/rails/schema/CinemaTickets.schema.rb +132 -0
- data/rails/schema/Diplomacy.schema.rb +74 -0
- data/rails/schema/Metamodel.schema.rb +538 -0
- data/rails/schema/OneRoleNesting.rb +20 -0
- data/rails/schema/SeparateSubtype.schema.rb +35 -0
- data/rails/schema/VenueSeating.schema.rb +46 -0
- data/rails/schema/Warehousing.schema.rb +145 -0
- data/ruby/Address.rb +68 -0
- data/ruby/Astronomy.rb +55 -0
- data/ruby/Blog.rb +84 -0
- data/ruby/CinemaBookings.rb +109 -0
- data/ruby/CinemaTickets.rb +218 -0
- data/ruby/CompanyDirectorEmployee.rb +73 -0
- data/ruby/Death.rb +26 -0
- data/ruby/Diplomacy.rb +59 -0
- data/ruby/Genealogy.rb +173 -0
- data/ruby/Insurance.rb +562 -0
- data/ruby/Marriage.rb +21 -0
- data/ruby/Metamodel.rb +621 -0
- data/ruby/Monogamy.rb +27 -0
- data/ruby/MultiInheritance.rb +38 -0
- data/ruby/OilSupply.rb +112 -0
- data/ruby/OneRoleNesting.rb +66 -0
- data/ruby/Orienteering.rb +216 -0
- data/ruby/PersonPlaysGame.rb +31 -0
- data/ruby/RedundantDependency.rb +53 -0
- data/ruby/SchoolActivities.rb +49 -0
- data/ruby/SeparateSubtype.rb +46 -0
- data/ruby/SimplestUnary.rb +10 -0
- data/ruby/Supervision.rb +33 -0
- data/ruby/TwoValues.rb +14 -0
- data/ruby/VenueSeating.rb +64 -0
- data/ruby/WaiterTips.rb +49 -0
- data/ruby/Warehousing.rb +167 -0
- data/ruby/WindowInRoomInBldg.rb +45 -0
- data/sql/server/Address.sql +40 -0
- data/sql/server/Astronomy.sql +36 -0
- data/sql/server/Blog.sql +78 -0
- data/sql/server/CinemaBookings.sql +95 -0
- data/sql/server/CinemaTickets.sql +191 -0
- data/sql/server/CompanyDirectorEmployee.sql +104 -0
- data/sql/server/Death.sql +11 -0
- data/sql/server/Diplomacy.sql +66 -0
- data/sql/server/Genealogy.sql +138 -0
- data/sql/server/Health.sql +169 -0
- data/sql/server/Insurance.sql +484 -0
- data/sql/server/Marriage.sql +30 -0
- data/sql/server/Metamodel.sql +1000 -0
- data/sql/server/Monogamy.sql +20 -0
- data/sql/server/MultiInheritance.sql +27 -0
- data/sql/server/OilSupply.sql +105 -0
- data/sql/server/OneRoleNesting.sql +29 -0
- data/sql/server/Orienteering.sql +186 -0
- data/sql/server/PersonPlaysGame.sql +9 -0
- data/sql/server/RedundantDependency.sql +54 -0
- data/sql/server/SchoolActivities.sql +30 -0
- data/sql/server/SeparateSubtype.sql +33 -0
- data/sql/server/SimplestUnary.sql +9 -0
- data/sql/server/Supervision.sql +30 -0
- data/sql/server/VenueSeating.sql +54 -0
- data/sql/server/WaiterTips.sql +31 -0
- data/sql/server/Warehousing.sql +203 -0
- data/sql/server/WindowInRoomInBldg.sql +13 -0
- data/transform/surrogate/Address.absorption +2 -0
- data/transform/surrogate/Blog.absorption +5 -0
- data/transform/surrogate/CinemaBookings.absorption +7 -0
- data/transform/surrogate/CompanyDirectorEmployee.absorption +7 -0
- data/transform/surrogate/Death.absorption +1 -0
- data/transform/surrogate/Diplomacy-revised.absorption +6 -0
- data/transform/surrogate/Diplomacy.absorption +6 -0
- data/transform/surrogate/Genealogy.absorption +8 -0
- data/transform/surrogate/Insurance.absorption +18 -0
- data/transform/surrogate/Marriage.absorption +2 -0
- data/transform/surrogate/Metamodel.absorption +25 -0
- data/transform/surrogate/Monogamy.absorption +1 -0
- data/transform/surrogate/MultiInheritance.absorption +1 -0
- data/transform/surrogate/MultipleSubtyping.absorption +1 -0
- data/transform/surrogate/OilSupply.absorption +8 -0
- data/transform/surrogate/OneRoleNesting.absorption +1 -0
- data/transform/surrogate/Orienteering.absorption +11 -0
- data/transform/surrogate/PersonPlaysGame.absorption +1 -0
- data/transform/surrogate/RedundantDependency.absorption +3 -0
- data/transform/surrogate/SchoolActivities.absorption +3 -0
- data/transform/surrogate/SeparateSubtype.absorption +3 -0
- data/transform/surrogate/SimplestUnary.absorption +1 -0
- data/transform/surrogate/Supervision.absorption +2 -0
- data/transform/surrogate/WaiterTips.absorption +3 -0
- data/transform/surrogate/Warehousing.absorption +12 -0
- data/transform/surrogate/WindowInRoomInBldg.absorption +1 -0
- data/transform/surrogate/unit.absorption +0 -0
- metadata +374 -0
data/cql/OilSupply.cql
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
vocabulary OilSupply;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Cost is written as Money;
|
7
|
+
Month Nr is written as Signed Integer(32);
|
8
|
+
Product Name is written as String;
|
9
|
+
Quantity is written as Unsigned Integer(32);
|
10
|
+
Refinery Name is written as String(80);
|
11
|
+
Region Name is written as String;
|
12
|
+
Season is written as String(6) restricted to {'Autumn', 'Spring', 'Summer', 'Winter'};
|
13
|
+
Transport Method is written as String restricted to {'Rail', 'Road', 'Sea'};
|
14
|
+
Year Nr is written as Signed Integer(32);
|
15
|
+
|
16
|
+
/*
|
17
|
+
* Entity Types
|
18
|
+
*/
|
19
|
+
Month [static] is identified by its Nr restricted to {1..12};
|
20
|
+
Month is in one Season;
|
21
|
+
|
22
|
+
Product is independent identified by its Name;
|
23
|
+
|
24
|
+
Refinery is independent identified by its Name;
|
25
|
+
|
26
|
+
Region is independent identified by its Name;
|
27
|
+
|
28
|
+
Transport Route is where
|
29
|
+
Transport Method transportation is available from Refinery to Region,
|
30
|
+
Transport Method transportation is available to Region from Refinery;
|
31
|
+
Transport Route incurs at most one Cost per kl;
|
32
|
+
|
33
|
+
Year is identified by its Nr;
|
34
|
+
|
35
|
+
Acceptable Substitution is where
|
36
|
+
Product may be substituted by alternate-Product in Season [acyclic, intransitive],
|
37
|
+
alternate-Product is an acceptable substitute for Product in Season;
|
38
|
+
|
39
|
+
Supply Period [separate, static] is identified by Year and Month where
|
40
|
+
Supply Period is in one Year,
|
41
|
+
Supply Period is in one Month;
|
42
|
+
|
43
|
+
Production Forecast is where
|
44
|
+
Refinery in Supply Period will make Product in one Quantity,
|
45
|
+
Refinery will make Product in Supply Period in Quantity,
|
46
|
+
Refinery will make Quantity of Product in Supply Period;
|
47
|
+
Production Forecast predicts at most one Cost;
|
48
|
+
|
49
|
+
Regional Demand is where
|
50
|
+
Region in Supply Period will need Product in one Quantity,
|
51
|
+
Region will need Product in Supply Period in Quantity,
|
52
|
+
Region will need Quantity of Product in Supply Period;
|
53
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
vocabulary OneRoleNesting;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Accuracy Level is written as Signed Integer(32);
|
7
|
+
Party Id is written as Auto Counter;
|
8
|
+
Party Name is written as String;
|
9
|
+
ymd is written as Date;
|
10
|
+
|
11
|
+
/*
|
12
|
+
* Entity Types
|
13
|
+
*/
|
14
|
+
Accuracy is identified by its Level restricted to {1..5};
|
15
|
+
|
16
|
+
Event Date is identified by ymd where
|
17
|
+
Event Date has one ymd,
|
18
|
+
ymd is of at most one Event Date;
|
19
|
+
|
20
|
+
Party is independent identified by its Id;
|
21
|
+
|
22
|
+
Party Moniker is where
|
23
|
+
Party is called one Party Name;
|
24
|
+
Party Moniker has one Accuracy;
|
25
|
+
|
26
|
+
Person is a kind of Party;
|
27
|
+
|
28
|
+
Birth is where
|
29
|
+
Person was born on one Event Date;
|
30
|
+
|
31
|
+
Death is where
|
32
|
+
Person died;
|
33
|
+
Death occurred on at most one death-Event Date;
|
34
|
+
|
35
|
+
Doctor is a kind of Person;
|
36
|
+
Birth was assisted by at most one attending-Doctor,
|
37
|
+
Doctor attended Birth;
|
38
|
+
|
data/cql/OneToOnes.cql
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
vocabulary OneToOnes;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Boy ID is written as Auto Counter;
|
7
|
+
Girl ID is written as Auto Counter;
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Entity Types
|
11
|
+
*/
|
12
|
+
Boy is independent identified by its ID;
|
13
|
+
|
14
|
+
Girl is independent identified by its ID;
|
15
|
+
Girl is going out with at most one Boy,
|
16
|
+
Boy is going out with at most one Girl;
|
17
|
+
|
@@ -0,0 +1,111 @@
|
|
1
|
+
vocabulary Orienteering;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Accessibility is written as Char(1) restricted to {'A'..'D'};
|
7
|
+
Club Code is written as String(6);
|
8
|
+
Club Name is written as String(32);
|
9
|
+
Control Number is written as Unsigned Integer(32) restricted to {1..1000};
|
10
|
+
Course is written as String(16) restricted to {'A'..'E', 'PW'};
|
11
|
+
Entry ID is written as Auto Counter;
|
12
|
+
Event ID is written as Auto Counter;
|
13
|
+
Event Name is written as String(50);
|
14
|
+
Family Name is written as String(48);
|
15
|
+
Gender is written as Char(1) restricted to {'F', 'M'};
|
16
|
+
Given Name is written as String(48);
|
17
|
+
Location is written as String(200);
|
18
|
+
Map ID is written as Auto Counter;
|
19
|
+
Map Name is written as String(80);
|
20
|
+
Number is written as Unsigned Integer(32) restricted to {1..100};
|
21
|
+
Person ID is written as Auto Counter;
|
22
|
+
Placing is written as Unsigned Integer(32);
|
23
|
+
Point Value is written as Unsigned Integer(32);
|
24
|
+
Post Code is written as Unsigned Integer(32);
|
25
|
+
Punch ID is written as Auto Counter;
|
26
|
+
Score is written as Signed Integer(32);
|
27
|
+
Scoring Method is written as String(32) restricted to {'Scatter', 'Score', 'Special'};
|
28
|
+
Series ID is written as Auto Counter;
|
29
|
+
Series Name is written as String(40);
|
30
|
+
Start Time is written as Date Time;
|
31
|
+
Time is written as Date Time;
|
32
|
+
Year is written as Unsigned Integer(32) restricted to {1900..3000};
|
33
|
+
|
34
|
+
/*
|
35
|
+
* Entity Types
|
36
|
+
*/
|
37
|
+
Club is identified by its Code;
|
38
|
+
Club Name is name of at most one Club,
|
39
|
+
Club is called one Club Name;
|
40
|
+
|
41
|
+
Event is identified by its ID;
|
42
|
+
Club runs Event,
|
43
|
+
Event is run by one Club;
|
44
|
+
Event is called at most one Event Name,
|
45
|
+
Event Name is name of at most one Event;
|
46
|
+
Event has at most one Number;
|
47
|
+
Event is held on one Start Time;
|
48
|
+
Event starts at one start-Location,
|
49
|
+
Location is place Event starts;
|
50
|
+
|
51
|
+
Event Control is where
|
52
|
+
Event includes at least one Control Number;
|
53
|
+
Event Control has at most one Point Value;
|
54
|
+
|
55
|
+
Event Scoring Method is where
|
56
|
+
Scoring Method is used for Course of Event,
|
57
|
+
Course of Event uses one Scoring Method;
|
58
|
+
|
59
|
+
Map is identified by its ID;
|
60
|
+
Club (as Owner) owns Map,
|
61
|
+
Map is owned by one Owner;
|
62
|
+
Map has at most one Accessibility;
|
63
|
+
Map is map for Event,
|
64
|
+
Event uses one Map;
|
65
|
+
Map has one Map Name,
|
66
|
+
Map Name is of at most one Map;
|
67
|
+
|
68
|
+
Person is identified by its ID;
|
69
|
+
Person is member of at most one Club;
|
70
|
+
Person has one Family Name,
|
71
|
+
Family Name is of Person;
|
72
|
+
Person is of at most one Gender;
|
73
|
+
Person has one Given Name,
|
74
|
+
Given Name is name of Person;
|
75
|
+
Person has at most one Post Code;
|
76
|
+
Person was born in at most one birth-Year;
|
77
|
+
|
78
|
+
Punch is identified by its ID;
|
79
|
+
|
80
|
+
Punch Placement is where
|
81
|
+
Punch is placed at Event Control;
|
82
|
+
|
83
|
+
Series is identified by its ID;
|
84
|
+
Event is in at most one Series;
|
85
|
+
Series has one Series Name (as Name),
|
86
|
+
Name is of at most one Series;
|
87
|
+
|
88
|
+
Entry is identified by its ID where
|
89
|
+
Person entered Course of Event,
|
90
|
+
Person entered Event in one Course;
|
91
|
+
Entry received at most one Score;
|
92
|
+
Entry finished in at most one finish-Placing;
|
93
|
+
|
94
|
+
Visit is where
|
95
|
+
Punch was visited by Entry at Time;
|
96
|
+
|
97
|
+
/*
|
98
|
+
* Constraints:
|
99
|
+
*/
|
100
|
+
Event is in Series
|
101
|
+
if and only if
|
102
|
+
Event has Number;
|
103
|
+
each Event Control occurs at least one time in
|
104
|
+
Punch is placed at Event Control;
|
105
|
+
either Event is called Event Name or Event is in Series;
|
106
|
+
each combination Given Name, Family Name occurs at most one time in
|
107
|
+
Person has Given Name,
|
108
|
+
Person has Family Name;
|
109
|
+
each combination Series, Number occurs at most one time in
|
110
|
+
Event is in Series,
|
111
|
+
Event has Number;
|
data/cql/PartyModel.cql
ADDED
@@ -0,0 +1,38 @@
|
|
1
|
+
vocabulary Party;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Party ID is written as ID;
|
7
|
+
Party Type Code is written as String(16) restricted to {'Company', 'Person'};
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Entity Types
|
11
|
+
*/
|
12
|
+
Party is identified by its ID;
|
13
|
+
|
14
|
+
Party Type is identified by its Code;
|
15
|
+
Party is of one Party Type;
|
16
|
+
|
17
|
+
Person is a kind of Party [separate];
|
18
|
+
|
19
|
+
User is a kind of Person;
|
20
|
+
|
21
|
+
Company is a kind of Party [separate];
|
22
|
+
|
23
|
+
Superannuation Company is a kind of Company;
|
24
|
+
|
25
|
+
Teaching Institution is a kind of Company;
|
26
|
+
|
27
|
+
RTO is a kind of Teaching Institution;
|
28
|
+
|
29
|
+
/*
|
30
|
+
* Constraints:
|
31
|
+
*/
|
32
|
+
either Party is a Person or Party is a Company but not both;
|
33
|
+
Party is a Company
|
34
|
+
if and only if
|
35
|
+
Party is of Party Type 'Company';
|
36
|
+
Party is a Person
|
37
|
+
if and only if
|
38
|
+
Party is of Party Type 'Person';
|
@@ -0,0 +1,18 @@
|
|
1
|
+
vocabulary PersonPlaysGame;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Game Code is written as Char;
|
7
|
+
Person Name is written as String;
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Entity Types
|
11
|
+
*/
|
12
|
+
Game is identified by its Code;
|
13
|
+
|
14
|
+
Person is identified by its Name;
|
15
|
+
|
16
|
+
Playing is where
|
17
|
+
Person plays Game;
|
18
|
+
|
@@ -0,0 +1,34 @@
|
|
1
|
+
vocabulary RedundantDependency;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Address Id is written as Auto Counter;
|
7
|
+
District Number is written as Signed Integer(32);
|
8
|
+
Politician Id is written as Auto Counter;
|
9
|
+
Postal Code is written as Signed Integer(32);
|
10
|
+
State Or Province Id is written as Auto Counter;
|
11
|
+
|
12
|
+
/*
|
13
|
+
* Entity Types
|
14
|
+
*/
|
15
|
+
Address is identified by its Id;
|
16
|
+
Address is assigned at most one Postal Code;
|
17
|
+
|
18
|
+
Politician is identified by its Id;
|
19
|
+
|
20
|
+
State Or Province is identified by its Id;
|
21
|
+
Address is in at most one State Or Province;
|
22
|
+
|
23
|
+
Legislative District is identified by District Number and State Or Province where
|
24
|
+
Legislative District has one District Number,
|
25
|
+
Legislative District is for one State Or Province;
|
26
|
+
Address is in at most one Legislative District;
|
27
|
+
Politician represents at most one Legislative District,
|
28
|
+
Legislative District is represented by one Politician;
|
29
|
+
|
30
|
+
/*
|
31
|
+
* Constraints:
|
32
|
+
*/
|
33
|
+
Address is in Legislative District
|
34
|
+
only if Address is in State Or Province and Legislative District is for State Or Province;
|
@@ -0,0 +1,33 @@
|
|
1
|
+
vocabulary SchoolActivities;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Activity Name is written as String(32);
|
7
|
+
School Name is written as String;
|
8
|
+
Student Name is written as String;
|
9
|
+
|
10
|
+
/*
|
11
|
+
* Entity Types
|
12
|
+
*/
|
13
|
+
Activity is identified by its Name;
|
14
|
+
|
15
|
+
School is identified by its Name;
|
16
|
+
|
17
|
+
School Activity is where
|
18
|
+
School sanctions Activity;
|
19
|
+
|
20
|
+
Student is identified by its Name;
|
21
|
+
Student is enrolled in one School;
|
22
|
+
|
23
|
+
Student Participation is where
|
24
|
+
Student represents School in Activity,
|
25
|
+
Student participates in Activity as representative of one School;
|
26
|
+
|
27
|
+
/*
|
28
|
+
* Constraints:
|
29
|
+
*/
|
30
|
+
Student represents School in Activity
|
31
|
+
only if School sanctions Activity;
|
32
|
+
Student represents School in Activity
|
33
|
+
only if Student is enrolled in School;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
vocabulary SeparateSubtype;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Claim ID is written as Auto Counter;
|
7
|
+
Date Time is written as Date Time;
|
8
|
+
Person Name is written as String;
|
9
|
+
|
10
|
+
/*
|
11
|
+
* Entity Types
|
12
|
+
*/
|
13
|
+
Claim is identified by its ID;
|
14
|
+
|
15
|
+
Incident is identified by Claim where
|
16
|
+
Claim concerns at most one Incident,
|
17
|
+
Incident resulted in one Claim;
|
18
|
+
Incident occurred on at most one Date Time;
|
19
|
+
|
20
|
+
Person is identified by its Name;
|
21
|
+
|
22
|
+
Vehicle Incident is a kind of Incident [separate];
|
23
|
+
|
24
|
+
Witness is a kind of Person;
|
25
|
+
Witness saw Incident,
|
26
|
+
Incident was independently witnessed by at most one Witness;
|
27
|
+
|
28
|
+
Driver is a kind of Person;
|
29
|
+
Vehicle Incident occurred while at most one Driver was in charge;
|
30
|
+
|
@@ -0,0 +1,276 @@
|
|
1
|
+
vocabulary ServiceDirector;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
Company Code is written as Char(5);
|
7
|
+
Credential Nr is written as Signed Integer(32);
|
8
|
+
Data Store Name is written as String(15);
|
9
|
+
Date is written as String;
|
10
|
+
Date Time is written as String;
|
11
|
+
Email Address is written as String(50);
|
12
|
+
Host System Name is written as String(15);
|
13
|
+
IP is written as String(16);
|
14
|
+
Message Data is written as Blob(8000);
|
15
|
+
Message Header is written as String(30);
|
16
|
+
Monitor Id is written as Auto Counter;
|
17
|
+
Monitoring Application Name is written as String(10);
|
18
|
+
Name is written as String(15);
|
19
|
+
Netmask is written as String(16);
|
20
|
+
Network Nr is written as Signed Integer(32);
|
21
|
+
Notification Level Nr is written as Signed Integer(32);
|
22
|
+
Notification Type Name is written as String(20);
|
23
|
+
Password is written as String;
|
24
|
+
Path is written as String(20);
|
25
|
+
Port is written as Signed Integer(32);
|
26
|
+
Provider Type Id is written as Signed Integer(20);
|
27
|
+
Recurring Schedule Id is written as Auto Counter;
|
28
|
+
Satellite Message Id is written as Unsigned Integer(32);
|
29
|
+
Seconds is written as Unsigned Integer(32);
|
30
|
+
Serial Number is written as String(20);
|
31
|
+
Service Type [independent] is written as String(15);
|
32
|
+
Subscription Nr is written as Signed Integer(32);
|
33
|
+
Switch Id is written as Auto Counter;
|
34
|
+
Time is written as String;
|
35
|
+
Transaction Nr is written as Unsigned Integer(32);
|
36
|
+
Truck PCID is written as Unsigned Integer(32);
|
37
|
+
User Name is written as String(20);
|
38
|
+
Version is written as Char(5);
|
39
|
+
|
40
|
+
/*
|
41
|
+
* Entity Types
|
42
|
+
*/
|
43
|
+
Company is identified by its Code;
|
44
|
+
Company has one Operating-Name;
|
45
|
+
Company is client;
|
46
|
+
Company is vendor;
|
47
|
+
|
48
|
+
Credential is identified by its Nr;
|
49
|
+
Credential has at most one Expiration-Date;
|
50
|
+
Credential has one Password;
|
51
|
+
Credential has one User Name;
|
52
|
+
|
53
|
+
Data Store is identified by its Name;
|
54
|
+
Data Store requires at least one Credential;
|
55
|
+
Data Store has one Friendly-Name;
|
56
|
+
Data Store has at most one HeartBeat-Truck PCID;
|
57
|
+
Data Store has one Internal-Credential;
|
58
|
+
Data Store is one Major-Version;
|
59
|
+
Data Store is one Minor-Version;
|
60
|
+
Data Store is one Revision-Version;
|
61
|
+
|
62
|
+
Duration is identified by Seconds where
|
63
|
+
Duration has one Seconds,
|
64
|
+
Seconds is of at most one Duration;
|
65
|
+
|
66
|
+
Geocode File is identified by Path where
|
67
|
+
Geocode File has one Path,
|
68
|
+
Path is of at most one Geocode File;
|
69
|
+
Data Store uses at most one Geocode File;
|
70
|
+
|
71
|
+
Host System is identified by its Name;
|
72
|
+
Data Store is on one Primary-Host System;
|
73
|
+
Data Store is on one Secondary-Host System;
|
74
|
+
|
75
|
+
Monitor is identified by its Id;
|
76
|
+
Monitor monitors one Data Store;
|
77
|
+
Monitor is disabled;
|
78
|
+
|
79
|
+
Monitoring Application is independent identified by its Name;
|
80
|
+
Monitor is owned by one Monitoring Application;
|
81
|
+
|
82
|
+
Network is identified by its Nr;
|
83
|
+
Company has at least one Origin-Network;
|
84
|
+
Data Store has TcpProxy-Network,
|
85
|
+
TcpProxy-Network is in at most one Data Store;
|
86
|
+
Host System uses at least one Network,
|
87
|
+
Network is used by at most one Host System;
|
88
|
+
Network uses at most one Domain-Name;
|
89
|
+
Network has at most one Ending-IP;
|
90
|
+
Network has one Initial-IP;
|
91
|
+
Network uses at most one Netmask;
|
92
|
+
Network is ip_range;
|
93
|
+
Network is ip_single;
|
94
|
+
Network is ip_subnet;
|
95
|
+
|
96
|
+
Notification Level is identified by its Nr;
|
97
|
+
Notification Level has one InitialDelay-Duration;
|
98
|
+
Notification Level has one Repeat-Duration;
|
99
|
+
|
100
|
+
Notification Type is independent identified by its Name;
|
101
|
+
|
102
|
+
Provider Type is identified by its Id;
|
103
|
+
|
104
|
+
Recurring Schedule is identified by its Id;
|
105
|
+
Monitor has AllExclusion-Recurring Schedule,
|
106
|
+
AllExclusion-Recurring Schedule applies to at most one Monitor;
|
107
|
+
Monitor (as IntegratingMonitor) has IntegrationExclusion-Recurring Schedule; // Avoid ambiguity; this is a new fact type
|
108
|
+
Monitor (as IntegratingMonitor) has IntegrationExclusion-Recurring Schedule,
|
109
|
+
IntegrationExclusion-Recurring Schedule applies to at most one IntegratingMonitor;
|
110
|
+
Recurring Schedule has one Duration;
|
111
|
+
Recurring Schedule has one Start-Time;
|
112
|
+
Recurring Schedule friday;
|
113
|
+
Recurring Schedule monday;
|
114
|
+
Recurring Schedule saturday;
|
115
|
+
Recurring Schedule sunday;
|
116
|
+
Recurring Schedule thursday;
|
117
|
+
Recurring Schedule tuesday;
|
118
|
+
Recurring Schedule wednesday;
|
119
|
+
|
120
|
+
Satellite Message is identified by its Id;
|
121
|
+
Satellite Message is designated for one Data Store;
|
122
|
+
Satellite Message has at most one Message Data;
|
123
|
+
Satellite Message has at most one Message Header;
|
124
|
+
Satellite Message is of at most one Provider Type;
|
125
|
+
Satellite Message has one Serial Number;
|
126
|
+
Satellite Message has one insertion-Date Time;
|
127
|
+
|
128
|
+
Subscription is identified by its Nr;
|
129
|
+
Company has one DriverTech-Subscription;
|
130
|
+
Subscription has one Beginning-Date;
|
131
|
+
Subscription has at most one Ending-Date;
|
132
|
+
Subscription is enabled;
|
133
|
+
|
134
|
+
Switch is identified by its Id;
|
135
|
+
Data Store has at most one Legacy-Switch;
|
136
|
+
Switch is one Major-Version;
|
137
|
+
Switch is one Minor-Version;
|
138
|
+
Switch has one Operating-Port;
|
139
|
+
Switch is one Revision-Version;
|
140
|
+
Switch has one monitoring-Port;
|
141
|
+
Switch (as Private Interface Switch) is on private-Network,
|
142
|
+
private-Network connects to at most one Private Interface Switch;
|
143
|
+
Switch (as Public Interface Switch) is on public-Network; // Avoid ambiguity; this is a new fact type
|
144
|
+
Switch (as Public Interface Switch) is on at least one public-Network,
|
145
|
+
Network connects to at most one Public Interface Switch;
|
146
|
+
Switch is backup messages;
|
147
|
+
Switch is backup updates;
|
148
|
+
Switch is send disabled;
|
149
|
+
Switch is test vectors enabled;
|
150
|
+
|
151
|
+
Transaction is identified by its Nr;
|
152
|
+
Satellite Message has at most one Group-Transaction;
|
153
|
+
|
154
|
+
User is identified by its Name;
|
155
|
+
User has one Primary-Email Address;
|
156
|
+
User has at most one Secondary-Email Address;
|
157
|
+
User is monitor notification disabled;
|
158
|
+
|
159
|
+
Vendor is a kind of Company [separate];
|
160
|
+
Vendor requires at least one Credential;
|
161
|
+
|
162
|
+
Client is a kind of Company [separate];
|
163
|
+
Client has at most one default-Data Store;
|
164
|
+
Data Store belongs to one Client,
|
165
|
+
Client uses Data Store;
|
166
|
+
|
167
|
+
File Host System is a kind of Host System;
|
168
|
+
File Host System has one Port;
|
169
|
+
|
170
|
+
Host System Runs Switch is where
|
171
|
+
Host System runs Switch;
|
172
|
+
|
173
|
+
Monitor Notification Type is where
|
174
|
+
Monitor has at least one Notification Type;
|
175
|
+
Monitor Notification Type is excluded;
|
176
|
+
|
177
|
+
Monitor Notification User is where
|
178
|
+
Monitor Notification Type has notification-User;
|
179
|
+
Monitor Notification User has one Notification Level;
|
180
|
+
|
181
|
+
Service is identified by Vendor and Service Type where
|
182
|
+
Vendor provides Service,
|
183
|
+
Service is of one Service Type;
|
184
|
+
|
185
|
+
Data Store File Host System is where
|
186
|
+
Data Store has one File Host System;
|
187
|
+
Data Store File Host System has one Internal-Credential;
|
188
|
+
|
189
|
+
Data Store Service is where
|
190
|
+
Service is from at least one Data Store,
|
191
|
+
Data Store has Service;
|
192
|
+
Data Store Service belongs to one Client;
|
193
|
+
Data Store Service requires at least one Credential;
|
194
|
+
Data Store Service has one Subscription;
|
195
|
+
|
196
|
+
/*
|
197
|
+
* Constraints:
|
198
|
+
*/
|
199
|
+
either Company is client or Company is vendor but not both;
|
200
|
+
for each Credential exactly one of these holds:
|
201
|
+
Data Store (2) requires Credential,
|
202
|
+
Data Store Service requires Credential,
|
203
|
+
Vendor requires Credential,
|
204
|
+
Data Store File Host System has Internal-Credential,
|
205
|
+
Data Store (1) has Internal-Credential;
|
206
|
+
for each Network exactly one of these holds:
|
207
|
+
Network is used by Host System,
|
208
|
+
Company has Origin-Network,
|
209
|
+
TcpProxy-Network is in Data Store;
|
210
|
+
for each Network exactly one of these holds:
|
211
|
+
Network is ip_single,
|
212
|
+
Network is ip_subnet,
|
213
|
+
Network is ip_range;
|
214
|
+
either Host System runs Switch or Data Store has Legacy-Switch but not both;
|
215
|
+
for each Network at most one of these holds:
|
216
|
+
Network is ip_single,
|
217
|
+
Network has Ending-IP;
|
218
|
+
Data Store Service (in which Service is from Data Store) belongs to Client
|
219
|
+
if and only if
|
220
|
+
Client has default Data Store;
|
221
|
+
Network has Ending IP
|
222
|
+
if and only if
|
223
|
+
Network is ip_range;
|
224
|
+
Network is ip_subnet
|
225
|
+
if and only if
|
226
|
+
Network uses Netmask;
|
227
|
+
Switch is on private Network
|
228
|
+
if and only if
|
229
|
+
Data Store has Legacy Switch;
|
230
|
+
Client has default Data Store
|
231
|
+
only if Client uses Data Store;
|
232
|
+
TcpProxy Network is in Data Store
|
233
|
+
only if Network is ip_single;
|
234
|
+
Network uses Domain Name
|
235
|
+
only if Network is ip_single;
|
236
|
+
each Credential occurs at most one time in
|
237
|
+
Data Store File Host System has Internal Credential;
|
238
|
+
each Credential occurs at most one time in
|
239
|
+
Data Store Service requires Credential;
|
240
|
+
each Credential occurs at most one time in
|
241
|
+
Data Store has Internal Credential;
|
242
|
+
each Credential occurs at most one time in
|
243
|
+
Data Store requires Credential;
|
244
|
+
each Credential occurs at most one time in
|
245
|
+
Vendor requires Credential;
|
246
|
+
each IP occurs at most one time in
|
247
|
+
Network has Ending IP;
|
248
|
+
each IP occurs at most one time in
|
249
|
+
Network has Initial IP;
|
250
|
+
each Name occurs at most one time in
|
251
|
+
Data Store has Friendly Name;
|
252
|
+
each Network occurs at most one time in
|
253
|
+
Company has Origin Network;
|
254
|
+
each Port occurs at most one time in
|
255
|
+
Switch has monitoring Port;
|
256
|
+
each Recurring Schedule occurs at least one time in
|
257
|
+
Recurring Schedule monday,
|
258
|
+
Recurring Schedule tuesday,
|
259
|
+
Recurring Schedule wednesday,
|
260
|
+
Recurring Schedule thursday,
|
261
|
+
Recurring Schedule friday,
|
262
|
+
Recurring Schedule saturday,
|
263
|
+
Recurring Schedule sunday;
|
264
|
+
each Service occurs one time in
|
265
|
+
Vendor provides Service;
|
266
|
+
each Subscription occurs at most one time in
|
267
|
+
Company has DriverTech Subscription;
|
268
|
+
each Subscription occurs at most one time in
|
269
|
+
Data Store Service has Subscription;
|
270
|
+
each Switch occurs at most one time in
|
271
|
+
Data Store has Legacy Switch;
|
272
|
+
each combination User Name, Vendor, Data Store Service, Data Store occurs at most one time in
|
273
|
+
Credential has User Name,
|
274
|
+
Vendor requires Credential,
|
275
|
+
Data Store Service requires Credential,
|
276
|
+
Data Store requires Credential;
|
data/cql/Supervision.cql
ADDED
@@ -0,0 +1,34 @@
|
|
1
|
+
vocabulary Supervision;
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Value Types
|
5
|
+
*/
|
6
|
+
CompanyName is written as String;
|
7
|
+
EmployeeNr is written as Signed Integer(32);
|
8
|
+
|
9
|
+
/*
|
10
|
+
* Entity Types
|
11
|
+
*/
|
12
|
+
Company is identified by its Name;
|
13
|
+
|
14
|
+
Employee is identified by Company and EmployeeNr where
|
15
|
+
Employee works for one Company,
|
16
|
+
Company employs Employee,
|
17
|
+
Employee has one EmployeeNr,
|
18
|
+
EmployeeNr is of Employee;
|
19
|
+
|
20
|
+
Manager is a kind of Employee;
|
21
|
+
Manager supervises Employee,
|
22
|
+
Employee reports to at most one Manager;
|
23
|
+
|
24
|
+
CEO is a kind of Manager;
|
25
|
+
CEO runs Company,
|
26
|
+
Company is run by one CEO;
|
27
|
+
|
28
|
+
/*
|
29
|
+
* Constraints:
|
30
|
+
*/
|
31
|
+
either Employee reports to Manager(1) or Employee is a Manager(2) that is a CEO that runs Company but not both;
|
32
|
+
Employee is a Manager that is a CEO that runs Company
|
33
|
+
if and only if
|
34
|
+
Employee works for Company;
|