activefacts 0.7.3 → 0.8.5

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 (94) hide show
  1. data/LICENSE +19 -0
  2. data/Manifest.txt +24 -2
  3. data/Rakefile +25 -3
  4. data/bin/afgen +1 -1
  5. data/bin/cql +13 -2
  6. data/css/offline.css +3 -0
  7. data/css/orm2.css +24 -0
  8. data/css/print.css +8 -0
  9. data/css/style-print.css +357 -0
  10. data/css/style.css +387 -0
  11. data/download.html +85 -0
  12. data/examples/CQL/Address.cql +3 -3
  13. data/examples/CQL/Blog.cql +13 -14
  14. data/examples/CQL/CompanyDirectorEmployee.cql +4 -4
  15. data/examples/CQL/Death.cql +3 -2
  16. data/examples/CQL/Genealogy.cql +13 -11
  17. data/examples/CQL/Marriage.cql +2 -2
  18. data/examples/CQL/Metamodel.cql +136 -93
  19. data/examples/CQL/MultiInheritance.cql +2 -2
  20. data/examples/CQL/OilSupply.cql +14 -10
  21. data/examples/CQL/Orienteering.cql +22 -19
  22. data/examples/CQL/PersonPlaysGame.cql +3 -2
  23. data/examples/CQL/SchoolActivities.cql +4 -2
  24. data/examples/CQL/SimplestUnary.cql +1 -1
  25. data/examples/CQL/SubtypePI.cql +6 -7
  26. data/examples/CQL/Warehousing.cql +16 -19
  27. data/examples/CQL/unit.cql +584 -0
  28. data/examples/index.html +276 -0
  29. data/examples/intro.html +497 -0
  30. data/examples/local.css +20 -0
  31. data/index.html +96 -0
  32. data/lib/activefacts/api/concept.rb +48 -46
  33. data/lib/activefacts/api/constellation.rb +43 -23
  34. data/lib/activefacts/api/entity.rb +2 -2
  35. data/lib/activefacts/api/instance.rb +6 -2
  36. data/lib/activefacts/api/instance_index.rb +5 -0
  37. data/lib/activefacts/api/value.rb +8 -2
  38. data/lib/activefacts/api/vocabulary.rb +15 -10
  39. data/lib/activefacts/cql/CQLParser.treetop +109 -88
  40. data/lib/activefacts/cql/Concepts.treetop +32 -10
  41. data/lib/activefacts/cql/Context.treetop +34 -0
  42. data/lib/activefacts/cql/Expressions.treetop +9 -9
  43. data/lib/activefacts/cql/FactTypes.treetop +30 -31
  44. data/lib/activefacts/cql/Language/English.treetop +50 -0
  45. data/lib/activefacts/cql/LexicalRules.treetop +2 -1
  46. data/lib/activefacts/cql/Terms.treetop +117 -0
  47. data/lib/activefacts/cql/ValueTypes.treetop +152 -0
  48. data/lib/activefacts/cql/compiler.rb +1718 -0
  49. data/lib/activefacts/cql/parser.rb +124 -57
  50. data/lib/activefacts/generate/absorption.rb +1 -1
  51. data/lib/activefacts/generate/cql.rb +111 -100
  52. data/lib/activefacts/generate/cql/html.rb +5 -5
  53. data/lib/activefacts/generate/oo.rb +3 -3
  54. data/lib/activefacts/generate/ordered.rb +51 -19
  55. data/lib/activefacts/generate/ruby.rb +10 -8
  56. data/lib/activefacts/generate/sql/mysql.rb +14 -10
  57. data/lib/activefacts/generate/sql/server.rb +29 -24
  58. data/lib/activefacts/input/cql.rb +9 -1264
  59. data/lib/activefacts/input/orm.rb +213 -200
  60. data/lib/activefacts/persistence/columns.rb +11 -10
  61. data/lib/activefacts/persistence/index.rb +15 -18
  62. data/lib/activefacts/persistence/reference.rb +17 -17
  63. data/lib/activefacts/persistence/tables.rb +50 -51
  64. data/lib/activefacts/version.rb +1 -1
  65. data/lib/activefacts/vocabulary/extensions.rb +79 -8
  66. data/lib/activefacts/vocabulary/metamodel.rb +183 -114
  67. data/spec/absorption_ruby_spec.rb +99 -0
  68. data/spec/absorption_spec.rb +3 -4
  69. data/spec/api/constellation.rb +1 -1
  70. data/spec/api/entity_type.rb +3 -1
  71. data/spec/api/instance.rb +4 -2
  72. data/spec/api/roles.rb +8 -6
  73. data/spec/api_spec.rb +1 -2
  74. data/spec/cql/context_spec.rb +71 -0
  75. data/spec/cql/samples_spec.rb +154 -0
  76. data/spec/cql/unit_spec.rb +375 -0
  77. data/spec/cql_cql_spec.rb +31 -21
  78. data/spec/cql_mysql_spec.rb +70 -0
  79. data/spec/cql_parse_spec.rb +15 -9
  80. data/spec/cql_ruby_spec.rb +27 -13
  81. data/spec/cql_sql_spec.rb +42 -16
  82. data/spec/cql_symbol_tables_spec.rb +2 -3
  83. data/spec/cqldump_spec.rb +7 -7
  84. data/spec/helpers/file_matcher.rb +39 -0
  85. data/spec/norma_cql_spec.rb +20 -12
  86. data/spec/norma_ruby_spec.rb +6 -3
  87. data/spec/norma_sql_spec.rb +6 -3
  88. data/spec/norma_tables_spec.rb +6 -4
  89. data/spec/spec_helper.rb +27 -8
  90. data/status.html +69 -0
  91. data/why.html +60 -0
  92. metadata +34 -11
  93. data/lib/activefacts/cql/DataTypes.treetop +0 -81
  94. data/spec/cql_unit_spec.rb +0 -330
