activefacts-metamodel 1.9.20 → 1.9.22
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/cql/Metamodel.cql +25 -23
- data/images/Absorption.png +0 -0
- data/images/Components.png +0 -0
- data/images/Compositions.png +0 -0
- data/images/Concepts.png +0 -0
- data/images/Nesting.png +0 -0
- data/images/Queries.png +0 -0
- data/images/Transformations.png +0 -0
- data/images/ValueTypes.png +0 -0
- data/lib/activefacts/metamodel/datatypes.rb +32 -22
- data/lib/activefacts/metamodel/extensions.rb +181 -130
- data/lib/activefacts/metamodel/metamodel.rb +115 -93
- data/lib/activefacts/metamodel/validate/composition.rb +9 -10
- data/lib/activefacts/metamodel/version.rb +1 -1
- data/lib/activefacts/support.rb +6 -1
- data/orm/Metamodel.cql.diffs +22 -22
- data/orm/Metamodel.orm +4954 -4577
- metadata +3 -3
- data/images/Transforms.png +0 -0
@@ -6,6 +6,7 @@ module ActiveFacts
|
|
6
6
|
identified_by :guid
|
7
7
|
one_to_one :guid, mandatory: true # Component has Guid, see Guid#component
|
8
8
|
maybe :has_absolute_name # Has Absolute Name
|
9
|
+
has_one :injection_annotation, class: "Annotation" # Component has injection-Annotation, see Annotation#all_component_as_injection_annotation
|
9
10
|
has_one :name # Component projects Name, see Name#all_component
|
10
11
|
has_one :ordinal # Component has Ordinal rank, see Ordinal#all_component
|
11
12
|
has_one :parent, class: Component, counterpart: :member # Member belongs to Parent, see Component#all_member
|
@@ -13,77 +14,34 @@ module ActiveFacts
|
|
13
14
|
|
14
15
|
class Mapping < Component
|
15
16
|
has_one :object_type, mandatory: true # Mapping represents Object Type, see ObjectType#all_mapping
|
17
|
+
one_to_one :full_absorption # Mapping creates Full Absorption, see FullAbsorption#mapping
|
16
18
|
has_one :native_type_name, class: "Name" # Mapping uses native- type Name, see Name#all_mapping_as_native_type_name
|
19
|
+
one_to_one :reverse_mapping, class: Mapping, counterpart: :forward_mapping # forward-Mapping is matched by reverse-Mapping, see Mapping#forward_mapping
|
17
20
|
end
|
18
21
|
|
19
|
-
class
|
20
|
-
|
21
|
-
one_to_one :guid, mandatory: true # Access Path has Guid, see Guid#access_path
|
22
|
-
has_one :composite, mandatory: true # Access Path is to Composite, see Composite#all_access_path
|
23
|
-
has_one :name # Access Path is called Name, see Name#all_access_path
|
24
|
-
end
|
25
|
-
|
26
|
-
class Name < String
|
27
|
-
value_type length: 64
|
22
|
+
class NestingMode < String
|
23
|
+
value_type
|
28
24
|
end
|
29
25
|
|
30
|
-
class
|
31
|
-
|
32
|
-
one_to_one :name, mandatory: true # Composite Group has Name, see Name#composite_group
|
26
|
+
class Description < String
|
27
|
+
value_type
|
33
28
|
end
|
34
29
|
|
35
30
|
class Guid < ::Guid
|
36
31
|
value_type
|
37
32
|
end
|
38
33
|
|
39
|
-
class
|
40
|
-
|
41
|
-
one_to_one :guid, mandatory: true # Composition has Guid, see Guid#composition
|
42
|
-
has_one :compositor_name, mandatory: true, class: Name # Composition is by compositor-Name, see Name#all_composition_as_compositor_name
|
43
|
-
one_to_one :name, mandatory: true # Composition is called Name, see Name#composition
|
44
|
-
end
|
45
|
-
|
46
|
-
class Constraint
|
47
|
-
identified_by :concept
|
48
|
-
one_to_one :concept, mandatory: true # Constraint is an instance of Concept, see Concept#constraint
|
49
|
-
has_one :name # Constraint is called Name, see Name#all_constraint
|
50
|
-
has_one :vocabulary # Constraint belongs to Vocabulary, see Vocabulary#all_constraint
|
51
|
-
end
|
52
|
-
|
53
|
-
class Frequency < UnsignedInteger
|
54
|
-
value_type length: 32
|
55
|
-
end
|
56
|
-
|
57
|
-
class RoleSequence
|
58
|
-
identified_by :guid
|
59
|
-
one_to_one :guid, mandatory: true # Role Sequence has Guid, see Guid#role_sequence
|
60
|
-
maybe :has_unused_dependency_to_force_table_in_norma # Has Unused Dependency To Force Table In Norma
|
61
|
-
end
|
62
|
-
|
63
|
-
class PresenceConstraint < Constraint
|
64
|
-
maybe :is_mandatory # Is Mandatory
|
65
|
-
maybe :is_preferred_identifier # Is Preferred Identifier
|
66
|
-
has_one :role_sequence, mandatory: true # Presence Constraint covers Role Sequence, see RoleSequence#all_presence_constraint
|
67
|
-
has_one :max_frequency, class: Frequency # Presence Constraint has max-Frequency, see Frequency#all_presence_constraint_as_max_frequency
|
68
|
-
has_one :min_frequency, class: Frequency # Presence Constraint has min-Frequency, see Frequency#all_presence_constraint_as_min_frequency
|
69
|
-
end
|
70
|
-
|
71
|
-
class Index < AccessPath
|
72
|
-
maybe :is_unique # Is Unique
|
73
|
-
has_one :presence_constraint, mandatory: true # Index derives from Presence Constraint, see PresenceConstraint#all_index
|
34
|
+
class ImplicationRuleName < String
|
35
|
+
value_type
|
74
36
|
end
|
75
37
|
|
76
|
-
class
|
77
|
-
identified_by :
|
78
|
-
one_to_one :
|
79
|
-
has_one :composition, mandatory: true # Composite belongs to Composition, see Composition#all_composite
|
80
|
-
has_one :composite_group # Composite belongs to Composite Group, see CompositeGroup#all_composite
|
81
|
-
one_to_one :natural_index, class: Index # Composite has natural-Index, see Index#composite_as_natural_index
|
82
|
-
one_to_one :primary_index, class: Index # Composite has primary-Index, see Index#composite_as_primary_index
|
38
|
+
class ImplicationRule
|
39
|
+
identified_by :implication_rule_name
|
40
|
+
one_to_one :implication_rule_name, mandatory: true # Implication Rule has Implication Rule Name, see ImplicationRuleName#implication_rule
|
83
41
|
end
|
84
42
|
|
85
|
-
class
|
86
|
-
|
43
|
+
class Name < String
|
44
|
+
value_type length: 64
|
87
45
|
end
|
88
46
|
|
89
47
|
class Pronoun < String
|
@@ -105,36 +63,15 @@ module ActiveFacts
|
|
105
63
|
identified_by :vocabulary, :name
|
106
64
|
has_one :vocabulary, mandatory: true # Object Type belongs to Vocabulary, see Vocabulary#all_object_type
|
107
65
|
has_one :name, mandatory: true # Object Type is called Name, see Name#all_object_type
|
66
|
+
one_to_one :concept, mandatory: true # Object Type is an instance of Concept, see Concept#object_type
|
108
67
|
has_one :pronoun # Object Type uses Pronoun, see Pronoun#all_object_type
|
109
68
|
end
|
110
69
|
|
111
|
-
class FullAbsorption
|
112
|
-
identified_by :composition, :object_type
|
113
|
-
has_one :composition, mandatory: true # Full Absorption involves Composition, see Composition#all_full_absorption
|
114
|
-
has_one :object_type, mandatory: true # Full Absorption involves Object Type, see ObjectType#all_full_absorption
|
115
|
-
end
|
116
|
-
|
117
|
-
class NestingMode < String
|
118
|
-
value_type
|
119
|
-
end
|
120
|
-
|
121
|
-
class Description < String
|
122
|
-
value_type
|
123
|
-
end
|
124
|
-
|
125
|
-
class ImplicationRuleName < String
|
126
|
-
value_type
|
127
|
-
end
|
128
|
-
|
129
|
-
class ImplicationRule
|
130
|
-
identified_by :implication_rule_name
|
131
|
-
one_to_one :implication_rule_name, mandatory: true # Implication Rule has Implication Rule Name, see ImplicationRuleName#implication_rule
|
132
|
-
end
|
133
|
-
|
134
70
|
class Population
|
135
71
|
identified_by :vocabulary, :name
|
136
72
|
has_one :vocabulary # Population belongs to Vocabulary, see Vocabulary#all_population
|
137
73
|
has_one :name, mandatory: true # Population has Name, see Name#all_population
|
74
|
+
one_to_one :concept, mandatory: true # Population is an instance of Concept, see Concept#population
|
138
75
|
end
|
139
76
|
|
140
77
|
class Topic
|
@@ -165,12 +102,20 @@ module ActiveFacts
|
|
165
102
|
end
|
166
103
|
|
167
104
|
class LinkFactType < FactType
|
105
|
+
one_to_one :implying_role, mandatory: true, class: "Role" # Link Fact Type has implying-Role, see Role#link_fact_type_as_implying_role
|
168
106
|
end
|
169
107
|
|
170
108
|
class Ordinal < UnsignedInteger
|
171
109
|
value_type length: 16
|
172
110
|
end
|
173
111
|
|
112
|
+
class Constraint
|
113
|
+
identified_by :concept
|
114
|
+
one_to_one :concept, mandatory: true # Constraint is an instance of Concept, see Concept#constraint
|
115
|
+
has_one :name # Constraint is called Name, see Name#all_constraint
|
116
|
+
has_one :vocabulary # Constraint belongs to Vocabulary, see Vocabulary#all_constraint
|
117
|
+
end
|
118
|
+
|
174
119
|
class RegularExpression < String
|
175
120
|
value_type
|
176
121
|
end
|
@@ -286,6 +231,7 @@ module ActiveFacts
|
|
286
231
|
identified_by :fact_type, :ordinal
|
287
232
|
has_one :fact_type, mandatory: true # Role belongs to Fact Type, see FactType#all_role
|
288
233
|
has_one :ordinal, mandatory: true # Role fills Ordinal, see Ordinal#all_role
|
234
|
+
one_to_one :concept, mandatory: true # Role is an instance of Concept, see Concept#role
|
289
235
|
has_one :object_type, mandatory: true # Role is played by Object Type, see ObjectType#all_role
|
290
236
|
one_to_one :link_fact_type, counterpart: :implying_role # implying-Role implies Link Fact Type, see LinkFactType#implying_role
|
291
237
|
has_one :role_name, class: Name # Role has role-Name, see Name#all_role_as_role_name
|
@@ -297,10 +243,35 @@ module ActiveFacts
|
|
297
243
|
maybe :flattens # Flattens
|
298
244
|
has_one :child_role, mandatory: true, class: Role # Absorption traverses to child-Role, see Role#all_absorption_as_child_role
|
299
245
|
has_one :parent_role, mandatory: true, class: Role # Absorption traverses from parent-Role, see Role#all_absorption_as_parent_role
|
300
|
-
one_to_one :foreign_key # Absorption gives rise to Foreign Key, see ForeignKey#absorption
|
301
|
-
one_to_one :full_absorption # Absorption creates Full Absorption, see FullAbsorption#absorption
|
302
246
|
has_one :nesting_mode # Absorption uses Nesting Mode, see NestingMode#all_absorption
|
303
|
-
|
247
|
+
end
|
248
|
+
|
249
|
+
class CompositeGroup
|
250
|
+
identified_by :name
|
251
|
+
one_to_one :name, mandatory: true # Composite Group has Name, see Name#composite_group
|
252
|
+
end
|
253
|
+
|
254
|
+
class Composition
|
255
|
+
identified_by :guid
|
256
|
+
one_to_one :guid, mandatory: true # Composition has Guid, see Guid#composition
|
257
|
+
has_one :compositor_name, mandatory: true, class: Name # Composition is by compositor-Name, see Name#all_composition_as_compositor_name
|
258
|
+
one_to_one :name, mandatory: true # Composition is called Name, see Name#composition
|
259
|
+
end
|
260
|
+
|
261
|
+
class Composite
|
262
|
+
identified_by :mapping
|
263
|
+
one_to_one :mapping, mandatory: true # Composite consists of Mapping, see Mapping#composite
|
264
|
+
has_one :composition, mandatory: true # Composite belongs to Composition, see Composition#all_composite
|
265
|
+
has_one :composite_group # Composite belongs to Composite Group, see CompositeGroup#all_composite
|
266
|
+
one_to_one :natural_index, class: "Index" # Composite has natural-Index, see Index#composite_as_natural_index
|
267
|
+
one_to_one :primary_index, class: "Index" # Composite has primary-Index, see Index#composite_as_primary_index
|
268
|
+
end
|
269
|
+
|
270
|
+
class AccessPath
|
271
|
+
identified_by :guid
|
272
|
+
one_to_one :guid, mandatory: true # Access Path has Guid, see Guid#access_path
|
273
|
+
has_one :composite, mandatory: true # Access Path is to Composite, see Composite#all_access_path
|
274
|
+
has_one :name # Access Path is called Name, see Name#all_access_path
|
304
275
|
end
|
305
276
|
|
306
277
|
class Adjective < String
|
@@ -380,6 +351,21 @@ module ActiveFacts
|
|
380
351
|
value_type
|
381
352
|
end
|
382
353
|
|
354
|
+
class Injection < Component
|
355
|
+
end
|
356
|
+
|
357
|
+
class ComputedValue < Injection
|
358
|
+
end
|
359
|
+
|
360
|
+
class HashValue < ComputedValue
|
361
|
+
end
|
362
|
+
|
363
|
+
class ComponentHash
|
364
|
+
identified_by :hash_value, :component
|
365
|
+
has_one :hash_value, mandatory: true # Component Hash involves Hash Value, see HashValue#all_component_hash
|
366
|
+
has_one :component, mandatory: true # Component Hash involves Component, see Component#all_component_hash
|
367
|
+
end
|
368
|
+
|
383
369
|
class Shape
|
384
370
|
identified_by :guid
|
385
371
|
one_to_one :guid, mandatory: true # Shape has Guid, see Guid#shape
|
@@ -528,6 +514,13 @@ module ActiveFacts
|
|
528
514
|
end
|
529
515
|
|
530
516
|
class ObjectifiedFactTypeNameShape < Shape
|
517
|
+
one_to_one :fact_type_shape, mandatory: true # Objectified Fact Type Name Shape is for Fact Type Shape, see FactTypeShape#objectified_fact_type_name_shape
|
518
|
+
end
|
519
|
+
|
520
|
+
class RoleSequence
|
521
|
+
identified_by :guid
|
522
|
+
one_to_one :guid, mandatory: true # Role Sequence has Guid, see Guid#role_sequence
|
523
|
+
maybe :has_unused_dependency_to_force_table_in_norma # Has Unused Dependency To Force Table In Norma
|
531
524
|
end
|
532
525
|
|
533
526
|
class Text < String
|
@@ -544,6 +537,7 @@ module ActiveFacts
|
|
544
537
|
end
|
545
538
|
|
546
539
|
class ReadingShape < Shape
|
540
|
+
one_to_one :fact_type_shape, mandatory: true # Reading Shape is for Fact Type Shape, see FactTypeShape#reading_shape
|
547
541
|
has_one :reading, mandatory: true # Reading Shape is for Reading, see Reading#all_reading_shape
|
548
542
|
end
|
549
543
|
|
@@ -559,6 +553,11 @@ module ActiveFacts
|
|
559
553
|
has_one :rotation_setting # Fact Type Shape has Rotation Setting, see RotationSetting#all_fact_type_shape
|
560
554
|
end
|
561
555
|
|
556
|
+
class ForeignKey < AccessPath
|
557
|
+
has_one :source_composite, mandatory: true, class: Composite # Foreign Key traverses from source-Composite, see Composite#all_foreign_key_as_source_composite
|
558
|
+
one_to_one :mapping # Foreign Key derives from Mapping, see Mapping#foreign_key
|
559
|
+
end
|
560
|
+
|
562
561
|
class ForeignKeyField
|
563
562
|
identified_by :foreign_key, :ordinal
|
564
563
|
has_one :foreign_key, mandatory: true # Foreign Key Field involves Foreign Key, see ForeignKey#all_foreign_key_field
|
@@ -567,6 +566,17 @@ module ActiveFacts
|
|
567
566
|
has_one :value # Foreign Key Field is discriminated by Value, see Value#all_foreign_key_field
|
568
567
|
end
|
569
568
|
|
569
|
+
class Frequency < UnsignedInteger
|
570
|
+
value_type length: 32
|
571
|
+
end
|
572
|
+
|
573
|
+
class FullAbsorption
|
574
|
+
identified_by :composition, :object_type
|
575
|
+
has_one :composition, mandatory: true # Full Absorption involves Composition, see Composition#all_full_absorption
|
576
|
+
has_one :object_type, mandatory: true # Full Absorption involves Object Type, see ObjectType#all_full_absorption
|
577
|
+
one_to_one :mapping, mandatory: true # Full Absorption applies to Mapping, see Mapping#full_absorption
|
578
|
+
end
|
579
|
+
|
570
580
|
class VersionPattern < String
|
571
581
|
value_type length: 64
|
572
582
|
end
|
@@ -580,6 +590,19 @@ module ActiveFacts
|
|
580
590
|
has_one :version_pattern # Import has Version Pattern, see VersionPattern#all_import
|
581
591
|
end
|
582
592
|
|
593
|
+
class PresenceConstraint < Constraint
|
594
|
+
maybe :is_mandatory # Is Mandatory
|
595
|
+
maybe :is_preferred_identifier # Is Preferred Identifier
|
596
|
+
has_one :role_sequence, mandatory: true # Presence Constraint covers Role Sequence, see RoleSequence#all_presence_constraint
|
597
|
+
has_one :max_frequency, class: Frequency # Presence Constraint has max-Frequency, see Frequency#all_presence_constraint_as_max_frequency
|
598
|
+
has_one :min_frequency, class: Frequency # Presence Constraint has min-Frequency, see Frequency#all_presence_constraint_as_min_frequency
|
599
|
+
end
|
600
|
+
|
601
|
+
class Index < AccessPath
|
602
|
+
maybe :is_unique # Is Unique
|
603
|
+
has_one :presence_constraint # Index derives from Presence Constraint, see PresenceConstraint#all_index
|
604
|
+
end
|
605
|
+
|
583
606
|
class IndexField
|
584
607
|
identified_by :access_path, :ordinal
|
585
608
|
has_one :access_path, mandatory: true # Index Field involves Access Path, see AccessPath#all_index_field
|
@@ -594,9 +617,6 @@ module ActiveFacts
|
|
594
617
|
has_one :true_value, class: Value # Indicator uses true-Value, see Value#all_indicator_as_true_value
|
595
618
|
end
|
596
619
|
|
597
|
-
class Injection < Mapping
|
598
|
-
end
|
599
|
-
|
600
620
|
class LeafConstraint
|
601
621
|
identified_by :component, :leaf_constraint
|
602
622
|
has_one :component, mandatory: true # Leaf Constraint involves Component, see Component#all_leaf_constraint
|
@@ -665,6 +685,10 @@ module ActiveFacts
|
|
665
685
|
one_to_one :role_ref # Play projects Role Ref, see RoleRef#play
|
666
686
|
end
|
667
687
|
|
688
|
+
class RestrictionStyle < String
|
689
|
+
value_type
|
690
|
+
end
|
691
|
+
|
668
692
|
class RingType < String
|
669
693
|
value_type
|
670
694
|
end
|
@@ -680,6 +704,7 @@ module ActiveFacts
|
|
680
704
|
end
|
681
705
|
|
682
706
|
class RoleNameShape < Shape
|
707
|
+
one_to_one :role_display, mandatory: true # Role Name Shape is for Role Display, see RoleDisplay#role_name_shape
|
683
708
|
end
|
684
709
|
|
685
710
|
class ValueConstraintShape < ConstraintShape
|
@@ -744,10 +769,6 @@ module ActiveFacts
|
|
744
769
|
class SurrogateKey < Injection
|
745
770
|
end
|
746
771
|
|
747
|
-
class TemporalMapping < Mapping
|
748
|
-
has_one :value_type, mandatory: true # Temporal Mapping records time using Value Type, see ValueType#all_temporal_mapping
|
749
|
-
end
|
750
|
-
|
751
772
|
class TransformTargetRef
|
752
773
|
identified_by :transform_matching, :ordinal
|
753
774
|
has_one :transform_matching, mandatory: true # Transform Target Ref involves Transform Matching, see TransformMatching#all_transform_target_ref
|
@@ -765,10 +786,10 @@ module ActiveFacts
|
|
765
786
|
has_one :assimilation # Type Inheritance uses Assimilation, see Assimilation#all_type_inheritance
|
766
787
|
end
|
767
788
|
|
768
|
-
class ValidFrom <
|
789
|
+
class ValidFrom < Mapping
|
769
790
|
end
|
770
791
|
|
771
|
-
class ValueField <
|
792
|
+
class ValueField < Mapping
|
772
793
|
end
|
773
794
|
|
774
795
|
class ValueTypeParameter
|
@@ -776,13 +797,14 @@ module ActiveFacts
|
|
776
797
|
has_one :value_type, mandatory: true # Value Type Parameter involves Value Type, see ValueType#all_value_type_parameter
|
777
798
|
has_one :name, mandatory: true # Value Type Parameter involves Name, see Name#all_value_type_parameter
|
778
799
|
has_one :parameter_value_type, mandatory: true, class: ValueType # Value Type Parameter requires value of parameter-Value Type, see ValueType#all_value_type_parameter_as_parameter_value_type
|
800
|
+
has_one :restriction_style # Value Type Parameter has Restriction Style, see RestrictionStyle#all_value_type_parameter
|
779
801
|
end
|
780
802
|
|
781
803
|
class ValueTypeParameterRestriction
|
782
|
-
identified_by :value_type, :value_type_parameter
|
804
|
+
identified_by :value_type, :value_type_parameter, :value_range
|
783
805
|
has_one :value_type, mandatory: true # Value Type Parameter Restriction involves Value Type, see ValueType#all_value_type_parameter_restriction
|
784
806
|
has_one :value_type_parameter, mandatory: true # Value Type Parameter Restriction involves Value Type Parameter, see ValueTypeParameter#all_value_type_parameter_restriction
|
785
|
-
has_one :
|
807
|
+
has_one :value_range, mandatory: true # Value Type Parameter Restriction involves Value Range, see ValueRange#all_value_type_parameter_restriction
|
786
808
|
end
|
787
809
|
end
|
788
810
|
end
|
@@ -45,8 +45,11 @@ module ActiveFacts
|
|
45
45
|
all_access_path.each do |access_path|
|
46
46
|
report.call(access_path, "Must contain at least one IndexField") unless access_path.all_index_field.size > 0
|
47
47
|
access_path.all_index_field.each do |index_field|
|
48
|
-
report.call(access_path, "#{index_field.inspect} must be an Indicator or played by a ValueType") unless index_field.component.is_a?(
|
49
|
-
report.call(access_path, "#{index_field.inspect} must
|
48
|
+
report.call(access_path, "#{index_field.inspect} must be an Indicator or played by a ValueType") unless !index_field.component.is_a?(Mapping) || index_field.component.object_type.is_a?(ValueType)
|
49
|
+
report.call(access_path, "#{index_field.inspect} must have a component") unless index_field.component
|
50
|
+
if index_field.component
|
51
|
+
report.call(access_path, "#{index_field.inspect} must be within its composite") unless index_field.component.root == self
|
52
|
+
end
|
50
53
|
end
|
51
54
|
if ForeignKey === access_path
|
52
55
|
if access_path.all_index_field.size == access_path.all_foreign_key_field.size
|
@@ -88,7 +91,6 @@ module ActiveFacts
|
|
88
91
|
report.call(member, "Object type #{member.object_type.name} should play the child role #{c.name}") unless member.object_type == c.object_type
|
89
92
|
report.call(member, "Parent mapping object type #{object_type.name} should play the parent role #{p.name}") unless object_type == p.object_type
|
90
93
|
|
91
|
-
member.validate_reverse &report
|
92
94
|
member.validate_nesting &report if member.all_nesting.size > 0
|
93
95
|
member.validate_members &report
|
94
96
|
|
@@ -104,11 +106,8 @@ module ActiveFacts
|
|
104
106
|
when ValidFrom
|
105
107
|
# Nothing to check here
|
106
108
|
|
107
|
-
when Injection
|
108
|
-
report.call(member, "REVISIT: Unexpected and unchecked Injection")
|
109
|
-
|
110
109
|
when Mapping
|
111
|
-
|
110
|
+
member.validate_reverse &report
|
112
111
|
|
113
112
|
when Indicator
|
114
113
|
report.call(member, "Indicator requires a Role") unless member.role
|
@@ -123,16 +122,16 @@ module ActiveFacts
|
|
123
122
|
end
|
124
123
|
end
|
125
124
|
end
|
126
|
-
end
|
127
125
|
|
128
|
-
class Absorption
|
129
126
|
def validate_reverse &report
|
130
|
-
reverse =
|
127
|
+
reverse = forward_mapping || reverse_mapping
|
131
128
|
return unless reverse
|
132
129
|
report.call(self, "Opposite absorption's child role #{reverse.child_role.name} should match parent role #{parent_role.name}") unless reverse.child_role == parent_role
|
133
130
|
report.call(self, "Opposite absorption's parent role #{reverse.parent_role.name} should match child role #{child_role.name}") unless reverse.parent_role == child_role
|
134
131
|
end
|
132
|
+
end
|
135
133
|
|
134
|
+
class Absorption
|
136
135
|
def validate_nesting &report
|
137
136
|
report.call(self, "REVISIT: Unexpected and unchecked Nesting")
|
138
137
|
report.call(self, "Nesting Mode must be specified") unless self.nesting_mode
|
data/lib/activefacts/support.rb
CHANGED
@@ -125,7 +125,7 @@ class String
|
|
125
125
|
end
|
126
126
|
|
127
127
|
def +(words)
|
128
|
-
Words.new(
|
128
|
+
Words.new(super)
|
129
129
|
end
|
130
130
|
end
|
131
131
|
|
@@ -146,5 +146,10 @@ class String
|
|
146
146
|
map{|w| w =~ /^[^_[:alpha:]]/ ? '_'+w : w}
|
147
147
|
)
|
148
148
|
end
|
149
|
+
|
150
|
+
def unindent
|
151
|
+
indent = self.split("\n").select {|line| !line.strip.empty? }.map {|line| line.index(/[^\s]/) }.compact.min || 0
|
152
|
+
self.gsub(/^[[:blank:]]{#{indent}}/, '')
|
153
|
+
end
|
149
154
|
end
|
150
155
|
|
data/orm/Metamodel.cql.diffs
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
*** Metamodel.orm.cql.orig 2017-
|
2
|
-
--- Metamodel.orm.cql 2017-
|
1
|
+
*** Metamodel.orm.cql.orig 2017-12-20 10:07:22.000000000 +1100
|
2
|
+
--- Metamodel.orm.cql 2017-12-20 10:08:11.000000000 +1100
|
3
3
|
***************
|
4
4
|
*** 20,22 ****
|
5
5
|
Frequency is written as Unsigned Integer(32);
|
@@ -10,50 +10,50 @@
|
|
10
10
|
! Guid is written as Guid auto-assigned at assert;
|
11
11
|
Implication Rule Name is written as String;
|
12
12
|
***************
|
13
|
-
***
|
13
|
+
*** 551,554 ****
|
14
14
|
|
15
15
|
- Data Type is a kind of Object Type;
|
16
16
|
-
|
17
17
|
Domain Object Type is a kind of Object Type;
|
18
|
-
---
|
18
|
+
--- 551,552 ----
|
19
19
|
***************
|
20
|
-
***
|
21
|
-
either Access Path is an Index or Access Path is a Foreign Key but not both;
|
22
|
-
! either Component(1) belongs to Component(2) or Component(1) is a Mapping that projects Composite but not both;
|
20
|
+
*** 608,610 ****
|
23
21
|
for each Component exactly one of these holds:
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
! Component is a Mapping that projects Composite,
|
23
|
+
Component is an Indicator,
|
24
|
+
--- 606,608 ----
|
27
25
|
for each Component exactly one of these holds:
|
26
|
+
! Component is a Mapping,
|
27
|
+
Component is an Indicator,
|
28
28
|
***************
|
29
|
-
***
|
29
|
+
*** 653,657 ****
|
30
30
|
either Value Constraint constrains Value Type or Value Constraint applies to Role but not both;
|
31
31
|
- for each Mapping at most one of these holds:
|
32
32
|
- Mapping(1) is an Absorption(2) and Absorption(1) flattens,
|
33
33
|
- Mapping projects Composite;
|
34
34
|
for each Instance at most one of these holds:
|
35
|
-
---
|
35
|
+
--- 651,652 ----
|
36
36
|
***************
|
37
|
-
***
|
38
|
-
---
|
37
|
+
*** 659,660 ****
|
38
|
+
--- 654,658 ----
|
39
39
|
Instance objectifies Fact;
|
40
40
|
+ for each Mapping at most one of these holds:
|
41
41
|
+ Mapping is an Absorption that flattens,
|
42
42
|
+ Mapping projects Composite;
|
43
43
|
Absorption is nested under index Role in Ordinal position
|
44
44
|
***************
|
45
|
-
***
|
45
|
+
*** 662,669 ****
|
46
46
|
Absorption uses Nesting Mode;
|
47
|
-
- Object Type is involved in Full Absorption that applies to
|
47
|
+
- Object Type is involved in Full Absorption that applies to Mapping
|
48
48
|
- if and only if
|
49
|
-
- Mapping
|
49
|
+
- Mapping represents Object Type;
|
50
50
|
- Query projects derived Fact Type that contains Role
|
51
51
|
- if and only if
|
52
52
|
- Query includes Variable that projects Role;
|
53
53
|
Role Value is of Instance that is of Object Type
|
54
|
-
---
|
54
|
+
--- 660,661 ----
|
55
55
|
***************
|
56
|
-
***
|
56
|
+
*** 680,691 ****
|
57
57
|
Variable is restricted by Role of Step;
|
58
58
|
Composite has primary Index
|
59
59
|
! only if Composite is reached through Access Path;
|
@@ -66,7 +66,7 @@
|
|
66
66
|
- Absorption is a kind of Mapping(2) and Absorption traverses to child Role that is played by Object Type
|
67
67
|
- only if Mapping(1) represents Object Type;
|
68
68
|
Presence Constraint is preferred identifier
|
69
|
-
---
|
69
|
+
--- 672,681 ----
|
70
70
|
Variable is restricted by Role of Step;
|
71
71
|
+ Absorption traverses from parent Parent Role(1) that is played by Object Type
|
72
72
|
+ only if Absorption is a kind of Component(2) and Component(3) belongs to Component(2) that is a Mapping that represents Object Type;
|
@@ -78,8 +78,8 @@
|
|
78
78
|
only if Index is unique;
|
79
79
|
Presence Constraint is preferred identifier
|
80
80
|
***************
|
81
|
-
***
|
81
|
+
*** 699,701 ****
|
82
82
|
either Agreement was reached by Agent or Agreement was on Date;
|
83
83
|
- either Component projects Name or Absorption flattens;
|
84
84
|
each Concept occurs at most one time in
|
85
|
-
---
|
85
|
+
--- 689,690 ----
|