activefacts 1.6.0 → 1.7.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +14 -0
  3. data/.rspec +2 -0
  4. data/.travis.yml +4 -0
  5. data/Gemfile +14 -0
  6. data/LICENSE.txt +21 -0
  7. data/README.md +60 -0
  8. data/Rakefile +3 -80
  9. data/activefacts.gemspec +36 -0
  10. data/bin/afgen +4 -2
  11. data/bin/cql +5 -1
  12. data/lib/activefacts.rb +3 -12
  13. data/lib/activefacts/{vocabulary/query_evaluator.rb → query/evaluator.rb} +0 -0
  14. data/lib/activefacts/version.rb +2 -2
  15. metadata +48 -296
  16. data/History.txt +0 -4
  17. data/LICENSE +0 -19
  18. data/Manifest.txt +0 -165
  19. data/README.rdoc +0 -81
  20. data/css/offline.css +0 -3
  21. data/css/orm2.css +0 -124
  22. data/css/print.css +0 -8
  23. data/css/style-print.css +0 -357
  24. data/css/style.css +0 -387
  25. data/download.html +0 -110
  26. data/examples/CQL/Address.cql +0 -44
  27. data/examples/CQL/Blog.cql +0 -54
  28. data/examples/CQL/CompanyDirectorEmployee.cql +0 -56
  29. data/examples/CQL/Death.cql +0 -17
  30. data/examples/CQL/Diplomacy.cql +0 -48
  31. data/examples/CQL/Genealogy.cql +0 -98
  32. data/examples/CQL/Insurance.cql +0 -320
  33. data/examples/CQL/Marriage.cql +0 -18
  34. data/examples/CQL/Metamodel.cql +0 -493
  35. data/examples/CQL/Monogamy.cql +0 -24
  36. data/examples/CQL/MultiInheritance.cql +0 -22
  37. data/examples/CQL/NonRoleId.cql +0 -14
  38. data/examples/CQL/OddIdentifier.cql +0 -18
  39. data/examples/CQL/OilSupply.cql +0 -53
  40. data/examples/CQL/OneToOnes.cql +0 -17
  41. data/examples/CQL/Orienteering.cql +0 -111
  42. data/examples/CQL/PersonPlaysGame.cql +0 -18
  43. data/examples/CQL/RedundantDependency.cql +0 -34
  44. data/examples/CQL/SchoolActivities.cql +0 -33
  45. data/examples/CQL/SeparateSubtype.cql +0 -30
  46. data/examples/CQL/ServiceDirector.cql +0 -276
  47. data/examples/CQL/SimplestUnary.cql +0 -12
  48. data/examples/CQL/Supervision.cql +0 -34
  49. data/examples/CQL/WaiterTips.cql +0 -33
  50. data/examples/CQL/Warehousing.cql +0 -101
  51. data/examples/CQL/WindowInRoomInBldg.cql +0 -28
  52. data/examples/CQL/unit.cql +0 -474
  53. data/examples/index.html +0 -420
  54. data/examples/intro.html +0 -327
  55. data/examples/local.css +0 -24
  56. data/index.html +0 -111
  57. data/lib/activefacts/cql.rb +0 -35
  58. data/lib/activefacts/cql/CQLParser.treetop +0 -158
  59. data/lib/activefacts/cql/Context.treetop +0 -48
  60. data/lib/activefacts/cql/Expressions.treetop +0 -67
  61. data/lib/activefacts/cql/FactTypes.treetop +0 -358
  62. data/lib/activefacts/cql/Language/English.treetop +0 -315
  63. data/lib/activefacts/cql/LexicalRules.treetop +0 -253
  64. data/lib/activefacts/cql/ObjectTypes.treetop +0 -210
  65. data/lib/activefacts/cql/Rakefile +0 -14
  66. data/lib/activefacts/cql/Terms.treetop +0 -183
  67. data/lib/activefacts/cql/ValueTypes.treetop +0 -202
  68. data/lib/activefacts/cql/compiler.rb +0 -156
  69. data/lib/activefacts/cql/compiler/clause.rb +0 -1137
  70. data/lib/activefacts/cql/compiler/constraint.rb +0 -581
  71. data/lib/activefacts/cql/compiler/entity_type.rb +0 -457
  72. data/lib/activefacts/cql/compiler/expression.rb +0 -443
  73. data/lib/activefacts/cql/compiler/fact.rb +0 -390
  74. data/lib/activefacts/cql/compiler/fact_type.rb +0 -421
  75. data/lib/activefacts/cql/compiler/query.rb +0 -106
  76. data/lib/activefacts/cql/compiler/shared.rb +0 -161
  77. data/lib/activefacts/cql/compiler/value_type.rb +0 -174
  78. data/lib/activefacts/cql/nodes.rb +0 -49
  79. data/lib/activefacts/cql/parser.rb +0 -241
  80. data/lib/activefacts/dependency_analyser.rb +0 -182
  81. data/lib/activefacts/generate/absorption.rb +0 -70
  82. data/lib/activefacts/generate/composition.rb +0 -118
  83. data/lib/activefacts/generate/cql.rb +0 -714
  84. data/lib/activefacts/generate/dm.rb +0 -279
  85. data/lib/activefacts/generate/help.rb +0 -64
  86. data/lib/activefacts/generate/helpers/inject.rb +0 -16
  87. data/lib/activefacts/generate/helpers/oo.rb +0 -162
  88. data/lib/activefacts/generate/helpers/ordered.rb +0 -605
  89. data/lib/activefacts/generate/helpers/rails.rb +0 -57
  90. data/lib/activefacts/generate/html/glossary.rb +0 -461
  91. data/lib/activefacts/generate/json.rb +0 -337
  92. data/lib/activefacts/generate/null.rb +0 -32
  93. data/lib/activefacts/generate/rails/models.rb +0 -246
  94. data/lib/activefacts/generate/rails/schema.rb +0 -216
  95. data/lib/activefacts/generate/records.rb +0 -46
  96. data/lib/activefacts/generate/ruby.rb +0 -133
  97. data/lib/activefacts/generate/sql/mysql.rb +0 -280
  98. data/lib/activefacts/generate/sql/server.rb +0 -273
  99. data/lib/activefacts/generate/stats.rb +0 -69
  100. data/lib/activefacts/generate/text.rb +0 -27
  101. data/lib/activefacts/generate/topics.rb +0 -265
  102. data/lib/activefacts/generate/traits/datavault.rb +0 -241
  103. data/lib/activefacts/generate/traits/oo.rb +0 -73
  104. data/lib/activefacts/generate/traits/ordered.rb +0 -33
  105. data/lib/activefacts/generate/traits/ruby.rb +0 -210
  106. data/lib/activefacts/generate/transform/datavault.rb +0 -266
  107. data/lib/activefacts/generate/transform/surrogate.rb +0 -214
  108. data/lib/activefacts/generate/version.rb +0 -26
  109. data/lib/activefacts/input/cql.rb +0 -43
  110. data/lib/activefacts/input/orm.rb +0 -1636
  111. data/lib/activefacts/mapping/rails.rb +0 -132
  112. data/lib/activefacts/persistence.rb +0 -15
  113. data/lib/activefacts/persistence/columns.rb +0 -446
  114. data/lib/activefacts/persistence/foreignkey.rb +0 -187
  115. data/lib/activefacts/persistence/index.rb +0 -240
  116. data/lib/activefacts/persistence/object_type.rb +0 -198
  117. data/lib/activefacts/persistence/reference.rb +0 -434
  118. data/lib/activefacts/persistence/tables.rb +0 -380
  119. data/lib/activefacts/registry.rb +0 -11
  120. data/lib/activefacts/support.rb +0 -132
  121. data/lib/activefacts/vocabulary.rb +0 -9
  122. data/lib/activefacts/vocabulary/extensions.rb +0 -1348
  123. data/lib/activefacts/vocabulary/metamodel.rb +0 -570
  124. data/lib/activefacts/vocabulary/verbaliser.rb +0 -804
  125. data/script/txt2html +0 -71
  126. data/spec/absorption_spec.rb +0 -95
  127. data/spec/cql/comparison_spec.rb +0 -89
  128. data/spec/cql/context_spec.rb +0 -94
  129. data/spec/cql/contractions_spec.rb +0 -224
  130. data/spec/cql/deontic_spec.rb +0 -88
  131. data/spec/cql/entity_type_spec.rb +0 -320
  132. data/spec/cql/expressions_spec.rb +0 -66
  133. data/spec/cql/fact_type_matching_spec.rb +0 -338
  134. data/spec/cql/french_spec.rb +0 -21
  135. data/spec/cql/parser/bad_literals_spec.rb +0 -86
  136. data/spec/cql/parser/constraints_spec.rb +0 -19
  137. data/spec/cql/parser/entity_types_spec.rb +0 -106
  138. data/spec/cql/parser/expressions_spec.rb +0 -199
  139. data/spec/cql/parser/fact_types_spec.rb +0 -44
  140. data/spec/cql/parser/literals_spec.rb +0 -312
  141. data/spec/cql/parser/pragmas_spec.rb +0 -89
  142. data/spec/cql/parser/value_types_spec.rb +0 -42
  143. data/spec/cql/role_matching_spec.rb +0 -148
  144. data/spec/cql/samples_spec.rb +0 -244
  145. data/spec/cql_cql_spec.rb +0 -73
  146. data/spec/cql_dm_spec.rb +0 -136
  147. data/spec/cql_mysql_spec.rb +0 -69
  148. data/spec/cql_parse_spec.rb +0 -34
  149. data/spec/cql_ruby_spec.rb +0 -73
  150. data/spec/cql_sql_spec.rb +0 -72
  151. data/spec/cql_symbol_tables_spec.rb +0 -261
  152. data/spec/cqldump_spec.rb +0 -170
  153. data/spec/helpers/array_matcher.rb +0 -23
  154. data/spec/helpers/ctrl_c_support.rb +0 -52
  155. data/spec/helpers/diff_matcher.rb +0 -39
  156. data/spec/helpers/file_matcher.rb +0 -34
  157. data/spec/helpers/parse_to_ast_matcher.rb +0 -80
  158. data/spec/helpers/string_matcher.rb +0 -30
  159. data/spec/helpers/test_parser.rb +0 -15
  160. data/spec/norma_cql_spec.rb +0 -66
  161. data/spec/norma_ruby_spec.rb +0 -62
  162. data/spec/norma_ruby_sql_spec.rb +0 -107
  163. data/spec/norma_sql_spec.rb +0 -57
  164. data/spec/norma_tables_spec.rb +0 -95
  165. data/spec/ruby_api_spec.rb +0 -23
  166. data/spec/spec_helper.rb +0 -35
  167. data/spec/transform_surrogate_spec.rb +0 -59
  168. data/status.html +0 -138
  169. data/why.html +0 -60