@@ -7,14 +7,36 @@ module ActiveFacts
7
7
  value_type :length => 64
8
8
  end
9
9
 
10
+ class Assimilation < String
11
+ value_type
12
+ restrict 'partitioned', 'separate'
13
+ end
14
+
10
15
  class ConstraintId < AutoCounter
11
16
  value_type
12
17
  end
13
18
 
19
+ class ContextNoteId < AutoCounter
20
+ value_type
21
+ end
22
+
23
+ class ContextNoteKind < String
24
+ value_type
25
+ restrict 'as_opposed_to', 'because', 'so_that', 'to_avoid'
26
+ end
27
+
28
+ class Date < ::Date
29
+ value_type
30
+ end
31
+
14
32
  class Denominator < UnsignedInteger
15
33
  value_type :length => 32
16
34
  end
17
35
 
36
+ class Discussion < String
37
+ value_type
38
+ end
39
+
18
40
  class Enforcement < String
19
41
  value_type :length => 16
20
42
  end
@@ -43,6 +65,10 @@ module ActiveFacts
43
65
  value_type :length => 32
44
66
  end
45
67
 
68
+ class Literal < String
69
+ value_type
70
+ end
71
+
46
72
  class Name < String
47
73
  value_type :length => 64
48
74
  end
@@ -51,17 +77,21 @@ module ActiveFacts
51
77
  value_type
52
78
  end
53
79
 
80
+ class Offset < Decimal
81
+ value_type
82
+ end
83
+
54
84
  class Ordinal < UnsignedSmallInteger
55
85
  value_type :length => 32
56
86
  end
57
87
 
58
- class Pronoun < String
88
+ class PersonName < String
59
89
  value_type
60
- # REVISIT: Pronoun has restricted values
61
90
  end
62
91
 
