activefacts-metamodel 1.9.12 → 1.9.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 41e1740c184bc1058a20c1b62b3b31e3f362c6ce
4
- data.tar.gz: 97bb44048eb3405c00ee4ae1ae37d7fc20b46161
3
+ metadata.gz: 2b9d48b959018dfa2c058b3f7ff8c6f72de85be7
4
+ data.tar.gz: 261ec3a4ff051b8ca6792699856d5b01e04c4fed
5
5
  SHA512:
6
- metadata.gz: e06b4410d9591a1c8c25c9fc34fb7cf8939ab306271e1c1371bd5930104de29dd6ab8d5470a60403eaa67729132cb515e9a7b09b143cb41a20d660d045b8466a
7
- data.tar.gz: 5f0a7e7593622ff32edf0a8b14aa28a8a99ecdb850fb64a9e1027499c1acf1cef0ad6a24857799d0bc32f7f2609b64e60643bde8d9a61414b2014870a75857cf
6
+ metadata.gz: 5f72c7417352823a629b4bc78d1490b12f49569909be18197aa8466f09ec4aeebaa09884309c257f7a94aac3c26a70b463d9b0170f42e61ab1903468224c4b17
7
+ data.tar.gz: d19e84520214f2cadfb9787c7339119679ba8a0800e06a895d2b1d57dfb83bb65342ba2ab2b8f19cbaea05cfd9cb8d69491d90c33bc16578ce218b97d327fb9c
data/Gemfile CHANGED
@@ -5,9 +5,9 @@ gemspec
5
5
  this_file = File.absolute_path(__FILE__)
