activefacts-examples 1.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +10 -0
  3. data/.rspec +1 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +10 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +22 -0
  8. data/Rakefile +6 -0
  9. data/activefacts-examples.gemspec +26 -0
  10. data/cql/Address.cql +44 -0
  11. data/cql/Astronomy.cql +35 -0
  12. data/cql/Blog.cql +54 -0
  13. data/cql/CinemaBookings.cql +64 -0
  14. data/cql/CinemaTickets.cql +127 -0
  15. data/cql/CompanyDirectorEmployee.cql +56 -0
  16. data/cql/Death.cql +17 -0
  17. data/cql/Diplomacy.cql +48 -0
  18. data/cql/Genealogy.cql +98 -0
  19. data/cql/Health.cql +78 -0
  20. data/cql/Insurance.cql +320 -0
  21. data/cql/Marriage.cql +18 -0
  22. data/cql/Metamodel.cql +567 -0
  23. data/cql/Monogamy.cql +24 -0
  24. data/cql/MultiInheritance.cql +22 -0
  25. data/cql/MultipleSubtyping.cql +30 -0
  26. data/cql/NonRoleId.cql +14 -0
  27. data/cql/OddIdentifier.cql +18 -0
  28. data/cql/OilSupply.cql +53 -0
  29. data/cql/OneRoleNesting.cql +38 -0
  30. data/cql/OneToOnes.cql +17 -0
  31. data/cql/Orienteering.cql +111 -0
  32. data/cql/PartyModel.cql +38 -0
  33. data/cql/PersonPlaysGame.cql +18 -0
  34. data/cql/RedundantDependency.cql +34 -0
  35. data/cql/SchoolActivities.cql +33 -0
  36. data/cql/SeparateSubtype.cql +30 -0
  37. data/cql/ServiceDirector.cql +276 -0
  38. data/cql/SimplestUnary.cql +12 -0
  39. data/cql/Supervision.cql +34 -0
  40. data/cql/VenueSeating.cql +45 -0
  41. data/cql/WaiterTips.cql +33 -0
  42. data/cql/Warehousing.cql +101 -0
  43. data/cql/WindowInRoomInBldg.cql +28 -0
  44. data/cql/unit.cql +474 -0
  45. data/diagrams/json/Address.json +41 -0
  46. data/diagrams/json/Astronomy.json +31 -0
  47. data/diagrams/json/Blog.json +46 -0
  48. data/diagrams/json/CinemaBookings.json +53 -0
  49. data/diagrams/json/CinemaTickets.json +101 -0
  50. data/diagrams/json/CompanyDirectorEmployee.json +44 -0
  51. data/diagrams/json/Death.json +20 -0
  52. data/diagrams/json/Diplomacy.json +34 -0
  53. data/diagrams/json/Genealogy.json +78 -0
  54. data/diagrams/json/Insurance.json +259 -0
  55. data/diagrams/json/Marriage.json +21 -0
  56. data/diagrams/json/Metamodel.json +318 -0
  57. data/diagrams/json/Monogamy.json +22 -0
  58. data/diagrams/json/MultiInheritance.json +25 -0
  59. data/diagrams/json/MultipleSubtyping.json +22 -0
  60. data/diagrams/json/OilSupply.json +49 -0
  61. data/diagrams/json/OneRoleNesting.json +37 -0
  62. data/diagrams/json/Orienteering.json +94 -0
  63. data/diagrams/json/PersonPlaysGame.json +22 -0
  64. data/diagrams/json/RedundantDependency.json +33 -0
  65. data/diagrams/json/SchoolActivities.json +28 -0
  66. data/diagrams/json/SeparateSubtype.json +29 -0
  67. data/diagrams/json/SimplestUnary.json +15 -0
  68. data/diagrams/json/Supervision.json +27 -0
  69. data/diagrams/json/VenueSeating.json +40 -0
  70. data/diagrams/json/WaiterTips.json +29 -0
  71. data/diagrams/json/Warehousing.json +86 -0
  72. data/diagrams/json/WindowInRoomInBldg.json +31 -0
  73. data/images/Address.SQL.png +0 -0
  74. data/images/Address.png +0 -0
  75. data/images/Blog.png +0 -0
  76. data/images/CinemaBookings.png +0 -0
  77. data/images/CinemaTickets.png +0 -0
  78. data/images/CompanyDirectorEmployee.png +0 -0
  79. data/images/Death.png +0 -0
  80. data/images/Diplomacy.png +0 -0
  81. data/images/DumpMetamodel.bat +2 -0
  82. data/images/Genealogy.png +0 -0
  83. data/images/Insurance/Claim.png +0 -0
  84. data/images/Insurance/Insurance.png +0 -0
  85. data/images/Insurance/Person.png +0 -0
  86. data/images/Insurance/Policy.png +0 -0
  87. data/images/Insurance/Related.png +0 -0
  88. data/images/Insurance/VehicleIncident.png +0 -0
  89. data/images/Marriage.png +0 -0
  90. data/images/Metamodel/Concepts.png +0 -0
  91. data/images/Metamodel/Constraints.png +0 -0
  92. data/images/Metamodel/ContextNote.png +0 -0
  93. data/images/Metamodel/Diagrams.png +0 -0
  94. data/images/Metamodel/Language.png +0 -0
  95. data/images/Metamodel/Legacy.png +0 -0
  96. data/images/Metamodel/Objects.png +0 -0
  97. data/images/Metamodel/Populations.png +0 -0
  98. data/images/Metamodel/Query.png +0 -0
  99. data/images/Metamodel/Units.png +0 -0
  100. data/images/Metamodel/ValueConstraints.png +0 -0
  101. data/images/Metamodel/ValueTypes.png +0 -0
  102. data/images/MetamodelER.bcp +1 -0
  103. data/images/MetamodelER.pdf +0 -0
  104. data/images/MultiInheritance.png +0 -0
  105. data/images/NorthwindER.png +0 -0
  106. data/images/OilSupply.png +0 -0
  107. data/images/Orienteering/Administration.png +0 -0
  108. data/images/Orienteering/Registration.png +0 -0
  109. data/images/Orienteering/Scoring.png +0 -0
  110. data/images/PersonPlaysGame.png +0 -0
  111. data/images/RedundantDependency.png +0 -0
  112. data/images/SchoolActivities.png +0 -0
  113. data/images/SeparateSubtype.png +0 -0
  114. data/images/SimplestUnary.png +0 -0
  115. data/images/Supervision.png +0 -0
  116. data/images/VenueSeating.png +0 -0
  117. data/images/WaiterTips.png +0 -0
  118. data/images/Warehousing.png +0 -0
  119. data/images/WindowInRoomInBldg.png +0 -0
  120. data/metadata/json/Astronomy.json +175 -0
  121. data/metadata/json/CinemaBookings.json +354 -0
  122. data/metadata/json/CinemaTickets.json +768 -0
  123. data/metadata/json/CompanyDirectorEmployee.json +270 -0
  124. data/metadata/json/Diplomacy.json +186 -0
  125. data/metadata/json/Metamodel.json +3214 -0
  126. data/metadata/json/OilSupply.json +411 -0
  127. data/metadata/json/SeparateSubtype.json +157 -0
  128. data/metadata/json/Supervision.json +128 -0
  129. data/metadata/json/VenueSeating.json +209 -0
  130. data/orm/.gitignore +11 -0
  131. data/orm/Address.orm +1268 -0
  132. data/orm/Astronomy.orm +925 -0
  133. data/orm/Blog.orm +1711 -0
  134. data/orm/CinemaBookings.orm +1998 -0
  135. data/orm/CinemaTickets.orm +5060 -0
  136. data/orm/CompanyDirectorEmployee.orm +2094 -0
  137. data/orm/Death.orm +386 -0
  138. data/orm/Diplomacy.orm +1478 -0
  139. data/orm/ExampleModels2010.csproj +764 -0
  140. data/orm/ExampleModels2010.sln +16 -0
  141. data/orm/Genealogy.orm +3209 -0
  142. data/orm/Health.orm +2407 -0
  143. data/orm/Insurance.orm +12727 -0
  144. data/orm/Marriage.orm +493 -0
  145. data/orm/Metamodel.orm +20998 -0
  146. data/orm/Monogamy.orm +328 -0
  147. data/orm/MultiInheritance.orm +537 -0
  148. data/orm/MultipleSubtyping.orm +347 -0
  149. data/orm/OilSupply.orm +2533 -0
  150. data/orm/OneRoleNesting.orm +1237 -0
  151. data/orm/Orienteering.orm +3976 -0
  152. data/orm/PersonPlaysGame.orm +426 -0
  153. data/orm/RedundantDependency.orm +844 -0
  154. data/orm/SchoolActivities.orm +961 -0
  155. data/orm/SeparateSubtype.orm +821 -0
  156. data/orm/SimplestUnary.orm +172 -0
  157. data/orm/Supervision.orm +734 -0
  158. data/orm/VenueSeating.orm +1289 -0
  159. data/orm/WaiterTips.orm +789 -0
  160. data/orm/Warehousing.orm +3792 -0
  161. data/orm/WindowInRoomInBldg.orm +772 -0
  162. data/rails/models/Astronomy.models +17 -0
  163. data/rails/models/CinemaBookings.models +123 -0
  164. data/rails/models/CinemaTickets.models +192 -0
  165. data/rails/models/Diplomacy.models +126 -0
  166. data/rails/models/Metamodel.models +894 -0
  167. data/rails/models/OneRoleNesting.models +18 -0
  168. data/rails/models/SeparateSubtype.models +49 -0
  169. data/rails/models/VenueSeating.models +70 -0
  170. data/rails/schema/Astronomy.schema.rb +25 -0
  171. data/rails/schema/CinemaBookings.schema.rb +78 -0
  172. data/rails/schema/CinemaTickets.schema.rb +132 -0
  173. data/rails/schema/Diplomacy.schema.rb +74 -0
  174. data/rails/schema/Metamodel.schema.rb +538 -0
  175. data/rails/schema/OneRoleNesting.rb +20 -0
  176. data/rails/schema/SeparateSubtype.schema.rb +35 -0
  177. data/rails/schema/VenueSeating.schema.rb +46 -0
  178. data/rails/schema/Warehousing.schema.rb +145 -0
  179. data/ruby/Address.rb +68 -0
  180. data/ruby/Astronomy.rb +55 -0
  181. data/ruby/Blog.rb +84 -0
  182. data/ruby/CinemaBookings.rb +109 -0
  183. data/ruby/CinemaTickets.rb +218 -0
  184. data/ruby/CompanyDirectorEmployee.rb +73 -0
  185. data/ruby/Death.rb +26 -0
  186. data/ruby/Diplomacy.rb +59 -0
  187. data/ruby/Genealogy.rb +173 -0
  188. data/ruby/Insurance.rb +562 -0
  189. data/ruby/Marriage.rb +21 -0
  190. data/ruby/Metamodel.rb +621 -0
  191. data/ruby/Monogamy.rb +27 -0
  192. data/ruby/MultiInheritance.rb +38 -0
  193. data/ruby/OilSupply.rb +112 -0
  194. data/ruby/OneRoleNesting.rb +66 -0
  195. data/ruby/Orienteering.rb +216 -0
  196. data/ruby/PersonPlaysGame.rb +31 -0
  197. data/ruby/RedundantDependency.rb +53 -0
  198. data/ruby/SchoolActivities.rb +49 -0
  199. data/ruby/SeparateSubtype.rb +46 -0
  200. data/ruby/SimplestUnary.rb +10 -0
  201. data/ruby/Supervision.rb +33 -0
  202. data/ruby/TwoValues.rb +14 -0
  203. data/ruby/VenueSeating.rb +64 -0
  204. data/ruby/WaiterTips.rb +49 -0
  205. data/ruby/Warehousing.rb +167 -0
  206. data/ruby/WindowInRoomInBldg.rb +45 -0
  207. data/sql/server/Address.sql +40 -0
  208. data/sql/server/Astronomy.sql +36 -0
  209. data/sql/server/Blog.sql +78 -0
  210. data/sql/server/CinemaBookings.sql +95 -0
  211. data/sql/server/CinemaTickets.sql +191 -0
  212. data/sql/server/CompanyDirectorEmployee.sql +104 -0
  213. data/sql/server/Death.sql +11 -0
  214. data/sql/server/Diplomacy.sql +66 -0
  215. data/sql/server/Genealogy.sql +138 -0
  216. data/sql/server/Health.sql +169 -0
  217. data/sql/server/Insurance.sql +484 -0
  218. data/sql/server/Marriage.sql +30 -0
  219. data/sql/server/Metamodel.sql +1000 -0
  220. data/sql/server/Monogamy.sql +20 -0
  221. data/sql/server/MultiInheritance.sql +27 -0
  222. data/sql/server/OilSupply.sql +105 -0
  223. data/sql/server/OneRoleNesting.sql +29 -0
  224. data/sql/server/Orienteering.sql +186 -0
  225. data/sql/server/PersonPlaysGame.sql +9 -0
  226. data/sql/server/RedundantDependency.sql +54 -0
  227. data/sql/server/SchoolActivities.sql +30 -0
  228. data/sql/server/SeparateSubtype.sql +33 -0
  229. data/sql/server/SimplestUnary.sql +9 -0
  230. data/sql/server/Supervision.sql +30 -0
  231. data/sql/server/VenueSeating.sql +54 -0
  232. data/sql/server/WaiterTips.sql +31 -0
  233. data/sql/server/Warehousing.sql +203 -0
  234. data/sql/server/WindowInRoomInBldg.sql +13 -0
  235. data/transform/surrogate/Address.absorption +2 -0
  236. data/transform/surrogate/Blog.absorption +5 -0
  237. data/transform/surrogate/CinemaBookings.absorption +7 -0
  238. data/transform/surrogate/CompanyDirectorEmployee.absorption +7 -0
  239. data/transform/surrogate/Death.absorption +1 -0
  240. data/transform/surrogate/Diplomacy-revised.absorption +6 -0
  241. data/transform/surrogate/Diplomacy.absorption +6 -0
  242. data/transform/surrogate/Genealogy.absorption +8 -0
  243. data/transform/surrogate/Insurance.absorption +18 -0
  244. data/transform/surrogate/Marriage.absorption +2 -0
  245. data/transform/surrogate/Metamodel.absorption +25 -0
  246. data/transform/surrogate/Monogamy.absorption +1 -0
  247. data/transform/surrogate/MultiInheritance.absorption +1 -0
  248. data/transform/surrogate/MultipleSubtyping.absorption +1 -0
  249. data/transform/surrogate/OilSupply.absorption +8 -0
  250. data/transform/surrogate/OneRoleNesting.absorption +1 -0
  251. data/transform/surrogate/Orienteering.absorption +11 -0
  252. data/transform/surrogate/PersonPlaysGame.absorption +1 -0
  253. data/transform/surrogate/RedundantDependency.absorption +3 -0
  254. data/transform/surrogate/SchoolActivities.absorption +3 -0
  255. data/transform/surrogate/SeparateSubtype.absorption +3 -0
  256. data/transform/surrogate/SimplestUnary.absorption +1 -0
  257. data/transform/surrogate/Supervision.absorption +2 -0
  258. data/transform/surrogate/WaiterTips.absorption +3 -0
  259. data/transform/surrogate/Warehousing.absorption +12 -0
  260. data/transform/surrogate/WindowInRoomInBldg.absorption +1 -0
  261. data/transform/surrogate/unit.absorption +0 -0
  262. 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;
@@ -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;
@@ -0,0 +1,12 @@
1
+ vocabulary SimplestUnary;
2
+
3
+ /*
4
+ * Value Types
5
+ */
6
+ Some String is written as String;
7
+
8
+ /*
9
+ * Fact Types
10
+ */
11
+ Some String is long;
12
+
@@ -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;