activefacts 0.8.6 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (118) hide show
  1. data/Manifest.txt +33 -2
  2. data/README.rdoc +30 -36
  3. data/Rakefile +16 -20
  4. data/bin/afgen +17 -11
  5. data/bin/cql +313 -36
  6. data/download.html +43 -19
  7. data/examples/CQL/Address.cql +15 -15
  8. data/examples/CQL/Blog.cql +8 -8
  9. data/examples/CQL/CompanyDirectorEmployee.cql +6 -5
  10. data/examples/CQL/Death.cql +3 -3
  11. data/examples/CQL/Diplomacy.cql +48 -0
  12. data/examples/CQL/Genealogy.cql +41 -41
  13. data/examples/CQL/Insurance.cql +311 -0
  14. data/examples/CQL/JoinEquality.cql +35 -0
  15. data/examples/CQL/Marriage.cql +1 -1
  16. data/examples/CQL/Metamodel.cql +290 -185
  17. data/examples/CQL/MetamodelNext.cql +420 -0
  18. data/examples/CQL/Monogamy.cql +24 -0
  19. data/examples/CQL/MonthInSeason.cql +27 -0
  20. data/examples/CQL/Moon.cql +23 -0
  21. data/examples/CQL/MultiInheritance.cql +4 -4
  22. data/examples/CQL/NonRoleId.cql +14 -0
  23. data/examples/CQL/OddIdentifier.cql +18 -0
  24. data/examples/CQL/OilSupply.cql +24 -24
  25. data/examples/CQL/OneToOnes.cql +17 -0
  26. data/examples/CQL/Orienteering.cql +55 -55
  27. data/examples/CQL/OrienteeringER.cql +58 -0
  28. data/examples/CQL/PersonPlaysGame.cql +2 -2
  29. data/examples/CQL/RedundantDependency.cql +34 -0
  30. data/examples/CQL/SchoolActivities.cql +5 -5
  31. data/examples/CQL/SeparateSubtype.cql +28 -0
  32. data/examples/CQL/ServiceDirector.cql +283 -0
  33. data/examples/CQL/SimplestUnary.cql +2 -2
  34. data/examples/CQL/SubtypePI.cql +11 -11
  35. data/examples/CQL/Supervision.cql +38 -0
  36. data/examples/CQL/Tests.Test5.Load.cql +38 -0
  37. data/examples/CQL/WaiterTips.cql +33 -0
  38. data/examples/CQL/Warehousing.cql +55 -53
  39. data/examples/CQL/WindowInRoomInBldg.cql +9 -9
  40. data/examples/CQL/unit.cql +433 -544
  41. data/examples/index.html +314 -170
  42. data/examples/intro.html +6 -176
  43. data/examples/local.css +8 -4
  44. data/index.html +40 -25
  45. data/lib/activefacts/api/concept.rb +2 -2
  46. data/lib/activefacts/api/constellation.rb +4 -4
  47. data/lib/activefacts/api/instance.rb +2 -2
  48. data/lib/activefacts/api/instance_index.rb +4 -0
  49. data/lib/activefacts/api/numeric.rb +3 -1
  50. data/lib/activefacts/api/role.rb +1 -1
  51. data/lib/activefacts/api/standard_types.rb +23 -16
  52. data/lib/activefacts/api/support.rb +3 -1
  53. data/lib/activefacts/api/vocabulary.rb +4 -0
  54. data/lib/activefacts/cql/CQLParser.treetop +87 -39
  55. data/lib/activefacts/cql/Concepts.treetop +95 -69
  56. data/lib/activefacts/cql/Context.treetop +11 -2
  57. data/lib/activefacts/cql/Expressions.treetop +23 -59
  58. data/lib/activefacts/cql/FactTypes.treetop +141 -95
  59. data/lib/activefacts/cql/Language/English.treetop +33 -21
  60. data/lib/activefacts/cql/LexicalRules.treetop +6 -1
  61. data/lib/activefacts/cql/Terms.treetop +75 -26
  62. data/lib/activefacts/cql/ValueTypes.treetop +52 -54
  63. data/lib/activefacts/cql/compiler.rb +46 -1691
  64. data/lib/activefacts/cql/compiler/constraint.rb +602 -0
  65. data/lib/activefacts/cql/compiler/entity_type.rb +425 -0
  66. data/lib/activefacts/cql/compiler/fact.rb +300 -0
  67. data/lib/activefacts/cql/compiler/fact_type.rb +230 -0
  68. data/lib/activefacts/cql/compiler/reading.rb +832 -0
  69. data/lib/activefacts/cql/compiler/shared.rb +109 -0
  70. data/lib/activefacts/cql/compiler/value_type.rb +104 -0
  71. data/lib/activefacts/cql/parser.rb +132 -81
  72. data/lib/activefacts/generate/cql.rb +397 -274
  73. data/lib/activefacts/generate/oo.rb +13 -12
  74. data/lib/activefacts/generate/ordered.rb +107 -117
  75. data/lib/activefacts/generate/ruby.rb +34 -38
  76. data/lib/activefacts/generate/sql/mysql.rb +62 -45
  77. data/lib/activefacts/generate/sql/server.rb +59 -42
  78. data/lib/activefacts/input/cql.rb +6 -3
  79. data/lib/activefacts/input/orm.rb +991 -557
  80. data/lib/activefacts/persistence/columns.rb +16 -12
  81. data/lib/activefacts/persistence/foreignkey.rb +7 -4
  82. data/lib/activefacts/persistence/index.rb +3 -4
  83. data/lib/activefacts/persistence/reference.rb +5 -2
  84. data/lib/activefacts/support.rb +20 -14
  85. data/lib/activefacts/version.rb +1 -1
  86. data/lib/activefacts/vocabulary.rb +1 -0
  87. data/lib/activefacts/vocabulary/extensions.rb +328 -44
  88. data/lib/activefacts/vocabulary/metamodel.rb +145 -20
  89. data/lib/activefacts/vocabulary/verbaliser.rb +621 -0
  90. data/spec/absorption_spec.rb +4 -4
  91. data/spec/api/value_type.rb +1 -1
  92. data/spec/cql/context_spec.rb +45 -22
  93. data/spec/cql/deontic_spec.rb +88 -0
  94. data/spec/cql/matching_spec.rb +517 -0
  95. data/spec/cql/samples_spec.rb +88 -31
  96. data/spec/cql/unit_spec.rb +58 -37
  97. data/spec/cql_cql_spec.rb +12 -7
  98. data/spec/cql_mysql_spec.rb +3 -7
  99. data/spec/cql_parse_spec.rb +0 -4
  100. data/spec/cql_ruby_spec.rb +1 -4
  101. data/spec/cql_sql_spec.rb +5 -18
  102. data/spec/cql_symbol_tables_spec.rb +3 -0
  103. data/spec/cqldump_spec.rb +0 -2
  104. data/spec/helpers/array_matcher.rb +35 -0
  105. data/spec/helpers/ctrl_c_support.rb +52 -0
  106. data/spec/helpers/diff_matcher.rb +38 -0
  107. data/spec/helpers/file_matcher.rb +5 -3
  108. data/spec/helpers/string_matcher.rb +39 -0
  109. data/spec/helpers/test_parser.rb +13 -0
  110. data/spec/norma_cql_spec.rb +13 -5
  111. data/spec/norma_ruby_spec.rb +11 -3
  112. data/spec/{absorption_ruby_spec.rb → norma_ruby_sql_spec.rb} +37 -32
  113. data/spec/norma_sql_spec.rb +11 -5
  114. data/spec/norma_tables_spec.rb +33 -29
  115. data/spec/spec_helper.rb +4 -1
  116. data/status.html +92 -23
  117. metadata +102 -36
  118. data/lib/activefacts/generate/cql/html.rb +0 -403