63
- class ReadingText < String
64
- value_type :length => 256
92
+ class Pronoun < String
93
+ value_type :length => 20
94
+ restrict 'feminine', 'masculine', 'neuter', 'personal'
65
95
  end
66
96
 
67
97
  class RingType < String
@@ -76,172 +106,215 @@ module ActiveFacts
76
106
  value_type :length => 32
77
107
  end
78
108
 
79
- class UnitId < AutoCounter
80
- value_type
81
- end
82
-
83
- class Value < String
109
+ class Text < String
84
110
  value_type :length => 256
85
111
  end
86
112
 
87
- class ValueRestrictionId < AutoCounter
113
+ class UnitId < AutoCounter
88
114
  value_type
89
115
  end
90
116
 
91
- class Bound
92
- identified_by :value, :is_inclusive
93
- maybe :is_inclusive
94
- has_one :value # See Value.all_bound
117
+ class ValueRestrictionId < AutoCounter
118
+ value_type
95
119
  end
96
120
 
97
121
  class Coefficient
98
122
  identified_by :numerator, :denominator, :is_precise
99
- has_one :denominator # See Denominator.all_coefficient
123
+ has_one :denominator, :mandatory => true # See Denominator.all_coefficient
100
124
  maybe :is_precise
101
- has_one :numerator # See Numerator.all_coefficient
125
+ has_one :numerator, :mandatory => true # See Numerator.all_coefficient
102
126
  end
103
127
 
104
128
  class Constraint
105
129
  identified_by :constraint_id
106
- one_to_one :constraint_id # See ConstraintId.constraint
130
+ one_to_one :constraint_id, :mandatory => true # See ConstraintId.constraint
107
131
  has_one :enforcement # See Enforcement.all_constraint
108
132
  has_one :name # See Name.all_constraint
109
133
  has_one :vocabulary # See Vocabulary.all_constraint
110
134
  end
111
135
 
136
+ class ContextNote
137
+ identified_by :context_note_id
138
+ has_one :concept # See Concept.all_context_note
139
+ has_one :constraint # See Constraint.all_context_note
140
+ one_to_one :context_note_id, :mandatory => true # See ContextNoteId.context_note
141
+ has_one :context_note_kind, :mandatory => true # See ContextNoteKind.all_context_note
142
+ has_one :discussion, :mandatory => true # See Discussion.all_context_note
143
+ has_one :fact_type # See FactType.all_context_note
144
+ end
145
+
112
146
  class Fact
113
147
  identified_by :fact_id
114
- one_to_one :fact_id # See FactId.fact
115
- has_one :fact_type # See FactType.all_fact
116
- has_one :population # See Population.all_fact
148
+ one_to_one :fact_id, :mandatory => true # See FactId.fact
149
+ has_one :fact_type, :mandatory => true # See FactType.all_fact
150
+ has_one :population, :mandatory => true # See Population.all_fact
117
151
  end
118
152
 
119
153
  class FactType
120
154
  identified_by :fact_type_id
121
- one_to_one :fact_type_id # See FactTypeId.fact_type
155
+ one_to_one :fact_type_id, :mandatory => true # See FactTypeId.fact_type
122
156
  end
123
157
 
124
158
  class Instance
125
159
  identified_by :instance_id
126
- has_one :concept # See Concept.all_instance
127
- one_to_one :instance_id # See InstanceId.instance
128
- has_one :population # See Population.all_instance
160
+ has_one :concept, :mandatory => true # See Concept.all_instance
161
+ one_to_one :fact # See Fact.instance
162
+ one_to_one :instance_id, :mandatory => true # See InstanceId.instance
163
+ has_one :population, :mandatory => true # See Population.all_instance
129
164
  has_one :value # See Value.all_instance
130
165
  end
131
166
 
167
+ class Person
168
+ identified_by :person_name
169
+ one_to_one :person_name, :mandatory => true # See PersonName.person
170
+ end
171
+
132
172
  class PresenceConstraint < Constraint