6
6
  if this_file =~ %r{\A#{ENV['HOME']}}i
7
7
  dir = File.dirname(File.dirname(this_file))
8
- $stderr.puts "Using work area gems in #{dir} from activefacts-metamodel"
9
- gem 'activefacts-cql', path: dir+'/cql'
10
- gem 'activefacts-compositions', path: dir+'/compositions'
8
+ $stderr.puts "Using work area gems in #{dir}"
11
9
  gem 'activefacts-api', path: dir+'/api'
10
+ gem 'activefacts-cql', path: dir+'/cql'
12
11
  gem 'activefacts-orm', path: dir+'/orm'
12
+ gem 'activefacts-compositions', path: dir+'/compositions'
13
13
  end
data/Rakefile CHANGED
@@ -24,19 +24,27 @@ task :bump do
24
24
  end
25
25
 
26
26
  desc "Generate new CQL from the ORM file (to verify version similarity)"
27
- task :cql do
27
+ task :validation do
28
28
  # Note: Import from ORM is broken on the implicit derivations in constraints, and the result is unstable.
29
29
  # This means that SOME PATCHES WILL FAIL
30
- system "afgen --cql orm/Metamodel.orm > Metamodel.cql"
30
+ system "bundle exec afgen --cql orm/Metamodel.orm > Metamodel.orm.cql"
31
31
  system "patch < orm/Metamodel.cql.diffs"
32
- system "afgen --cql cql/Metamodel.cql 2>/dev/null >Metamodel.old.cql"
33
- system "diff -b -C 1 Metamodel.old.cql Metamodel.cql | tee Metamodel.cql.diffs"
32
+ system "bundle exec afgen --cql cql/Metamodel.cql 2>Metamodel.cql.errors >Metamodel.cql.cql"
33
+ system "diff -b -C 1 Metamodel.cql.cql Metamodel.orm.cql | tee Metamodel.cql.diffs"
34
+ end
35
+
36
+ # This patch exists because there are some features of the CQL that we
37
+ # can't represent in the ORM, and some features in the ORM that we don't
38
+ # want to represent in the CQL.
39
+ desc "When you're satisfied that the CQL-generated ORM is close enough, make a new patch"
40
+ task :remake_orm_patch do
41
+ system "diff -C1 Metamodel.orm.cql.orig Metamodel.orm.cql > orm/Metamodel.cql.diffs"
34
42
  end
35
43
 
36
44
  desc "Generate new Ruby from the CQL file"
37
45
  task :ruby do
38
46
  system %q{
39
- schema_compositor --binary --ruby=scope=ActiveFacts cql/Metamodel.cql > metamodel.rb &&
47
+ bundle exec schema_compositor --binary --ruby=scope=ActiveFacts cql/Metamodel.cql > metamodel.rb &&
40
48
  diff -ub lib/activefacts/metamodel/metamodel.rb metamodel.rb
41
49
  }
42
50
  end
@@ -25,7 +25,9 @@ This gem provides the core representations for the Fact Modeling tools of Active
25
25
  spec.add_development_dependency "rspec", "~> 3.3"
26
26
 
27
27
  spec.add_development_dependency "activefacts-compositions", ">= 1.9.6" # Needed for schema_compositor to emit Ruby from CQL
28
- spec.add_development_dependency "activefacts", "~> 1", ">= 1.8" # Needed to emit CQL from ORM (and check it from CQL)
28
+ spec.add_development_dependency "activefacts-orm", ">= 1.9.0" # Needed to load the ORM file during validation
29
+ spec.add_development_dependency "activefacts-cql", "~> 1", ">= 1.9"
30
+ spec.add_development_dependency "activefacts", "~> 1", ">= 1.8"
29
31
 
30
32
  spec.add_runtime_dependency "activefacts-api", "~> 1", ">= 1.9.5"
31
33
  end
@@ -34,6 +34,8 @@ Scale is written as Unsigned Integer(32);
34
34
  Subscript is written as Unsigned Integer(16);
35
35
  Text is written as String(256);
36
36
  Transaction Phase is written as String restricted to {'assert', 'commit'};
37
+ Version Number is written as String(32);
38
+ Version Pattern is written as String(64);
37
39
  X is written as Signed Integer(32);
38
40
  Y is written as Signed Integer(32);
39
41
 
@@ -161,9 +163,10 @@ Instance plays Role Value,
161
163
 
162
164
  Set Constraint is a kind of Constraint;
163
165
 
164
- Step is identified by Guid where
165
- Step has one Guid,
166
- Guid is of at most one Step;
166
+ Step is identified by Query and Ordinal where
167
+ Query includes at least one Step,
168
+ Step is in one Query,
169
+ Step has one Ordinal position;
167
170
  Step falls under at most one Alternative Set,
168
171
  Alternative Set covers at least one Step;
169
172
  Step specifies one Fact Type,
@@ -181,6 +184,12 @@ Topic is identified by topic-Name where
181
184
  Concept belongs to at most one Topic,
182
185
  Topic contains Concept;
183
186
 
187
+ Import is where
188
+ Topic imports precursor- Topic;
189
+ Import has at most one role-Name (as Import Role);
190
+ Import has at most one file-Name;
191
+ Import has at most one Version Pattern;
192
+
184
193
  Unit is identified by Concept where
185
194
  Unit is an instance of one Concept;
186
195
  Ephemera URL provides Unit coefficient,
@@ -223,6 +232,8 @@ Variable has at most one role-Name,
223
232
 
224
233
  Vocabulary is identified by Name where
225
234
  Vocabulary is called one Name;
235
+ Vocabulary is transform;
236
+ Vocabulary has at most one Version Number;
226
237
  Vocabulary contains Constraint,
227
238
  Constraint belongs to at most one Vocabulary;
228
239
  Vocabulary includes Unit,
@@ -358,12 +369,15 @@ Value Type Parameter Restriction is where
358
369
  Value Type Parameter applies to Value Type;
359
370
  Value Type Parameter Restriction has one Value;
360
371
 
361
- /* Compositions */
372
+ /*
373
+ * Compositions
374
+ */
362
375
  Composition is identified by Guid where
363
376
  Composition has one Guid,
364
377
  Guid is of at most one Composition;
365
378
  Composition is called one Name,
366
379
  Name is of at most one Composition;
380
+ Composition is by one compositor- Name;
367
381
 
368
382
  Component is identified by Guid where
369
383
  Component has one Guid,
@@ -394,6 +408,9 @@ Composite is identified by Mapping where
394
408
  Composition contains Composite,
395
409
  Composite belongs to one Composition;
396
410
 
411
+ each Composite Group is identified by Name;
412
+ Composite belongs to at most one Composite Group;
413
+
397
414
  Temporal Mapping is a kind of Mapping;
398
415
  Temporal Mapping records time using one Value Type;
399
416
 
@@ -404,10 +421,9 @@ forward-Absorption is matched by at most one reverse-Absorption,
404
421
  reverse-Absorption is reverse of at most one forward-Absorption;
405
422
  Absorption flattens;
406
423
 
407
- /*
408
424
  some Absorption traverses from some parent- Role(1) and that Role(1) is played by some Object Type
409
425
  only if that Absorption is a kind of Component(2) that contains some Component(3) that is a Mapping that represents that Object Type;
410
- */
426
+
411
427
  some Absorption traverses to some child- Role(1) and that Role(1) is played by some Object Type
412
428
  only if that Absorption is a kind of Mapping that represents that Object Type;
413
429
 
@@ -431,7 +447,7 @@ Leaf Constraint is where
431
447
  Local Constraint is where
432
448
  Composite contains local-Constraint,
433
449
  local-Constraint connects leaves of Composite;
434
-
450
+
435
451
  Spanning Constraint is where
436
452
  Composite has spanning-Constraint,
437
453
  Constraint spans Composite;
@@ -461,6 +477,7 @@ Composite has at most one primary-Index,
461
477
  Index is primary for at most one Composite;
462
478
  Index is primary for Composite
463
479
  only if Index is unique;
480
+
464
481
  Composite has primary Index
465
482
  only if Composite is reached through Access Path that is an Index;
466
483
 
@@ -497,6 +514,61 @@ Absorption is nested under index Role in Ordinal position
497
514
  if and only if
498
515
  that Absorption uses some Nesting Mode;
499
516
 
517
+ /*
518
+ * Transformations
519
+ */
520
+ each Expression Type is written as String restricted to {'Literal', 'Role', 'Unary', 'Binary', 'Ternary'};
521
+ each Literal String is written as String;
522
+ each Operator is written as String restricted to {
523
+ 'and', 'or', 'not',
524
+ '=', '!=', 'count', 'max', 'min', 'total', 'avg', '<', '<=', '=>', '>',
525
+ '?', '+', '-', '*', '/', '0-', '1/'
526
+ };
527
+
528
+ each Expression is identified by Guid where
529
+ Expression has one Guid,
530
+ Guid is of at most one Expression;
531
+
532
+ Expression has one Expression Type;
533
+ Expression has at most one Literal String;
534
+ Expression has at most one Operator;
535
+ Expression has at most one first- operand Expression;
536
+ Expression has at most one second- operand Expression;
537
+ Expression has at most one third- operand Expression;
538
+
539
+ Expression Object Ref is where
540
+ Expression in Ordinal position maps to one Object Type,
541
+ Object Type is in Expression in one Ordinal position;
542
+
543
+ Expression Object Ref has at most one leading- Adjective;
544
+ Expression Object Ref has at most one trailing- Adjective;
545
+
546
+ each Transform Matching is identified by Guid where
547
+ Transform Matching has one Guid,
548
+ Guid is of at most one Transform Matching;
549
+
550
+ Transform Target Ref is where
551
+ Transform Matching in Ordinal position maps to one Object Type,
552
+ Object Type is in Transform Matching in one Ordinal position;
553
+
554
+ Transform Target Ref has at most one leading- Adjective;
555
+ Transform Target Ref has at most one trailing- Adjective;
556
+
557
+ each Simple Matching is a kind of Transform Matching;
558
+ Simple Matching maps from at most one Expression;
559
+
560
+ each Compound Matching is a kind of Transform Matching;
561
+ Compound Matching maps from at most one source- Object Type;
562
+ Compound Matching maps from at most one source- Query;
563
+
564
+ Compound Matching consists of Transform Matching,
565
+ Transform Matching is part of at most one Compound Matching;
566
+
567
+ each Transform Rule is independent identified by Concept where
568
+ Transform Rule is an instance of one Concept;
569
+ Transform Rule implements at most one Compound Matching,
570
+ Compound Matching is implemented by at most one Transform Rule;
571
+
500
572
  /*
501
573
  * Diagrams
502
574
  */
@@ -582,7 +654,9 @@ either Value Constraint Shape is for Object Type Shape or Value Constraint Shape
582
654
  /*
583
655
  * Constraints:
584
656
  */
657
+
585
658
  either Component(1) belongs to Component(2) or Component(1) is a Mapping that projects some Composite but not both;
659
+
586
660
  for each Component exactly one of these holds:
587
661
  Component is a Mapping,
588
662
  Component is an Indicator,
Binary file
@@ -81,6 +81,7 @@ module ActiveFacts
81
81
  when context_note; "ContextNote#{context_note.verbalise}"
82
82
  when unit; "Unit #{unit.describe}"
83
83
  when population; "Population: #{population.name}"
84
+ when transform_rule; "Transform Rule: #{transform_rule.describe}"
84
85
  else
85
86
  raise "ROGUE CONCEPT OF NO TYPE"
86
87
  end
@@ -98,6 +99,7 @@ module ActiveFacts
98
99
  when context_note; context_note
99
100
  when unit; unit
100
101
  when population; population
102
+ when transform_rule; transform_rule
101
103
  else
102
104
  raise "ROGUE CONCEPT OF NO TYPE"
103
105
  end
@@ -858,8 +860,7 @@ module ActiveFacts
858
860
  l_adj = "#{role_ref.leading_adjective}".sub(/(\b-\b|.\b|.\Z)/, '\1-').sub(/\b--\b/,'-- ').sub(/- /,'- ')
859
861
  l_adj = nil if l_adj == ""
860
862
  # Double the space to compensate for space removed below
861
- # REVISIT: hyphenated trailing adjectives are not correctly represented here
862
- t_adj = "#{role_ref.trailing_adjective}".sub(/(\b.|\A.)/, '-\1').sub(/ -/,' -')
863
+ t_adj = "#{role_ref.trailing_adjective}".sub(/\w+$/,' -\0').sub(/--\w*$/, ' \0')
863
864
  t_adj = nil if t_adj == ""
864
865
 
865
866
  expanded.gsub!(/\{#{i}\}/) do
@@ -1236,10 +1237,6 @@ module ActiveFacts
1236
1237
  end
1237
1238
  end
1238
1239
 
1239
- def all_step
1240
- all_variable.map{|var| var.all_step.to_a}.flatten.uniq
1241
- end
1242
-
1243
1240
  # Check all parts of this query for validity
1244
1241
  def validate
1245
1242
  show
@@ -2140,8 +2137,47 @@ module ActiveFacts
2140
2137
  end
2141
2138
 
2142
2139
  def comment
2143
- return 'surrogate key' unless parent
2144
- ((c = parent.comment) != '' ? c : parent.name + ' surrogate key')
2140
+ if parent && (c = parent.comment) != ''
2141
+ return c
2142
+ end
2143
+ if fkf = all_foreign_key_field.single
2144
+ return fkf.foreign_key.composite.mapping.name + ' surrogate key'
2145
+ end
2146
+ (parent ? parent.name + ' ' : '') + 'surrogate key'
2147
+ end
2148
+ end
2149
+
2150
+ #
2151
+ # Transform Rules
2152
+ #
2153
+
2154
+ class TransformRule
2155
+ def describe
2156
+ compound_matching.describe
2157
+ end
2158
+ end
2159
+
2160
+ class CompoundMatching
2161
+ def describe
2162
+ targ = all_transform_target_ref.map do |tr|
2163
+ (tr.leading_adjective ? tr.leading_adjective + ' ' : '') +
2164
+ tr.object_type.name + (tr.trailing_adjective ? ' ' + tr.trailing_adjective : '')
2165
+ end * ' . '
2166
+ src = (sot = source_object_type) ? sot.name : 'Query'
2167
+
2168
+ "#{targ} <== #{src} {" + all_transform_matching.map{|tm| tm.describe}.sort * ', ' + '}'
2169
+ end
2170
+ end
2171
+
2172
+ class SimpleMatching
2173
+ def describe
2174
+ targ = all_transform_target_ref.map do |tr|
2175
+ (tr.leading_adjective ? tr.leading_adjective + ' ' : '') +
2176
+ tr.object_type.name + (tr.trailing_adjective ? ' ' + tr.trailing_adjective : '')
2177
+ end * ' . '
2178
+ src = expression ? ((et = expression.expression_type) ? et : 'Expr') : ''
2179
+
2180
+ "#{targ} <-- #{src}"
2145
2181
  end
2146
2182
  end
2147
2183
 
@@ -23,17 +23,23 @@ module ActiveFacts
23
23
  has_one :name # Access Path is called Name, see Name#all_access_path
24
24
  end
25
25
 
26
- class Guid < ::Guid
27
- value_type
28
- end
29
-
30
26
  class Name < String
31
27
  value_type length: 64
32
28
  end
33
29
 
30
+ class CompositeGroup
31
+ identified_by :name
32
+ one_to_one :name, mandatory: true # Composite Group has Name, see Name#composite_group
33
+ end
34
+
35
+ class Guid < ::Guid
36
+ value_type
37
+ end
38
+
34
39
  class Composition
35
40
  identified_by :guid
36
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
37
43
  one_to_one :name, mandatory: true # Composition is called Name, see Name#composition
38
44
  end
39
45
 
@@ -71,6 +77,7 @@ module ActiveFacts
71
77
  identified_by :mapping
72
78
  one_to_one :mapping, mandatory: true # Composite consists of Mapping, see Mapping#composite
73
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
74
81
  one_to_one :natural_index, class: Index # Composite has natural-Index, see Index#composite_as_natural_index
75
82
  one_to_one :primary_index, class: Index # Composite has primary-Index, see Index#composite_as_primary_index
76
83
  end
@@ -83,9 +90,15 @@ module ActiveFacts
83
90
  value_type length: 20
84
91
  end
85
92
 
93
+ class VersionNumber < String
94
+ value_type length: 32
95
+ end
96
+
86
97
  class Vocabulary
87
98
  identified_by :name
88
99
  one_to_one :name, mandatory: true # Vocabulary is called Name, see Name#vocabulary
100
+ maybe :is_transform # Is Transform
101
+ has_one :version_number # Vocabulary has Version Number, see VersionNumber#all_vocabulary
89
102
  end
90
103
 
91
104
  class ObjectType
@@ -140,9 +153,15 @@ module ActiveFacts
140
153
  has_one :topic # Concept belongs to Topic, see Topic#all_concept
141
154
  end
142
155
 
156
+ class Query
157
+ identified_by :concept
158
+ one_to_one :concept, mandatory: true # Query is an instance of Concept, see Concept#query
159
+ end
160
+
143
161
  class FactType
144
162
  identified_by :concept
145
163
  one_to_one :concept, mandatory: true # Fact Type is an instance of Concept, see Concept#fact_type
164
+ one_to_one :query, counterpart: :derived_fact_type # derived-Fact Type is projected from Query, see Query#derived_fact_type
146
165
  end
147
166
 
148
167
  class LinkFactType < FactType
@@ -220,12 +239,6 @@ module ActiveFacts
220
239
  one_to_one :value_type # Value Constraint constrains Value Type, see ValueType#value_constraint
221
240
  end
222
241
 
223
- class Query
224
- identified_by :concept
225
- one_to_one :concept, mandatory: true # Query is an instance of Concept, see Concept#query
226
- has_one :derived_fact_type, class: FactType # Query projects Derived Fact Type, see FactType#all_query_as_derived_fact_type
227
- end
228
-
229
242
  class AlternativeSet
230
243
  identified_by :guid
231
244
  one_to_one :guid, mandatory: true # Alternative Set has Guid, see Guid#alternative_set
@@ -233,8 +246,9 @@ module ActiveFacts
233
246
  end
234
247
 
235
248
  class Step
236
- identified_by :guid
237
- one_to_one :guid, mandatory: true # Step has Guid, see Guid#step
249
+ identified_by :query, :ordinal
250
+ has_one :query, mandatory: true # Step is in Query, see Query#all_step
251
+ has_one :ordinal, mandatory: true # Step has Ordinal position, see Ordinal#all_step
238
252
  maybe :is_disallowed # Is Disallowed
239
253
  maybe :is_optional # Is Optional
240
254
  has_one :fact_type, mandatory: true # Step specifies Fact Type, see FactType#all_step
@@ -378,6 +392,23 @@ module ActiveFacts
378
392
  has_one :parent_component_shape, class: ComponentShape # Component Shape is contained in parent-Component Shape, see ComponentShape#all_component_shape_as_parent_component_shape
379
393
  end
380
394
 
395
+ class TransformMatching
396
+ identified_by :guid
397
+ one_to_one :guid, mandatory: true # Transform Matching has Guid, see Guid#transform_matching
398
+ has_one :compound_matching # Transform Matching is part of Compound Matching, see CompoundMatching#all_transform_matching
399
+ end
400
+
401
+ class TransformRule
402
+ identified_by :concept
403
+ one_to_one :concept, mandatory: true # Transform Rule is an instance of Concept, see Concept#transform_rule
404
+ end
405
+
406
+ class CompoundMatching < TransformMatching
407
+ has_one :source_object_type, class: ObjectType # Compound Matching maps from source-Object Type, see ObjectType#all_compound_matching_as_source_object_type
408
+ has_one :source_query, class: Query # Compound Matching maps from source-Query, see Query#all_compound_matching_as_source_query
409
+ one_to_one :transform_rule # Compound Matching is implemented by Transform Rule, see TransformRule#compound_matching
410
+ end
411
+
381
412
  class ConceptAnnotation
382
413
  identified_by :concept, :mapping_annotation
383
414
  has_one :concept, mandatory: true # Concept Annotation involves Concept, see Concept#all_concept_annotation
@@ -448,6 +479,38 @@ module ActiveFacts
448
479
  has_one :implicitly_objectified_fact_type, class: FactType # Entity Type implicitly objectifies implicitly- objectified Fact Type, see FactType#all_entity_type_as_implicitly_objectified_fact_type
449
480
  end
450
481
 
482
+ class ExpressionType < String
483
+ value_type
484
+ end
485
+
486
+ class LiteralString < String
487
+ value_type
488
+ end
489
+
490
+ class Operator < String
491
+ value_type
492
+ end
493
+
494
+ class Expression
495
+ identified_by :guid
496
+ one_to_one :guid, mandatory: true # Expression has Guid, see Guid#expression
497
+ has_one :expression_type, mandatory: true # Expression has Expression Type, see ExpressionType#all_expression
498
+ has_one :first_operand_expression, class: Expression # Expression has first- operand Expression, see Expression#all_expression_as_first_operand_expression
499
+ has_one :literal_string # Expression has Literal String, see LiteralString#all_expression
500
+ has_one :operator # Expression has Operator, see Operator#all_expression
501
+ has_one :second_operand_expression, class: Expression # Expression has second- operand Expression, see Expression#all_expression_as_second_operand_expression
502
+ has_one :third_operand_expression, class: Expression # Expression has third- operand Expression, see Expression#all_expression_as_third_operand_expression
503
+ end
504
+
505
+ class ExpressionObjectRef
506
+ identified_by :expression, :ordinal
507
+ has_one :expression, mandatory: true # Expression Object Ref involves Expression, see Expression#all_expression_object_ref
508
+ has_one :ordinal, mandatory: true # Expression Object Ref involves Ordinal, see Ordinal#all_expression_object_ref
509
+ has_one :object_type, mandatory: true # Expression Object Ref involves Object Type, see ObjectType#all_expression_object_ref
510
+ has_one :leading_adjective, class: Adjective # Expression Object Ref has leading-Adjective, see Adjective#all_expression_object_ref_as_leading_adjective
511
+ has_one :trailing_adjective, class: Adjective # Expression Object Ref has trailing-Adjective, see Adjective#all_expression_object_ref_as_trailing_adjective
512
+ end
513
+
451
514
  class Instance
452
515
  identified_by :concept
453
516
  one_to_one :concept, mandatory: true # Instance is an instance of Concept, see Concept#instance
@@ -504,6 +567,19 @@ module ActiveFacts
504
567
  has_one :value # Foreign Key Field is discriminated by Value, see Value#all_foreign_key_field
505
568
  end
506
569
 
570
+ class VersionPattern < String
571
+ value_type length: 64
572
+ end
573
+
574
+ class Import
575
+ identified_by :topic, :precursor_topic
576
+ has_one :topic, mandatory: true # Import involves Topic, see Topic#all_import
577
+ has_one :precursor_topic, mandatory: true, class: Topic # Import involves precursor-Topic, see Topic#all_import_as_precursor_topic
578
+ has_one :file_name, class: Name # Import has file-Name, see Name#all_import_as_file_name
579
+ has_one :import_role, class: Name # Import has Import Role, see Name#all_import_as_import_role
580
+ has_one :version_pattern # Import has Version Pattern, see VersionPattern#all_import
581
+ end
582
+
507
583
  class IndexField
508
584
  identified_by :access_path, :ordinal
509
585
  has_one :access_path, mandatory: true # Index Field involves Access Path, see AccessPath#all_index_field
@@ -650,6 +726,10 @@ module ActiveFacts
650
726
  maybe :is_mandatory # Is Mandatory
651
727
  end
652
728
 
729
+ class SimpleMatching < TransformMatching
730
+ has_one :expression # Simple Matching maps from Expression, see Expression#all_simple_matching
731
+ end
732
+
653
733
  class SpanningConstraint
654
734
  identified_by :composite, :spanning_constraint
655
735
  has_one :composite, mandatory: true # Spanning Constraint involves Composite, see Composite#all_spanning_constraint
@@ -668,6 +748,15 @@ module ActiveFacts
668
748
  has_one :value_type, mandatory: true # Temporal Mapping records time using Value Type, see ValueType#all_temporal_mapping
669
749
  end
670
750
 
751
+ class TransformTargetRef
752
+ identified_by :transform_matching, :ordinal
753
+ has_one :transform_matching, mandatory: true # Transform Target Ref involves Transform Matching, see TransformMatching#all_transform_target_ref
754
+ has_one :ordinal, mandatory: true # Transform Target Ref involves Ordinal, see Ordinal#all_transform_target_ref
755
+ has_one :object_type, mandatory: true # Transform Target Ref involves Object Type, see ObjectType#all_transform_target_ref
756
+ has_one :leading_adjective, class: Adjective # Transform Target Ref has leading-Adjective, see Adjective#all_transform_target_ref_as_leading_adjective
757
+ has_one :trailing_adjective, class: Adjective # Transform Target Ref has trailing-Adjective, see Adjective#all_transform_target_ref_as_trailing_adjective
758
+ end
759
+
671
760
  class TypeInheritance < FactType
672
761
  identified_by :subtype, :supertype
673
762
  has_one :subtype, mandatory: true, class: EntityType # Type Inheritance involves Subtype, see EntityType#all_type_inheritance_as_subtype