@@ -0,0 +1,35 @@
1
+ vocabulary JoinEquality;
2
+
3
+ /*
4
+ * Value Types
5
+ */
6
+ Event Id is written as Auto Counter;
7
+ Number is written as Unsigned Integer(16);
8
+ Reserve is written as String(20);
9
+ Row is written as Char(2);
10
+ Venue Id is written as Auto Counter;
11
+
12
+ /*
13
+ * Entity Types
14
+ */
15
+ Event is identified by its Id;
16
+
17
+ Venue is identified by its Id [independent];
18
+ Event is held at one Venue;
19
+
20
+ Seat is identified by Venue and Reserve and Row and Number [independent] where
21
+ Seat is at one Venue,
22
+ Seat is in one Reserve,
23
+ Seat is in one Row,
24
+ Seat has one Number;
25
+
26
+ Ticket is identified by Event and Seat where
27
+ Ticket is for one Event,
28
+ Ticket is for one Seat;
29
+
30
+ /*
31
+ * Constraints:
32
+ */
33
+ Ticket is for Seat that is at Venue
34
+ if and only if
35
+ Ticket is for Event that is held at Venue;
@@ -3,7 +3,7 @@ vocabulary Marriage;
3
3
  /*
4
4
  * Value Types
5
5
  */
6
- Name is written as VariableLengthText;
6
+ Name is written as String;
7
7
 