133
173
  maybe :is_mandatory
134
174
  maybe :is_preferred_identifier
135
- has_one :max_frequency, Frequency # See Frequency.all_presence_constraint_as_max_frequency
136
- has_one :min_frequency, Frequency # See Frequency.all_presence_constraint_as_min_frequency
137
- has_one :role_sequence # See RoleSequence.all_presence_constraint
175
+ has_one :max_frequency, :class => Frequency # See Frequency.all_presence_constraint_as_max_frequency
176
+ has_one :min_frequency, :class => Frequency # See Frequency.all_presence_constraint_as_min_frequency
177
+ has_one :role_sequence, :mandatory => true # See RoleSequence.all_presence_constraint
138
178
  end
139
179
 
140
180
  class Reading
141
181
  identified_by :fact_type, :ordinal
142
- has_one :fact_type # See FactType.all_reading
143
- has_one :ordinal # See Ordinal.all_reading
144
- has_one :reading_text # See ReadingText.all_reading
145
- has_one :role_sequence # See RoleSequence.all_reading
182
+ has_one :fact_type, :mandatory => true # See FactType.all_reading
183
+ has_one :ordinal, :mandatory => true # See Ordinal.all_reading
184
+ has_one :role_sequence, :mandatory => true # See RoleSequence.all_reading
185
+ has_one :text, :mandatory => true # See Text.all_reading
146
186
  end
147
187
 
148
188
  class RingConstraint < Constraint
149
- has_one :other_role, "Role" # See Role.all_ring_constraint_as_other_role
150
- has_one :ring_type # See RingType.all_ring_constraint
189
+ has_one :other_role, :class => "Role" # See Role.all_ring_constraint_as_other_role
190
+ has_one :ring_type, :mandatory => true # See RingType.all_ring_constraint
151
191
  has_one :role # See Role.all_ring_constraint
152
192
  end
153
193
 
194
+ class Role
195
+ identified_by :fact_type, :ordinal
196
+ has_one :fact_type, :mandatory => true # See FactType.all_role
197
+ has_one :ordinal, :mandatory => true # See Ordinal.all_role
198
+ has_one :concept, :mandatory => true # See Concept.all_role
199
+ has_one :role_name, :class => Name # See Name.all_role_as_role_name
200
+ has_one :role_value_restriction, :class => "ValueRestriction" # See ValueRestriction.all_role_as_role_value_restriction
201
+ end
202
+
154
203
  class RoleSequence
155
204
  identified_by :role_sequence_id
156
- one_to_one :role_sequence_id # See RoleSequenceId.role_sequence
205
+ one_to_one :role_sequence_id, :mandatory => true # See RoleSequenceId.role_sequence
157
206
  end
158
207
 
159
208
  class RoleValue
160
209
  identified_by :instance, :fact
161
- has_one :fact # See Fact.all_role_value
162
- has_one :instance # See Instance.all_role_value
163
- has_one :population # See Population.all_role_value
164
- has_one :role # See Role.all_role_value
210
+ has_one :fact, :mandatory => true # See Fact.all_role_value
211
+ has_one :instance, :mandatory => true # See Instance.all_role_value
212
+ has_one :population, :mandatory => true # See Population.all_role_value
213
+ has_one :role, :mandatory => true # See Role.all_role_value
165
214
  end
166
215
 
167
216
  class SetConstraint < Constraint
168
217
  end
169
218
 
170
219
  class SubsetConstraint < SetConstraint
171
- has_one :subset_role_sequence, RoleSequence # See RoleSequence.all_subset_constraint_as_subset_role_sequence
172
- has_one :superset_role_sequence, RoleSequence # See RoleSequence.all_subset_constraint_as_superset_role_sequence
220
+ has_one :subset_role_sequence, :class => RoleSequence, :mandatory => true # See RoleSequence.all_subset_constraint_as_subset_role_sequence
221
+ has_one :superset_role_sequence, :class => RoleSequence, :mandatory => true # See RoleSequence.all_subset_constraint_as_superset_role_sequence
173
222
  end