@@ -1,44 +0,0 @@
1
- vocabulary Address;
2
-
3
- /*
4
- * Value Types
5
- */
6
- City is written as String(64);
7
- Company Name is written as String;
8
- Family Name is written as String(20);
9
- Given Names is written as String(20);
10
- Number is written as String(12);
11
- Postcode is written as String;
12
- Street Line is written as String(64);
13
-
14
- /*
15
- * Entity Types
16
- */
17
- Company is identified by its Name;
18
-
19
- Family is identified by its Name;
20
-
21
- Person is identified by Family and Given Names where
22
- Person is of one Family,
23
- Family includes Person,
24
- Person has one Given Names;
25
-
26
- Street is identified by first-Street Line and second-Street Line and third-Street Line where
27
- Street includes one first-Street Line,
28
- Street includes at most one second-Street Line,
29
- Street includes at most one third-Street Line;
30
-
31
- Address is identified by street-Number and Street and City and Postcode where
32
- Address is at at most one street-Number,
33
- Address is at one Street,
34
- Address is in one City,
35
- Address is in at most one Postcode restricted to {1000..9999},
36
- Postcode is of Address;
37
- Company has head office at at most one Address;
38
- Person lives at at most one Address;
39
-
40
- /*
41
- * Constraints:
42
- */
43
- Street includes third Street Line
44
- only if Street includes second Street Line;
@@ -1,54 +0,0 @@
1
- vocabulary Blog;
2
-
3
- /*
4
- * Value Types
5
- */
6
- Author Id is written as Auto Counter;
7
- Comment Id is written as Auto Counter;
8
- Name is written as String(64);
9
- Ordinal is written as Unsigned Integer(32);
10
- Post Id is written as Auto Counter;
11
- Style is written as String(20);
12
- Text is written as Text;
13
- Topic Id is written as Auto Counter;
14
-
15
- /*
16
- * Entity Types
17
- */
18
- Author is identified by its Id;
19
- author-Name is of at most one Author,
20
- Author is called one Name;
21
-
22
- Comment is identified by its Id;
23
- Author wrote Comment,
24
- Comment was written by one Author;
25
-
26
- Content is identified by Style and Text where
27
- Content is of at most one Style,
28
- Content has one Text,
29
- Text is of Content;
30
- Content provides text of Comment,
31
- Comment consists of one text-Content;
32
-
33
- Post is identified by its Id;
34
- Post was written by one Author,
35
- Author wrote Post;
36
-
37
- Topic is identified by its Id;
38
- Post belongs to one Topic,
39
- Topic contains Post;
40
- Topic belongs to at most one parent-Topic [acyclic];
41
- Topic is called one topic-Name,
42
- Name is of at most one Topic;
43
-
44
- Paragraph is where
45
- Post includes Ordinal paragraph;
46
- Content is of Paragraph,
47
- Paragraph contains one Content;
48
- Paragraph has Comment,
49
- Comment is on one Paragraph;
50
-
51
- /*
52
- * Constraints:
53
- */
54
- either Content provides text of Comment or Content is of Paragraph but not both;
@@ -1,56 +0,0 @@
1
- vocabulary CompanyDirectorEmployee;
2
-
3
- /*
4
- * Value Types
5
- */
6
- Company Name is written as String(48);
7
- Date is written as Date;
8
- Employee Nr is written as Signed Integer(32);
9
- Name is written as String(48);
10
-
11
- /*
12
- * Entity Types
13
- */
14
- Company is identified by its Name where
15
- Company is called Company Name;
16
- Company is listed;
17
-
18
- Employee is identified by its Nr;
19
- Employee works at one Company,
20
- Company employs Employee;
21
-
22
- Manager is a kind of Employee;
23
- Employee is supervised by at most one Manager [acyclic],
24
- Manager supervises Employee;
25
- Manager is ceo;
26
-
27
- Meeting is independent identified by Company and Date and Meeting is board meeting where
28
- Meeting is held by one Company,
29
- Company held Meeting,
30
- Meeting is held on one Date,
31
- Meeting is board meeting;
32
-
33
- Person is identified by given-Name and family-Name where
34
- Person has one given-Name,
35
- given-Name is of Person,
36
- family-Name is of Person,
37
- Person is called at most one family-Name;
38
- Person was born on at most one birth-Date restricted to {'1900/01/01'..};
39
-
40
- Attendance is where
41
- Person (as Attendee) attended Meeting,
42
- Meeting was attended by Attendee;
43
-
44
- Directorship is where
45
- Person (as Director) directs Company,
46
- Company is directed by at least one Director;
47
- Directorship began on one appointment-Date;
48
-
49
- Employment is where
50
- Person works as Employee,
51
- Employee role is assigned to at least one Person;
52
-
53
- /*
54
- * Constraints:
55
- */
56
- either Employee is supervised by Manager(1) or Employee is a Manager(2) that is ceo but not both;
@@ -1,17 +0,0 @@
1
- vocabulary Death;
2
-
3
- /*
4
- * Value Types
5
- */
6
- Cause Of Death is written as String;
7
- Person Name is written as String(40);
8
-
9
- /*
10
- * Entity Types
11
- */
12
- Person is independent identified by its Name;
13
-
14
- Death is where
15
- Person is dead;
16
- Death was due to at most one Cause Of Death;
17
-
@@ -1,48 +0,0 @@
1
- vocabulary Diplomacy;
2
-
3
- /*
4
- * Value Types
5
- */
6
- CountryName is written as String;
7
- DiplomatName is written as String;
8
- LanguageName is written as String;
9
-
10
- /*
11
- * Entity Types
12
- */
13
- Country is independent identified by its Name;
14
-
15
- Diplomat is identified by its Name;
16
- Diplomat represents one Country (as Represented Country);
17
- Diplomat serves in one Country (as Served Country);
18
-
19
- Language is independent identified by its Name;
20
-
21
- LanguageUse is where
22
- Language is spoken in Country,
23
- Country uses Language;
24
-
25
- Ambassador is a kind of Diplomat;
26
-
27
- Fluency is where
28
- Diplomat speaks at least one Language,
29
- Language is spoken by Diplomat;
30
-
31
- Representation is where
32
- Ambassador is from Country (as Represented Country) to Country,
33
- Represented Country is represented in Country by one Ambassador;
34
-
35
- /*
36
- * Constraints:
37
- */
38
- for each Diplomat, Country at most one of these holds:
39
- Diplomat serves in Country,
40
- Diplomat represents Country;
41
- Diplomat is an Ambassador that is from Country(1) to Country(2)
42
- only if Diplomat represents Country(1);
43
- Diplomat is an Ambassador that is from Country(2) to Country(1)
44
- only if Diplomat serves in Country(1);
45
- Diplomat serves in Country
46
- only if Diplomat speaks Language that is spoken in Country;
47
- each Ambassador occurs at least one time in
48
- Ambassador is from Country(1) to Country(2);
@@ -1,98 +0,0 @@
1
- vocabulary Genealogy;
2
-
3
- /*
4
- * Value Types
5
- */
6
- Address is written as String(128);
7
- Certificate is written as String(64);
8
- Day is written as Unsigned Integer(32) restricted to {1..31};
9
- Email is written as String(64);
10
- Event ID is written as Auto Counter;
11
- Event Location is written as String(128);
12
- Event Role Name is written as String restricted to {'Celebrant', 'Father', 'Husband', 'Mother', 'Subject', 'Wife'};
13
- Event Type ID is written as Auto Counter;
14
- Event Type Name is written as String(16) restricted to {'Birth', 'Burial', 'Christening', 'Death', 'Divorce', 'Marriage'};
15
- Gender is written as Char(1) restricted to {'F', 'M'};
16
- Month is written as Unsigned Integer(32) restricted to {1..12};
17
- Name is written as String(128);
18
- Occupation is written as String(128);
19
- Official is written as String(64);
20
- Person ID is written as Auto Counter;
21
- Picture is written as Image;
22
- Role ID is written as Auto Counter;
23
- Source ID is written as Auto Counter;
24
- Source Name is written as String(128);
25
- User ID is written as Auto Counter;
26
- Year is written as Unsigned Integer(32);
27
-
28
- /*
29
- * Entity Types
30
- */
31
- Event is identified by its ID;
32
- Event is certified by at most one Certificate;
33
- Event occurred at at most one Event Location;
34
- Event was confirmed by at most one Official;
35
-
36
- Event Date is identified by min-Year and max-Year and Month and Day where
37
- Event Date wasnt before at most one min-Year,
38
- Event Date wasnt after at most one max-Year,
39
- Event Date occurred in at most one Month,
40
- Event Date occurred on at most one Day;
41
- Event occurred on at most one Event Date;
42
-
43
- Event Type is identified by its ID;
44
- Event is of at most one Event Type;
45
- Event Type is called one Event Type Name,
46
- Event Type Name is name of at most one Event Type;
47
-
48
- Person is identified by its ID;
49
- Address is of Person,
50
- Person lives at at most one Address;
51
- Email is of Person,
52
- Person has at most one Email;
53
- Occupation is of Person,
54
- Person is employed in at most one Occupation;
55
- Person is of at most one Gender;
56
- Person is called at most one family-Name,
57
- family-Name is of Person;
58
- given-Name is name of Person; // Avoid ambiguity; this is a new fact type
59
- given-Name is name of Person,
60
- Person is called at most one given-Name;
61
- preferred-Picture is of Person,
62
- Person has at most one preferred-Picture;
63
-
64
- Role is identified by its ID;
65
- Role is called one Event Role Name,
66
- Event Role Name is name of at most one Role;
67
-
68
- Source is identified by its ID;
69
- Source has one Source Name,
70
- Source Name is of at most one Source;
71
-
72
- User is identified by its ID;
73
- Email is of User,
74
- User has at most one Email;
75
- User provided Source,
76
- Source was provided by one User;
77
-
78
- Friendship is where
79
- User is friendly with other-User [symmetric];
80
- Friendship is confirmed;
81
-
82
- Participation is where
83
- Person played Role in Event according to Source,
84
- Person was involved in Event according to Source in Role,
85
- Source claims Person played Role in Event;
86
-
87
- /*
88
- * Constraints:
89
- */
90
- each Event Date occurs at least one time in
91
- Event Date wasnt before min Year(2),
92
- Event Date wasnt after max Year(1),
93
- Event Date occurred in Month,
94
- Event Date occurred on Day;
95
- each Event occurs at least one time in
96
- Person played Role in Event according to Source;
97
- each Person occurs at least one time in
98
- Person played Role in Event according to Source;
@@ -1,320 +0,0 @@
1
- vocabulary Insurance;
2
-
3
- /*
4
- * Value Types
5
- */
6
- Alias is written as Char(3);
7
- Application Nr is written as Signed Integer(32);
8
- Asset ID is written as Auto Counter;
9
- Badge is written as String;
10
- Charge is written as String;
11
- City is written as String;
12
- Claim ID is written as Auto Counter;
13
- Claim Sequence is written as Unsigned Integer(32) restricted to {1..999};
14
- Colour is written as String;
15
- Contact Method is written as Char(1) restricted to {'B', 'H', 'M'};
16
- Count is written as Unsigned Integer(32);
17
- Cover Type Code is written as Char;
18
- Cover Type Name is written as String;
19
- Date is written as Date;
20
- Date Time is written as Date Time;
21
- Description is written as String(1024);
22
- Email is written as String;
23
- Engine Number is written as String;
24
- Hospital Name is written as String;
25
- ITC Claimed is written as Decimal(18,2) restricted to {0.0..100.0};
26
- Intoxication is written as String;
27
- Liability Code is written as Char(1) restricted to {'D', 'L', 'R', 'U'};
28
- License Number is written as String;
29
- License Type is written as String;
30
- Location is written as String;
31
- Loss Type Code is written as Char;
32
- Lost Item Nr is written as Signed Integer(32);
33
- Make is written as String;
34
- Model is written as String;
35
- Name is written as String(256);
36
- Occupation is written as String;
37
- Party ID is written as Auto Counter;
38
- Phone Nr is written as String;
39
- Place is written as String;
40
- Policy Serial is written as Unsigned Integer(32) restricted to {1..99999};
41
- Policy Wording Text is written as String;
42
- Postcode is written as String;
43
- Price is written as Decimal(18,2);
44
- Product Code is written as Unsigned Integer(8) restricted to {1..99};
45
- Reason is written as String;
46
- Registration Nr is written as Char(8);
47
- Report Nr is written as Signed Integer(32);
48
- State Code is written as Unsigned Integer(8) restricted to {0..9};
49
- State Name is written as String(256);
50
- Street is written as String(256);
51
- Test Result is written as String;
52
- Text is written as String;
53
- Time is written as Time;
54
- Title is written as String;
55
- Underwriting Question ID is written as Auto Counter;
56
- VIN is written as Unsigned Integer(32);
57
- Year Nr is written as Signed Integer(32);
58
-
59
- /*
60
- * Entity Types
61
- */
62
- Application is identified by its Nr;
63
-
64
- Asset is identified by its ID;
65
-
66
- Claim is identified by its ID;
67
- Claim has one Claim Sequence (as p_sequence),
68
- p_sequence is of Claim;
69
-
70
- Cover Type is identified by its Code;
71
- Cover Type has one Cover Type Name,
72
- Cover Type Name is of at most one Cover Type;
73
-
74
- Hospital is identified by its Name;
75
-
76
- Incident is identified by Claim where
77
- Claim concerns at most one Incident,
78
- Incident is of one Claim;
79
- Incident relates to loss on one Date Time;
80
-
81
- Liability is identified by its Code restricted to {'D', 'L', 'R', 'U'};
82
-
83
- Loss Type is identified by its Code;
84
- Loss Type implies at most one Liability;
85
- Loss Type involves driving;
86
- Loss Type is single vehicle incident;
87
-
88
- Lost Item is identified by Incident and Lost Item Nr where
89
- Lost Item was lost in one Incident,
90
- Lost Item has one Lost Item Nr,
91
- Lost Item Nr is of Lost Item;
92
- Description is of Lost Item,
93
- Lost Item has one Description;
94
- Lost Item was purchased on at most one purchase-Date;
95
- Lost Item was purchased at at most one purchase-Place;
96
- Lost Item was purchased for at most one purchase-Price;
97
-
98
- Party is identified by its ID;
99
- Party is a company;
100
-
101
- Person is a kind of Party;
102
- Person has at most one Occupation;
103
- Person has one Title;
104
- Person has at most one birth-Date;
105
- Person has one family-Name,
106
- family-Name is of Person;
107
- Person has given-Name; // Avoid ambiguity; this is a new fact type
108
- Person has one given-Name,
109
- given-Name is of Person;
110
-
111
- Phone is identified by its Nr;
112
-
113
- Police Report is identified by Incident where
114
- Incident is covered by at most one Police Report,
115
- Police Report covers one Incident;
116
- Police Report was to at most one officer-Name;
117
- Police Report has at most one police-Report Nr;
118
- Police Report was on at most one report-Date Time;
119
- Police Report was by at most one reporter-Name;
120
- Police Report was at at most one station-Name;
121
-
122
- Policy Wording is identified by its Text;
123
-
124
- Product is identified by its Code;
125
- Alias is of at most one Product,
126
- Product has at most one Alias;
127
- Description is of at most one Product,
128
- Product has at most one Description;
129
-
130
- Registration is identified by its Nr;
131
-
132
- State is independent identified by its Code;
133
- State Name is of at most one State,
134
- State has at most one State Name;
135
-
136
- Underwriting Question is identified by its ID;
137
- Text is of at most one Underwriting Question,
138
- Underwriting Question has one Text;
139
-
140
- Vehicle is a kind of Asset identified by VIN where
141
- Vehicle has one VIN,
142
- VIN is of at most one Vehicle;
143
- Registration is of Vehicle,
144
- Vehicle has one Registration;
145
- Vehicle is of at most one Colour;
146
- Vehicle has at most one Engine Number;
147
- Vehicle has commercial registration;
148
-
149
- Vehicle Incident is a kind of Incident [separate];
150
- Vehicle Incident has at most one Description;
151
- Vehicle Incident resulted from at most one Loss Type;
152
- Vehicle Incident was caused by at most one Reason;
153
- Vehicle Incident involved at most one previous_damage-Description;
154
- Vehicle Incident resulted in vehicle being towed to at most one towed-Location;
155
- Vehicle Incident occurred during at most one weather-Description;
156
-
157
- Vehicle Type is identified by Make and Model and Badge where
158
- Vehicle Type is of one Make,
159
- Vehicle Type is of one Model,
160
- Badge is of Vehicle Type,
161
- Vehicle Type has at most one Badge;
162
- Vehicle is of one Vehicle Type;
163
-
164
- Witness is identified by Incident and Name where
165
- Incident was independently witnessed by Witness,
166
- Witness saw one Incident,
167
- Witness is called one Name;
168
- Witness has at most one contact-Phone;
169
-
170
- Year is identified by its Nr;
171
- Vehicle is of one model-Year restricted to {1900..2100};
172
-
173
- Address is identified by Street and City and Postcode and State where
174
- Address is at one Street,
175
- Address is in one City,
176
- Address is in at most one Postcode,
177
- Address is in at most one State;
178
- Incident relates to loss at one Address;
179
- Party has at most one postal-Address;
180
- Person lives at at most one Address;
181
- Witness lives at at most one Address;
182
-
183
- Authorised Rep is a kind of Party;
184
-
185
- Company is a kind of Party;
186
- Company has one contact-Person,
187
- Person is contact for Company;
188
-
189
- Contact Methods is identified by Person where
190
- Person has one Contact Methods,
191
- Contact Methods are for one Person;
192
- Contact Methods includes at most one Email;
193
- Contact Methods includes at most one business-Phone;
194
- Contact Methods prefers at most one contact-Time;
195
- Contact Methods includes at most one home-Phone;
196
- Contact Methods includes at most one mobile-Phone;
197
- Contact Methods has at most one preferred-Contact Method;
198
-
199
- Contractor is a kind of Company;
200
-
201
- Contractor Appointment is where
202
- Claim involves Contractor,
203
- Contractor is appointed to handle Claim;
204
-
205
- Cover Wording is where
206
- Cover Type used Policy Wording from start-Date;
207
-
208
- Dealer is a kind of Party;
209
- Vehicle was sold by at most one Dealer;
210
-
211
- Driving is where
212
- Vehicle Incident occurred while being driven;
213
- Driving followed at most one Intoxication;
214
- Driving resulted in at most one breath-Test Result;
215
- Driving was without owners consent for at most one nonconsent-Reason;
216
- Driving was unlicenced for at most one unlicensed-Reason;
217
- Person was Driving,
218
- Driving was by one Person;
219
-
220
- Driving Charge is where
221
- Driving resulted in at most one Charge;
222
- Driving Charge is a warning;
223
-
224
- Finance Institution is a kind of Company;
225
- Vehicle is subject to finance with at most one Finance Institution;
226
-
227
- Hospitalization is where
228
- Driving resulted in driver taken to at most one Hospital;
229
- Hospitalization resulted in at most one blood-Test Result;
230
-
231
- Insured is a kind of Party;
232
-
233
- Insurer is a kind of Company;
234
-
235
- Investigator is a kind of Contractor;
236
-
237
- License is identified by Person where
238
- Person holds at most one License,
239
- License is held by one Person;
240
- License has one License Number,
241
- License Number is of at most one License;
242
- License is of one License Type,
243
- License Type has License instance;
244
- License was granted in at most one Year restricted to {1990..2100};
245
- License is international;
246
-
247
- Lodgement is where
248
- Claim was lodged by one Person;
249
- Lodgement was made at at most one Date Time;
250
-
251
- Policy is identified by p_year and p_product and p_state and p_serial where
252
- Policy was issued in one Year (as p_year) restricted to {0..99},
253
- Policy is for product having one Product (as p_product),
254
- Policy issued in state having one State (as p_state),
255
- Policy has one Policy Serial (as p_serial);
256
- Application is for Policy,
257
- Policy has one Application;
258
- Claim is on one Policy,
259
- Policy has Claim;
260
- ITC Claimed is for Policy,
261
- Policy has at most one ITC Claimed;
262
- Policy was sold by at most one Authorised Rep,
263
- Authorised Rep sold Policy;
264
- Policy belongs to one Insured,
265
- Insured has Policy;
266
-
267
- Property Damage is identified by Incident and Address where
268
- Incident caused Property Damage,
269
- Property Damage was damaged in at most one Incident,
270
- Property Damage is at one Address,
271
- Address is of Property Damage;
272
- Property Damage owner has contact at most one Phone;
273
- Property Damage belongs to at most one owner-Name;
274
-
275
- Repairer is a kind of Contractor;
276
-
277
- Solicitor is a kind of Contractor;
278
-
279
- Third Party is where
280
- Person was third party in Vehicle Incident;
281
- Third Party is insured by at most one Insurer;
282
- Third Party vehicle is of at most one Vehicle Type;
283
- Third Party vehicle is of at most one model-Year;
284
- Third Party drove at most one vehicle-Registration;
285
-
286
- Underwriting Demerit is identified by Vehicle Incident and Underwriting Question where
287
- Vehicle Incident occurred despite Underwriting Demerit,
288
- Underwriting Demerit preceded one Vehicle Incident,
289
- Underwriting Demerit has one Underwriting Question,
290
- Underwriting Question is of Underwriting Demerit;
291
- Underwriting Demerit occurred at most one occurrence-Count times;
292
-
293
- Assessor is a kind of Contractor;
294
-
295
- Cover is where
296
- Policy provides Cover Type over Asset,
297
- Cover Type over Asset is provided by Policy;
298
-
299
- Motor Policy is a kind of Policy;
300
-
301
- Single Motor Policy is a kind of Motor Policy;
302
-
303
- Motor Fleet Policy is a kind of Motor Policy;
304
-
305
- /*
306
- * Constraints:
307
- */
308
- either Motor Policy is a Single Motor Policy or Motor Policy is a Motor Fleet Policy but not both;
309
- Party is a Company that has contact Person
310
- if and only if
311
- Party is a company;
312
- each Contact Methods occurs at least one time in
313
- Contact Methods includes mobile Phone(3),
314
- Contact Methods includes home Phone(2),
315
- Contact Methods includes business Phone(1),
316
- Contact Methods includes Email;
317
- each combination Policy, Claim Sequence occurs at most one time in
318
- Claim is on Policy,
319
- Claim has Claim Sequence;
320
- either Witness lives at Address or Witness has contact Phone;