8
8
  /*
9
9
  * Entity Types
@@ -3,117 +3,161 @@ vocabulary Metamodel;
3
3
  /*
4
4
  * Value Types
5
5
  */
6
- Adjective is written as VariableLengthText(64);
7
- Assimilation is written as VariableLengthText restricted to {'partitioned', 'separate'};
8
- ConstraintId is written as AutoCounter;
9
- ContextNoteId is written as AutoCounter;
10
- ContextNoteKind is written as VariableLengthText restricted to {'as_opposed_to', 'because', 'so_that', 'to_avoid'};
11
- Denominator is written as UnsignedInteger(32);
12
- Discussion is written as VariableLengthText;
13
- Enforcement is written as VariableLengthText(16);
14
- Exponent is written as SignedSmallInteger(32);
15
- FactId is written as AutoCounter;
16
- FactTypeId is written as AutoCounter;
17
- Frequency is written as UnsignedInteger(32);
18
- InstanceId is written as AutoCounter;
19
- Length is written as UnsignedInteger(32);
20
- Literal is written as VariableLengthText;
21
- Name is written as VariableLengthText(64);
6
+ Adjective is written as String(64);
7
+ Agent Name is written as String;
8
+ Assimilation is written as String restricted to {'partitioned', 'separate'};
9
+ Constraint Id is written as Auto Counter;
10
+ Context Note Id is written as Auto Counter;
11
+ Context Note Kind is written as String restricted to {'as_opposed_to', 'because', 'so_that', 'to_avoid'};
12
+ Date is written as Date;
13
+ Denominator is written as Unsigned Integer(32);
14
+ Discussion is written as String;
15
+ Display Role Names Setting is written as String restricted to {'false', 'true'};
16
+ Enforcement Code is written as String(16);
17
+ Ephemera URL is written as String;
18
+ Exponent is written as Signed Integer(16);
19
+ Fact Id is written as Auto Counter;
20
+ Fact Type Id is written as Auto Counter;
21
+ Frequency is written as Unsigned Integer(32);
22
+ Instance Id is written as Auto Counter;
23
+ Join Id is written as Auto Counter;
24
+ Length is written as Unsigned Integer(32);
25
+ Literal is written as String;
26
+ Name is written as String(64);
22
27
  Numerator is written as Decimal;
23
28
  Offset is written as Decimal;
24
- Ordinal is written as UnsignedSmallInteger(32);
25
- PersonName is written as VariableLengthText;
26
- Pronoun is written as VariableLengthText(20) restricted to {'feminine', 'masculine', 'neuter', 'personal'};
27
- RingType is written as VariableLengthText;
28
- RoleSequenceId is written as AutoCounter;
29
- Scale is written as UnsignedInteger(32);
30
- Text is written as VariableLengthText(256);
31
- UnitId is written as AutoCounter;
32
- ValueRestrictionId is written as AutoCounter;
29
+ Ordinal is written as Unsigned Integer(16);
30
+ Pronoun is written as String(20) restricted to {'feminine', 'masculine', 'neuter', 'personal'};
31
+ Ring Type is written as String;
32
+ Role Sequence Id is written as Auto Counter;
33
+ Rotation Setting is written as String restricted to {'left', 'right'};
34
+ Scale is written as Unsigned Integer(32);
35
+ Shape Id is written as Auto Counter;
36
+ Text is written as String(256);
37
+ Unit Id is written as Auto Counter;
38
+ X is written as Signed Integer(32);
39
+ Y is written as Signed Integer(32);
33
40
 
34
41
  /*
35
42
  * Entity Types
36
43
  */
44
+ Agent is identified by its Name;
45
+
37
46
  Coefficient is identified by Numerator and Denominator and Coefficient is precise where
38
47
  Coefficient has one Numerator,
39
48
  Coefficient has one Denominator,
40
49
  Coefficient is precise;
41
50
 
42
51
  Constraint is identified by its Id;
43
- Constraint requires at most one Enforcement,
44
- Enforcement applies to Constraint;
45
52
  Name is of Constraint,
46
53
  Constraint is called at most one Name;
47
54
 