174
223
 
175
224
  class Unit
176
225
  identified_by :unit_id
177
226
  has_one :coefficient # See Coefficient.all_unit
227
+ maybe :is_ephemeral
178
228
  maybe :is_fundamental
179
- has_one :name # See Name.all_unit
180
- one_to_one :unit_id # See UnitId.unit
229
+ has_one :name, :mandatory => true # See Name.all_unit
230
+ has_one :offset # See Offset.all_unit
231
+ one_to_one :unit_id, :mandatory => true # See UnitId.unit
232
+ has_one :vocabulary, :mandatory => true # See Vocabulary.all_unit
181
233
  end
182
234
 
183
- class Derivation
184
- identified_by :derived_unit, :base_unit
185
- has_one :base_unit, Unit # See Unit.all_derivation_as_base_unit
186
- has_one :derived_unit, Unit # See Unit.all_derivation_as_derived_unit
187
- has_one :exponent # See Exponent.all_derivation
188
- end
189
-
190
- class ValueRange
191
- identified_by :minimum_bound, :maximum_bound
192
- has_one :maximum_bound, Bound # See Bound.all_value_range_as_maximum_bound
193
- has_one :minimum_bound, Bound # See Bound.all_value_range_as_minimum_bound
235
+ class Value
236
+ identified_by :literal, :is_a_string, :unit
237
+ maybe :is_a_string
238
+ has_one :literal, :mandatory => true # See Literal.all_value
239
+ has_one :unit # See Unit.all_value
194
240
  end
195
241
 
196
242
  class ValueRestriction
197
243
  identified_by :value_restriction_id
198
- one_to_one :value_restriction_id # See ValueRestrictionId.value_restriction
199
- end
200
-
201
- class AllowedRange
202
- identified_by :value_restriction, :value_range
203
- has_one :value_range # See ValueRange.all_allowed_range
204
- has_one :value_restriction # See ValueRestriction.all_allowed_range
244
+ one_to_one :value_restriction_id, :mandatory => true # See ValueRestrictionId.value_restriction
205
245
  end
206
246
 
207
247
  class Vocabulary
208
248
  identified_by :name
209
- one_to_one :name # See Name.vocabulary
249
+ one_to_one :name, :mandatory => true # See Name.vocabulary
210
250
  end
211
251
 
212
- class Import
213
- identified_by :vocabulary, :imported_vocabulary
214
- has_one :imported_vocabulary, Vocabulary # See Vocabulary.all_import_as_imported_vocabulary
215
- has_one :vocabulary # See Vocabulary.all_import
252
+ class Agreement
253
+ identified_by :context_note
254
+ one_to_one :context_note, :mandatory => true # See ContextNote.agreement
255
+ has_one :date # See Date.all_agreement
216
256
  end
217
257
 
218
- class Feature
258
+ class Bound
259
+ identified_by :value, :is_inclusive
260
+ maybe :is_inclusive
261
+ has_one :value, :mandatory => true # See Value.all_bound
262
+ end
263
+
264
+ class Concept
219
265
  identified_by :vocabulary, :name