48
- ContextNote is identified by its Id;
49
- Constraint has ContextNote,
50
- ContextNote applies to at most one Constraint;
51
- ContextNote has one ContextNoteKind,
52
- ContextNoteKind is of ContextNote;
53
- ContextNote has one Discussion,
54
- Discussion is for ContextNote;
55
+ Context Note is identified by its Id;
56
+ Constraint has Context Note,
57
+ Context Note applies to at most one Constraint;
58
+ Context Note has one Context Note Kind,
59
+ Context Note Kind is of Context Note;
60
+ Context Note has one Discussion,
61
+ Discussion is for Context Note;
62
+
63
+ Enforcement is identified by Constraint where
64
+ Constraint requires at most one Enforcement,
65
+ Enforcement applies to one Constraint;
66
+ Enforcement notifies at most one Agent;
67
+ Enforcement has one Enforcement Code,
68
+ Enforcement Code is of Enforcement;
55
69
 
56
70
  Fact is identified by its Id;
57
71
 
58
- FactType is identified by its Id;
59
- Fact is of one FactType;
60
- FactType has ContextNote,
61
- ContextNote applies to at most one FactType;
62
-
63
- Instance is identified by its Id;
64
- Instance objectifies at most one Fact;
72
+ Fact Type is identified by its Id;
73
+ Fact is of one Fact Type;
74
+ Fact Type has Context Note,
75
+ Context Note applies to at most one Fact Type;
65
76
 
66
- Person is identified by its Name;
77
+ Implicit Fact Type is a kind of Fact Type;
67
78
 
68
- PresenceConstraint is a kind of Constraint;
69
- PresenceConstraint has at most one max-Frequency restricted to {1..};
70
- PresenceConstraint has at most one min-Frequency restricted to {2..};
71
- PresenceConstraint is mandatory;
72
- PresenceConstraint is preferred identifier;
73
-
74
- Reading is identified by FactType and Ordinal where
75
- FactType has at least one Reading,
76
- Reading is for one FactType,
79
+ Instance is identified by its Id;
80
+ Instance objectifies at most one Fact,
81
+ Fact is objectified as at most one Instance;
82
+
83
+ Join is identified by its Id;
84
+
85
+ Join Node is identified by Join and Ordinal where
86
+ Join includes Join Node,
87
+ Join Node is in one Join,
88
+ Join Node has one Ordinal position;
89
+
90
+ Join Step is identified by input-Join Node and output-Join Node where
91
+ Join Step has one input-Join Node,
92
+ Join Step has one output-Join Node;
93
+ Join Step traverses one Fact Type;
94
+ is anti Join Step;
95
+ Join Step is outer;
96
+
97
+ Position is identified by X and Y where
98
+ Position is at one X,
99
+ Position is at one Y;
100
+
101
+ Presence Constraint is a kind of Constraint;
102
+ Presence Constraint has at most one max-Frequency restricted to {1..};
103
+ Presence Constraint has at most one min-Frequency restricted to {2..};
104
+ Presence Constraint is mandatory;
105
+ Presence Constraint is preferred identifier;
106
+
107
+ Reading is identified by Fact Type and Ordinal where
108
+ Fact Type has Reading,
109
+ Reading is for one Fact Type,
77
110
  Reading is in one Ordinal position,
78
111
  Ordinal reading for fact type is Reading;
79
112
  Reading has one Text;
80
113
 
81
- RingConstraint is a kind of Constraint;
82
- RingConstraint is of one RingType;
114
+ Ring Constraint is a kind of Constraint;
115
+ Ring Constraint is of one Ring Type;
83
116
 
84
117
  Role is where
85
- FactType has at least one Ordinal role;
86
- Role is of RingConstraint,
87
- RingConstraint has at most one Role;
118
+ Fact Type has at least one Ordinal role;
119
+ Implicit Fact Type is implied by one Role,
120
+ Role implies at most one Implicit Fact Type;
121
+ Ring Constraint has at most one other-Role;
122
+ Ring Constraint has other-Role,
123
+ other-Role is of Ring Constraint;
124
+ Role is of Ring Constraint,
125
+ Ring Constraint has at most one Role;
88
126
  Role has at most one role-Name,
89
127
  role-Name is name of at least one Role;
90
- other-Role is of RingConstraint,
91
- RingConstraint has at most one other-Role;
92
128
 
93
- RoleSequence is identified by its Id;
94
- PresenceConstraint covers one RoleSequence;
95
- Reading is in one RoleSequence,
96
- RoleSequence is for Reading;
129
+ Role Sequence is identified by its Id;
130
+ Join projects one Role Sequence;
131
+ Presence Constraint covers one Role Sequence;
132
+ Reading is in one Role Sequence,
133
+ Role Sequence is for Reading;
134
+ Role Sequence has unused dependency to force table in norma;
97
135
 
98
- RoleValue is identified by Instance and Fact where
99
- Instance plays RoleValue,
100
- RoleValue is of one Instance,
101
- RoleValue fulfils one Fact,
102
- Fact includes at least one RoleValue;
103
- RoleValue is of one Role;
136
+ Role Value is identified by Instance and Fact where
137
+ Instance plays Role Value,
138
+ Role Value is of one Instance,
139
+ Role Value fulfils one Fact,
140
+ Fact includes at least one Role Value;
141
+ Role Value is of one Role;
104
142
 
105
- SetConstraint is a kind of Constraint;
143
+ Set Constraint is a kind of Constraint;
106
144
 
107
- SubsetConstraint is a kind of SetConstraint;
108
- SubsetConstraint covers one subset-RoleSequence;
109
- SubsetConstraint covers one superset-RoleSequence;
145
+ Shape is identified by its Id;
146
+ Shape is at at most one Position;
147
+ Shape is expanded;
148
+
149
+ Subset Constraint is a kind of Set Constraint;
150
+ Subset Constraint covers one subset-Role Sequence;
151
+ Subset Constraint covers one superset-Role Sequence;
110
152
 
111
153
  Unit is identified by its Id;
154
+ Ephemera URL provides Unit coefficient,
155
+ Unit uses coefficient from at most one Ephemera URL;
112
156
  Name is of Unit,
113
157
  Unit is called one Name;
114
158
  Unit has at most one Coefficient;
115
159
  Unit has at most one Offset;
116
- Unit is ephemeral;
160
+ Unit has at most one plural-Name;
117
161
  Unit is fundamental;
118
162
 
119
163
  Value is identified by Literal and Value is a string and Unit where
@@ -124,9 +168,9 @@ Value is identified by Literal and Value is a string and Unit where
124
168
  Unit is of Value;
125
169
  Instance has at most one Value;
126
170
 
127
- ValueRestriction is identified by its Id;
128
- Role has at most one role-ValueRestriction,
129
- ValueRestriction applies to Role;
171
+ Value Constraint is a kind of Constraint;
172
+ Role has at most one role-Value Constraint,
173
+ Value Constraint applies to at most one Role;
130
174
 
131
175
  Vocabulary is identified by Name where
132
176
  Vocabulary is called one Name;
@@ -135,10 +179,11 @@ Vocabulary contains Constraint,
135
179
  Vocabulary includes Unit,
136
180
  Unit is in one Vocabulary;
137
181
 
138
- Agreement is identified by ContextNote where
139
- ContextNote was added by at most one Agreement,
140
- Agreement covers one ContextNote;
141
- Agreement was on at most one Date;
182
+ Agreement is identified by Context Note where
183
+ Context Note was added by at most one Agreement,
184
+ Agreement covers one Context Note;
185
+ Agreement was on at most one Date,
186
+ Date is of Agreement;
142
187
 
143
188
  Bound is identified by Value and Bound is inclusive where
144
189
  Bound has one Value,
@@ -149,29 +194,61 @@ Concept is identified by Vocabulary and Name where
149
194
  Concept belongs to one Vocabulary,
150
195
  Vocabulary contains Concept,
151
196
  Concept is called one Name;
152
- Concept has ContextNote,
153
- ContextNote applies to at most one Concept;
197
+ Concept has Context Note,
198
+ Context Note applies to at most one Concept;
154
199
  Concept uses at most one Pronoun;
155
200
  Concept plays Role,
156
201
  Role is played by one Concept;
157
202
  Concept is independent;
158
203
  Instance is of one Concept;
204
+ Join Node is for one Concept,
205
+ Concept is referenced in Join Node;
206
+
207
+ Constraint Shape is a kind of Shape;
208
+ Constraint Shape is for one Constraint;
159
209
 
160
- ContextAccordingTo is where
161
- ContextNote is according to Person,
162
- Person claims ContextNote;
210
+ Context According To is where
211
+ Context Note is according to Agent,
212
+ Agent claims Context Note;
213
+ Context According To was lodged on at most one Date;
163
214
 
164
- ContextAgreedBy is where
165
- Agreement was reached by Person,
166
- Person agreed on Agreement;
215
+ Context Agreed By is where
216
+ Agreement was reached by Agent,
217
+ Agent agreed on Agreement;
167
218
 