220
- has_one :name # See Name.all_feature
221
- has_one :vocabulary # See Vocabulary.all_feature
266
+ maybe :is_independent
267
+ has_one :name, :mandatory => true # See Name.all_concept
268
+ has_one :pronoun # See Pronoun.all_concept
269
+ has_one :vocabulary, :mandatory => true # See Vocabulary.all_concept
270
+ end
271
+
272
+ class ContextAccordingTo
273
+ identified_by :context_note, :person
274
+ has_one :context_note, :mandatory => true # See ContextNote.all_context_according_to
275
+ has_one :person, :mandatory => true # See Person.all_context_according_to
276
+ end
277
+
278
+ class ContextAgreedBy
279
+ identified_by :agreement, :person
280
+ has_one :agreement, :mandatory => true # See Agreement.all_context_agreed_by
281
+ has_one :person, :mandatory => true # See Person.all_context_agreed_by
282
+ end
283
+
284
+ class Derivation
285
+ identified_by :derived_unit, :base_unit
286
+ has_one :base_unit, :class => Unit, :mandatory => true # See Unit.all_derivation_as_base_unit
287
+ has_one :derived_unit, :class => Unit, :mandatory => true # See Unit.all_derivation_as_derived_unit
288
+ has_one :exponent # See Exponent.all_derivation
222
289
  end
223
290
 
224
- class Correspondence
225
- identified_by :import, :imported_feature
226
- has_one :import # See Import.all_correspondence
227
- has_one :imported_feature, Feature # See Feature.all_correspondence_as_imported_feature
228
- has_one :local_feature, Feature # See Feature.all_correspondence_as_local_feature
291
+ class EntityType < Concept
292
+ one_to_one :fact_type # See FactType.entity_type
229
293
  end
230
294
 
231
295
  class Population
232
296
  identified_by :vocabulary, :name
233
- has_one :name # See Name.all_population
297
+ has_one :name, :mandatory => true # See Name.all_population
234
298
  has_one :vocabulary # See Vocabulary.all_population
235
299
  end
236
300
 
301
+ class RoleRef
302
+ identified_by :role_sequence, :ordinal
303
+ has_one :ordinal, :mandatory => true # See Ordinal.all_role_ref
304
+ has_one :role, :mandatory => true # See Role.all_role_ref
305
+ has_one :role_sequence, :mandatory => true # See RoleSequence.all_role_ref
306
+ has_one :leading_adjective, :class => Adjective # See Adjective.all_role_ref_as_leading_adjective
307
+ has_one :trailing_adjective, :class => Adjective # See Adjective.all_role_ref_as_trailing_adjective
308
+ end
309
+
237
310
  class SetComparisonConstraint < SetConstraint
238
311
  end
239
312
 
240
313
  class SetComparisonRoles
241
314
  identified_by :set_comparison_constraint, :ordinal
242
- has_one :ordinal # See Ordinal.all_set_comparison_roles
243
- has_one :role_sequence # See RoleSequence.all_set_comparison_roles
244
- has_one :set_comparison_constraint # See SetComparisonConstraint.all_set_comparison_roles
315
+ has_one :ordinal, :mandatory => true # See Ordinal.all_set_comparison_roles
316
+ has_one :role_sequence, :mandatory => true # See RoleSequence.all_set_comparison_roles
317
+ has_one :set_comparison_constraint, :mandatory => true # See SetComparisonConstraint.all_set_comparison_roles
245
318
  end
246
319
 
247
320
  class SetEqualityConstraint < SetComparisonConstraint
@@ -251,58 +324,54 @@ module ActiveFacts
251
324
  maybe :is_mandatory
252
325
  end
253
326
 
254
- class Alias < Feature
327
+ class TypeInheritance < FactType
328
+ identified_by :subtype, :supertype
329
+ has_one :subtype, :class => EntityType, :mandatory => true # See EntityType.all_type_inheritance_as_subtype
330
+ has_one :supertype, :class => EntityType, :mandatory => true # See EntityType.all_type_inheritance_as_supertype
331
+ has_one :assimilation # See Assimilation.all_type_inheritance
332
+ maybe :provides_identification
255
333
  end
256
334
 
257
- class Concept < Feature
258
- maybe :is_independent
259
- has_one :pronoun # See Pronoun.all_concept
335
+ class ValueRange
336
+ identified_by :minimum_bound, :maximum_bound
337
+ has_one :maximum_bound, :class => Bound # See Bound.all_value_range_as_maximum_bound
338
+ has_one :minimum_bound, :class => Bound # See Bound.all_value_range_as_minimum_bound
260
339
  end
261
340
 
262
- class Role
263
- identified_by :fact_type, :ordinal, :concept
264
- has_one :concept # See Concept.all_role
265
- has_one :fact_type # See FactType.all_role
266
- has_one :ordinal # See Ordinal.all_role
267
- has_one :role_name, Name # See Name.all_role_as_role_name
268
- has_one :role_value_restriction, ValueRestriction # See ValueRestriction.all_role_as_role_value_restriction
341
+ class ValueType < Concept
342
+ has_one :length # See Length.all_value_type
343
+ has_one :scale # See Scale.all_value_type
344
+ has_one :supertype, :class => ValueType # See ValueType.all_value_type_as_supertype
345
+ has_one :unit # See Unit.all_value_type
346
+ has_one :value_restriction # See ValueRestriction.all_value_type
269
347
  end
270
348
 
271
- class RoleRef
272
- identified_by :role_sequence, :ordinal
273
- has_one :ordinal # See Ordinal.all_role_ref
274
- has_one :role # See Role.all_role_ref
275
- has_one :role_sequence # See RoleSequence.all_role_ref
276
- has_one :leading_adjective, Adjective # See Adjective.all_role_ref_as_leading_adjective
277
- has_one :trailing_adjective, Adjective # See Adjective.all_role_ref_as_trailing_adjective
349
+ class AllowedRange
350
+ identified_by :value_restriction, :value_range
351
+ has_one :value_range, :mandatory => true # See ValueRange.all_allowed_range
352
+ has_one :value_restriction, :mandatory => true # See ValueRestriction.all_allowed_range
278
353
  end
279
354
 
280
355
  class Join
281
356
  identified_by :role_ref, :join_step
282
- has_one :join_step, Ordinal # See Ordinal.all_join_as_join_step
283
- has_one :role_ref # See RoleRef.all_join
357
+ has_one :join_step, :class => Ordinal, :mandatory => true # See Ordinal.all_join_as_join_step
358
+ has_one :role_ref, :mandatory => true # See RoleRef.all_join
284
359
  has_one :concept # See Concept.all_join
285
- has_one :input_role, Role # See Role.all_join_as_input_role
286
- has_one :output_role, Role # See Role.all_join_as_output_role
360
+ has_one :input_role, :class => Role # See Role.all_join_as_input_role
361
+ has_one :output_role, :class => Role # See Role.all_join_as_output_role
287
362
  end
288
363
 
289
- class EntityType < Concept
290
- one_to_one :fact_type # See FactType.entity_type
364
+ class Parameter
365
+ identified_by :name, :value_type
366
+ has_one :name, :mandatory => true # See Name.all_parameter
367
+ has_one :value_type, :mandatory => true # See ValueType.all_parameter
291
368
  end
292
369
 
293
- class TypeInheritance < FactType
294
- identified_by :subtype, :supertype
295
- has_one :subtype, EntityType # See EntityType.all_type_inheritance_as_subtype
296
- has_one :supertype, EntityType # See EntityType.all_type_inheritance_as_supertype
297
- maybe :provides_identification
298
- end
299
-
300
- class ValueType < Concept
301
- has_one :length # See Length.all_value_type
302
- has_one :scale # See Scale.all_value_type
303
- has_one :supertype, ValueType # See ValueType.all_value_type_as_supertype
304
- has_one :unit # See Unit.all_value_type
305
- has_one :value_restriction # See ValueRestriction.all_value_type
370
+ class ParamValue
371
+ identified_by :value, :parameter
372
+ has_one :parameter, :mandatory => true # See Parameter.all_param_value
373
+ has_one :value, :mandatory => true # See Value.all_param_value
374
+ has_one :value_type, :mandatory => true # See ValueType.all_param_value
306
375
  end
307
376
 
308
377
  end