168
219
  Derivation is where
169
- Unit (as DerivedUnit) is derived from base-Unit (as BaseUnit) [acyclic, intransitive];
220
+ Unit (as Derived Unit) is derived from base-Unit (as Base Unit) [acyclic, intransitive];
170
221
  Derivation has at most one Exponent;
171
222
 
172
- EntityType is a kind of Concept;
173
- EntityType nests at most one FactType,
174
- FactType is nested as at most one EntityType;
223
+ Diagram is identified by Vocabulary and Name where
224
+ Diagram is for one Vocabulary,
225
+ Vocabulary contains Diagram,
226
+ Diagram is called one Name,
227
+ Name is of Diagram;
228
+ Shape is in one Diagram,
229
+ Diagram includes Shape;
230
+
231
+ Entity Type is a kind of Concept;
232
+ Entity Type nests at most one Fact Type,
233
+ Fact Type is nested as at most one Entity Type;
234
+
235
+ Fact Type Shape is a kind of Shape;
236
+ Fact Type Shape has at most one Display Role Names Setting;
237
+ Fact Type Shape is for one Fact Type,
238
+ Fact Type has Fact Type Shape;
239
+ Fact Type Shape has at most one Rotation Setting;
240
+
241
+ Model Note Shape is a kind of Shape;
242
+ Model Note Shape is for one Context Note;
243
+
244
+ Object Type Shape is a kind of Shape;
245
+ Object Type Shape is for one Concept,
246
+ Concept has Object Type Shape;
247
+ Object Type Shape has expanded reference mode;
248
+
249
+ Objectified Fact Type Name Shape is a kind of Shape identified by Fact Type Shape where
250
+ Objectified Fact Type Name Shape is for one Fact Type Shape,
251
+ Fact Type Shape has at most one Objectified Fact Type Name Shape;
175
252
 
176
253
  Population is identified by Vocabulary and Name where
177
254
  Vocabulary includes Population,
@@ -182,112 +259,140 @@ Population includes Fact,
182
259
  Fact belongs to one Population;
183
260
  Population includes Instance,
184
261
  Instance belongs to one Population;
185
- Population includes RoleValue,
186
- RoleValue belongs to one Population;
187
-
188
- RoleRef is where
189
- RoleSequence in Ordinal position includes at most one Role,
190
- Role is in RoleSequence in at most one Ordinal place,
191
- RoleSequence includes Role in Ordinal place,
192
- Role has Ordinal place in RoleSequence;
193
- RoleRef has at most one leading-Adjective;
194
- RoleRef has at most one trailing-Adjective;
195
-
196
- SetComparisonConstraint is a kind of SetConstraint;
197
-
198
- SetComparisonRoles is where
199
- SetComparisonConstraint has in Ordinal position at most one RoleSequence,
200
- RoleSequence is Ordinal in SetComparisonConstraint,
201
- in Ordinal position SetComparisonConstraint has RoleSequence,
202
- SetComparisonConstraint has RoleSequence in at most one Ordinal position;
203
-
204
- SetEqualityConstraint is a kind of SetComparisonConstraint;
205
-
206
- SetExclusionConstraint is a kind of SetComparisonConstraint;
207
- SetExclusionConstraint is mandatory;
208
-
209
- TypeInheritance is a kind of FactType identified by Subtype and Supertype where
210
- EntityType (as Subtype) is subtype of super-EntityType (as Supertype) [acyclic],
262
+ Population includes Role Value,
263
+ Role Value belongs to one Population;
264
+
265
+ Reading Shape is a kind of Shape identified by Fact Type Shape where
266
+ Fact Type Shape has at most one Reading Shape,
267
+ Reading Shape is for one Fact Type Shape;
268
+ Reading Shape is for one Reading,
269
+ Reading has Reading Shape;
270
+
271
+ Ring Constraint Shape is a kind of Constraint Shape;
272
+ Ring Constraint Shape is attached to one Fact Type;
273
+
274
+ Role Display is where
275
+ Fact Type Shape displays Role in Ordinal position,
276
+ Fact Type Shape displays in Ordinal position at most one Role;
277
+
278
+ Role Name Shape is a kind of Shape;
279
+ Role Name Shape is for one Role Display,
280
+ Role Display has at most one Role Name Shape;
281
+
282
+ Role Ref is where
283
+ Role Sequence in Ordinal position includes at most one Role,
284
+ Role is in Role Sequence in at most one Ordinal place,
285
+ Role Sequence includes Role in Ordinal place,
286
+ Role has Ordinal place in Role Sequence;
287
+ Role Ref connects to at most one Join Node,
288
+ Join Node includes Role Ref;
289
+ Role Ref has at most one leading-Adjective;
290
+ Role Ref has at most one trailing-Adjective;
291
+
292
+ Set Comparison Constraint is a kind of Set Constraint;
293
+
294
+ Set Comparison Roles is where
295
+ Set Comparison Constraint has in Ordinal position at most one Role Sequence,
296
+ Role Sequence is Ordinal in Set Comparison Constraint,
297
+ in Ordinal position Set Comparison Constraint has Role Sequence,
298
+ Set Comparison Constraint has Role Sequence in at most one Ordinal position;
299
+
300
+ Set Equality Constraint is a kind of Set Comparison Constraint;
301
+
302
+ Set Exclusion Constraint is a kind of Set Comparison Constraint;
303
+ Set Exclusion Constraint is mandatory;
304
+
305
+ Type Inheritance is a kind of Fact Type identified by Subtype and Supertype where
306
+ Entity Type (as Subtype) is subtype of super-Entity Type (as Supertype) [acyclic],
211
307
  Supertype is supertype of Subtype;
212
- Assimilation applies to TypeInheritance,
213
- TypeInheritance uses at most one Assimilation;
214
- TypeInheritance provides identification;
215
-
216
- ValueRange is identified by minimum-Bound and maximum-Bound where
217
- ValueRange has at most one minimum-Bound,
218
- ValueRange has at most one maximum-Bound;
219
-
220
- ValueType is a kind of Concept;
221
- ValueType has at most one Length,
222
- Length is of ValueType;
223
- ValueType has at most one Scale,
224
- Scale is of ValueType;
225
- ValueType is of at most one Unit;
226
- ValueType has at most one ValueRestriction;
227
- ValueType is subtype of at most one super-ValueType (as Supertype) [acyclic],
228
- Supertype is supertype of ValueType;
229
-
230
- AllowedRange is where
231
- ValueRestriction allows at least one ValueRange;
232
-
233
- Join is where
234
- RoleRef has Ordinal (as JoinStep) join;
235
- Join traverses at most one Concept,
236
- Concept is traversed by Join;
237
- Join has at most one input-Role;
238
- Join has at most one output-Role;
308
+ Assimilation applies to Type Inheritance,
309
+ Type Inheritance uses at most one Assimilation;
310
+ Type Inheritance provides identification;
311
+
312
+ Value Constraint Shape is a kind of Constraint Shape;
313
+ Role Display has at most one Value Constraint Shape,
314
+ Value Constraint Shape is for at most one Role Display;
315
+ Value Constraint Shape is for at most one Object Type Shape,
316
+ Object Type Shape has Value Constraint Shape;
317
+
318
+ Value Range is identified by minimum-Bound and maximum-Bound where
319
+ Value Range has at most one minimum-Bound,
320
+ Value Range has at most one maximum-Bound;
321
+
322
+ Value Type is a kind of Concept;
323
+ Value Type has at most one Length,
324
+ Length is of Value Type;
325
+ Value Type has at most one Scale,
326
+ Scale is of Value Type;
327
+ Value Type is of at most one Unit;
328
+ Value Type has at most one Value Constraint,
329
+ Value Constraint constrains at most one Value Type;
330
+ Value Type is subtype of at most one super-Value Type (as Supertype) [acyclic],
331
+ Supertype is supertype of Value Type;
332
+ Value Type is auto-assigned;
333
+
334
+ Allowed Range is where
335
+ Value Constraint allows at least one Value Range;
336
+
337
+ ImplicitBooleanValueType is a kind of Value Type;
239
338
 
240
339
  Parameter is where
241
- Name is a parameter of ValueType,
242
- ValueType has parameter called Name;
340
+ Name is a parameter of Value Type,
341
+ Value Type has parameter called Name;
243
342
 
244
- ParamValue is where
245
- Value for Parameter applies to at most one ValueType;
343
+ Param Value is where
344
+ Value for Parameter applies to at most one Value Type;
246
345
 
247
346
  /*
248
347
  * Constraints:
249
348
  */
250
- either Concept is an EntityType or Concept is a ValueType but not both;
349
+ either Concept is an Entity Type or Concept is a Value Type but not both;
251
350
  for each Constraint exactly one of these holds:
252
- PresenceConstraint is a kind of Constraint,
253
- SetConstraint is a kind of Constraint,
254
- RingConstraint is a kind of Constraint;
255
- for each ContextNote exactly one of these holds:
256
- Concept has ContextNote,
257
- FactType has ContextNote,
258
- Constraint has ContextNote;
351
+ Constraint is a Presence Constraint,
352
+ Constraint is a Set Constraint,
353
+ Constraint is a Ring Constraint;
354
+ for each Context Note exactly one of these holds:
355
+ Context Note applies to Concept,
356
+ Context Note applies to Fact Type,
357
+ Context Note applies to Constraint;
358
+ either Set Comparison Constraint is a Set Exclusion Constraint or Set Comparison Constraint is a Set Equality Constraint but not both;
359
+ either Set Constraint is a Set Comparison Constraint or Set Constraint is a Subset Constraint but not both;
360
+ either Unit uses coefficient from Ephemera URL or Unit has Coefficient but not both;
361
+ either Unit is fundamental or Unit is derived from base-Unit but not both;
362
+ either Value Constraint Shape is for Object Type Shape or Value Constraint Shape is for Role Display but not both;
363
+ either Value Constraint constrains Value Type or Value Constraint applies to Role but not both;
259
364
  for each Instance at most one of these holds:
260
365
  Instance has Value,
261
366
  Instance objectifies Fact;
262
- Instance plays RoleValue and Instance is of Concept
367
+ Role Value is of Instance that is of Concept
263
368
  if and only if
264
- RoleValue is of Role and Concept plays Role;
265
- RoleValue fulfils Fact and Fact is of FactType
369
+ Role Value is of Role that is played by Concept;
370
+ Role Value fulfils Fact that is of Fact Type
266
371
  if and only if
267
- RoleValue is of Role and FactType has Ordinal role;
268
- either SetComparisonConstraint is a SetExclusionConstraint or SetComparisonConstraint is a SetEqualityConstraint but not both;
269
- either SetConstraint is a SetComparisonConstraint or SetConstraint is a SubsetConstraint but not both;
270
- either Unit is fundamental or that Unit is derived from some base-Unit but not both;
271
- PresenceConstraint is preferred identifier
272
- only if PresenceConstraint has max-Frequency;
273
- ValueType has Scale
274
- only if ValueType has Length;
275
- each combination EntityType, TypeInheritance occurs at most one time in
276
- EntityType is subtype of super-EntityType,
277
- TypeInheritance provides identification;
278
- each Fact occurs at most one time in
279
- Instance objectifies Fact;
280
- either Join has input-Role or Join has output-Role;
281
- each PresenceConstraint occurs at least one time in
282
- PresenceConstraint has min-Frequency,
283
- PresenceConstraint has max-Frequency,
284
- PresenceConstraint is mandatory;
285
- each RoleSequence occurs at least one time in
286
- RoleSequence in Ordinal position includes Role;
287
- either ValueRange has minimum-Bound or ValueRange has maximum-Bound;
372
+ Role Value is of Role (where Fact Type has Ordinal role);
373
+ Presence Constraint is preferred identifier
374
+ only if Presence Constraint has max Frequency;
375
+ Value Type has Scale
376
+ only if Value Type has Length;
377
+ either Agreement was reached by Agent or Agreement was on Date;
378
+ each combination Diagram, Position occurs at most one time in
379
+ Shape is in Diagram,
380
+ Shape is at Position;
381
+ each combination Entity Type, Type Inheritance occurs at most one time in
382
+ Entity Type is subtype of super Entity Type,
383
+ Type Inheritance provides identification;
384
+ each Presence Constraint occurs at least one time in
385
+ Presence Constraint has min Frequency,
386
+ Presence Constraint has max Frequency,
387
+ Presence Constraint is mandatory;
388
+ each Role Sequence occurs at least one time in
389
+ Role Sequence in Ordinal position includes Role;
390
+ each Set Comparison Constraint occurs at least 2 times in
391
+ Set Comparison Constraint has in Ordinal position Role Sequence;
392
+ either Value Range has minimum Bound or Value Range has maximum Bound;
288
393
  each combination Vocabulary, Name occurs at most one time in
289
- Vocabulary contains Constraint,
290
- Name is of Constraint;
394
+ Constraint belongs to Vocabulary,
395
+ Constraint is called Name;
291
396
  each combination Vocabulary, Name occurs at most one time in
292
- Vocabulary includes Unit,
293
- Name is of Unit;
397
+ Unit is in Vocabulary,
398
+ Unit is called Name;