activefacts-examples 1.8.0 → 1.9.8
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.
- checksums.yaml +4 -4
- data/Gemfile +10 -8
- data/activefacts-examples.gemspec +5 -4
- data/cql/Health.cql +1 -1
- data/cql/Insurance.cql +1 -1
- data/cql/Metamodel.cql +8 -0
- data/cql/PartyModel.cql +1 -0
- data/cql/Supervision.cql +3 -0
- data/diagrams/json/Metamodel.json +34 -4
- data/diagrams/json/SeparateSubtype.json +1 -1
- data/diagrams/json/Supervision.json +3 -1
- data/images/Supervision.png +0 -0
- data/metadata/json/Metamodel.json +511 -436
- data/metadata/json/OilSupply.json +53 -53
- data/metadata/json/Supervision.json +15 -1
- data/orm/Diplomacy.orm +16 -16
- data/orm/ExampleModels2010.csproj +8 -0
- data/orm/Health.orm +22 -22
- data/orm/Insurance.orm +1532 -1532
- data/orm/Metamodel.orm +5825 -3573
- data/orm/OilSupply.orm +29 -29
- data/orm/RedundantDependency.orm +248 -119
- data/orm/SeparateSubtype.orm +6 -6
- data/orm/Supervision.orm +355 -123
- data/rails/models/CinemaBookings.models +2 -2
- data/rails/models/CinemaTickets.models +2 -2
- data/rails/models/Metamodel.models +8 -8
- data/rails/schema/Metamodel.schema.rb +5 -2
- data/ruby/Metamodel.rb +11 -0
- data/ruby/Supervision.rb +6 -0
- data/sql/server/CinemaBookings.sql +3 -3
- data/sql/server/CinemaTickets.sql +3 -3
- data/sql/server/Genealogy.sql +1 -1
- data/sql/server/Insurance.sql +4 -4
- data/sql/server/Metamodel.sql +14 -8
- data/sql/server/OilSupply.sql +1 -1
- data/sql/server/Supervision.sql +19 -0
- metadata +31 -11
@@ -73,7 +73,7 @@ module Concernz
|
|
73
73
|
# Seat is in Row and Row is in Cinema
|
74
74
|
belongs_to :cinema_via_row, :class_name => 'Cinema', :foreign_key => :row_cinema_id
|
75
75
|
|
76
|
-
# Seat is involved in Seat Allocation
|
76
|
+
# allocated-Seat is involved in Seat Allocation
|
77
77
|
has_many :seat_allocations, :class_name => 'SeatAllocation', :foreign_key => :allocated_seat_id, :dependent => :destroy
|
78
78
|
has_many :bookings, :through => :seat_allocations
|
79
79
|
|
@@ -91,7 +91,7 @@ module Concernz
|
|
91
91
|
# Seat Allocation involves Booking
|
92
92
|
belongs_to :booking, :foreign_key => :booking_id
|
93
93
|
|
94
|
-
# Seat Allocation involves Seat
|
94
|
+
# Seat Allocation involves allocated-Seat
|
95
95
|
belongs_to :allocated_seat, :class_name => 'Seat', :foreign_key => :allocated_seat_id
|
96
96
|
|
97
97
|
validates :booking_id, :presence => true
|
@@ -116,7 +116,7 @@ module Concernz
|
|
116
116
|
# Seat is in Row and Row is in Cinema
|
117
117
|
belongs_to :cinema_via_row, :class_name => 'Cinema', :foreign_key => :row_cinema_id
|
118
118
|
|
119
|
-
# Seat is involved in Seat Allocation
|
119
|
+
# allocated-Seat is involved in Seat Allocation
|
120
120
|
has_many :seat_allocations, :class_name => 'SeatAllocation', :foreign_key => :allocated_seat_id, :dependent => :destroy
|
121
121
|
has_many :bookings, :through => :seat_allocations
|
122
122
|
|
@@ -134,7 +134,7 @@ module Concernz
|
|
134
134
|
# Seat Allocation involves Booking
|
135
135
|
belongs_to :booking, :foreign_key => :booking_id
|
136
136
|
|
137
|
-
# Seat Allocation involves Seat
|
137
|
+
# Seat Allocation involves allocated-Seat
|
138
138
|
belongs_to :allocated_seat, :class_name => 'Seat', :foreign_key => :allocated_seat_id
|
139
139
|
|
140
140
|
validates :booking_id, :presence => true
|
@@ -5,7 +5,7 @@ module Concernz
|
|
5
5
|
included do
|
6
6
|
self.primary_key = 'aggregation_id'
|
7
7
|
|
8
|
-
# Aggregation involves Variable
|
8
|
+
# Aggregation involves aggregated-Variable
|
9
9
|
belongs_to :aggregated_variable, :class_name => 'Variable', :foreign_key => :aggregated_variable_id
|
10
10
|
|
11
11
|
# Aggregation involves Variable
|
@@ -151,7 +151,7 @@ module Concernz
|
|
151
151
|
# Context Note is an instance of Concept and Context Note was added by Agreement and Agreement is involved in Context Agreed By
|
152
152
|
has_many :context_agreed_bies_via_agreement_context_note, :class_name => 'ContextAgreedBy', :foreign_key => :agreement_context_note_concept_guid, :dependent => :destroy
|
153
153
|
|
154
|
-
# Unit is an instance of Concept and Unit is involved in Derivation
|
154
|
+
# Unit is an instance of Concept and base-Unit is involved in Derivation
|
155
155
|
has_many :derivations_via_unit, :class_name => 'Derivation', :foreign_key => :base_unit_concept_guid, :dependent => :destroy
|
156
156
|
|
157
157
|
# Unit is an instance of Concept and Unit is involved in Derivation
|
@@ -285,7 +285,7 @@ module Concernz
|
|
285
285
|
included do
|
286
286
|
self.primary_key = 'derivation_id'
|
287
287
|
|
288
|
-
# Derivation involves Unit and Unit is an instance of Concept
|
288
|
+
# Derivation involves base-Unit and Unit is an instance of Concept
|
289
289
|
belongs_to :concept_via_unit, :class_name => 'Concept', :foreign_key => :base_unit_concept_guid
|
290
290
|
|
291
291
|
# Derivation involves Unit and Unit is an instance of Concept
|
@@ -349,7 +349,7 @@ module Concernz
|
|
349
349
|
# maybe Fact Type is a Type Inheritance and Type Inheritance involves Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type
|
350
350
|
belongs_to :object_type_via_type_inheritance_entity_type_domain_object_type, :class_name => 'ObjectType', :foreign_key => :type_inheritance_subtype_object_type_id
|
351
351
|
|
352
|
-
# maybe Fact Type is a Type Inheritance and Type Inheritance involves Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type
|
352
|
+
# maybe Fact Type is a Type Inheritance and Type Inheritance involves super-Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type
|
353
353
|
belongs_to :object_type_via_type_inheritance_entity_type_domain_object_type, :class_name => 'ObjectType', :foreign_key => :type_inheritance_supertype_object_type_id
|
354
354
|
|
355
355
|
# Fact is of Fact Type and maybe Fact is an instance of Concept
|
@@ -384,7 +384,7 @@ module Concernz
|
|
384
384
|
# Nesting involves Absorption and Absorption is a kind of Mapping and Mapping is a kind of Component
|
385
385
|
belongs_to :component_via_absorption_mapping, :class_name => 'Component', :foreign_key => :absorption_guid
|
386
386
|
|
387
|
-
# Nesting involves Role
|
387
|
+
# Nesting involves index-Role
|
388
388
|
belongs_to :index_role, :class_name => 'Role', :foreign_key => :index_role_id
|
389
389
|
|
390
390
|
validates :absorption_guid, :presence => true
|
@@ -425,7 +425,7 @@ module Concernz
|
|
425
425
|
has_many :fact_types_via_type_inheritance_entity_type_domain_object_type, :class_name => 'FactType', :foreign_key => :type_inheritance_subtype_object_type_id, :dependent => :destroy
|
426
426
|
has_many :entity_types, :through => :fact_types_via_type_inheritance_entity_type_domain_object_type
|
427
427
|
|
428
|
-
# Object Type is a Domain Object Type and Domain Object Type is an Entity Type and Entity Type is involved in Type Inheritance and maybe Type Inheritance is a kind of Fact Type
|
428
|
+
# Object Type is a Domain Object Type and Domain Object Type is an Entity Type and super-Entity Type is involved in Type Inheritance and maybe Type Inheritance is a kind of Fact Type
|
429
429
|
has_many :fact_types_via_type_inheritance_entity_type_domain_object_type, :class_name => 'FactType', :foreign_key => :type_inheritance_supertype_object_type_id, :dependent => :destroy
|
430
430
|
has_many :entity_types, :through => :fact_types_via_type_inheritance_entity_type_domain_object_type
|
431
431
|
|
@@ -574,7 +574,7 @@ module Concernz
|
|
574
574
|
# Role is involved in Discriminated Role
|
575
575
|
has_many :discriminated_roles, :class_name => 'DiscriminatedRole', :foreign_key => :role_id, :dependent => :destroy
|
576
576
|
|
577
|
-
# Role is involved in Nesting
|
577
|
+
# index-Role is involved in Nesting
|
578
578
|
has_many :nestings, :class_name => 'Nesting', :foreign_key => :index_role_id, :dependent => :destroy
|
579
579
|
|
580
580
|
# Role is involved in Play
|
@@ -908,7 +908,7 @@ module Concernz
|
|
908
908
|
# maybe Variable is bound to Value
|
909
909
|
belongs_to :value, :foreign_key => :value_id
|
910
910
|
|
911
|
-
# Variable is involved in Aggregation
|
911
|
+
# aggregated-Variable is involved in Aggregation
|
912
912
|
has_many :aggregations, :class_name => 'Aggregation', :foreign_key => :aggregated_variable_id, :dependent => :destroy
|
913
913
|
|
914
914
|
# Variable is involved in Aggregation
|
@@ -1,9 +1,9 @@
|
|
1
1
|
#
|
2
|
-
# schema.rb auto-generated using ActiveFacts for Metamodel on
|
2
|
+
# schema.rb auto-generated using ActiveFacts for Metamodel on 2016-03-22
|
3
3
|
#
|
4
4
|
|
5
5
|
ActiveRecord::Base.logger = Logger.new(STDOUT)
|
6
|
-
ActiveRecord::Schema.define(:version =>
|
6
|
+
ActiveRecord::Schema.define(:version => 20160322175514) do
|
7
7
|
enable_extension 'pgcrypto' unless extension_enabled?('pgcrypto')
|
8
8
|
create_table "aggregations", :id => false, :force => true do |t|
|
9
9
|
t.column "aggregation_id", :primary_key, :null => false
|
@@ -36,12 +36,14 @@ ActiveRecord::Schema.define(:version => 20151102200220) do
|
|
36
36
|
t.column "parent_guid", :uuid, :null => true
|
37
37
|
t.column "absorption_child_role_id", :integer, :null => true
|
38
38
|
t.column "absorption_flattens", :boolean, :null => true
|
39
|
+
t.column "absorption_nesting_mode", :string, :null => true
|
39
40
|
t.column "absorption_parent_role_id", :integer, :null => true
|
40
41
|
t.column "absorption_reverse_absorption_guid", :uuid, :null => true
|
41
42
|
t.column "indicator_role_id", :integer, :null => true
|
42
43
|
t.column "mapping_composition_guid", :uuid, :null => true
|
43
44
|
t.column "mapping_object_type_id", :integer, :null => true
|
44
45
|
t.column "name", :string, :limit => 64, :null => true
|
46
|
+
t.column "ordinal", :integer, :limit => 16, :null => true
|
45
47
|
end
|
46
48
|
|
47
49
|
add_index "components", ["absorption_reverse_absorption_guid"], :name => :index_components_on_absorption_reverse_absorption_guid
|
@@ -178,6 +180,7 @@ ActiveRecord::Schema.define(:version => 20151102200220) do
|
|
178
180
|
t.column "nesting_id", :primary_key, :null => false
|
179
181
|
t.column "absorption_guid", :uuid, :null => false
|
180
182
|
t.column "index_role_id", :integer, :null => false
|
183
|
+
t.column "key_name", :string, :limit => 64, :null => true
|
181
184
|
t.column "ordinal", :integer, :limit => 16, :null => false
|
182
185
|
end
|
183
186
|
|
data/ruby/Metamodel.rb
CHANGED
@@ -96,6 +96,11 @@ module ::Metamodel
|
|
96
96
|
one_to_one :vocabulary # See Vocabulary.name
|
97
97
|
end
|
98
98
|
|
99
|
+
class NestingMode < String
|
100
|
+
value_type
|
101
|
+
restrict 'Array', 'Bag', 'Map', 'Repetition'
|
102
|
+
end
|
103
|
+
|
99
104
|
class Numerator < Decimal
|
100
105
|
value_type
|
101
106
|
end
|
@@ -178,6 +183,7 @@ module ::Metamodel
|
|
178
183
|
identified_by :guid
|
179
184
|
one_to_one :guid, :mandatory => true # See Guid.component
|
180
185
|
has_one :name # See Name.all_component
|
186
|
+
has_one :ordinal # See Ordinal.all_component
|
181
187
|
has_one :parent, :class => "Mapping", :counterpart => :member # See Mapping.all_member
|
182
188
|
end
|
183
189
|
|
@@ -399,6 +405,7 @@ module ::Metamodel
|
|
399
405
|
one_to_one :absorption, :counterpart => :reverse_absorption # See Absorption.reverse_absorption
|
400
406
|
has_one :child_role, :class => Role, :mandatory => true # See Role.all_absorption_as_child_role
|
401
407
|
maybe :flattens
|
408
|
+
has_one :nesting_mode # See NestingMode.all_absorption
|
402
409
|
has_one :parent_role, :class => Role, :mandatory => true # See Role.all_absorption_as_parent_role
|
403
410
|
one_to_one :reverse_absorption, :class => Absorption # See Absorption.absorption_as_reverse_absorption
|
404
411
|
end
|
@@ -487,6 +494,7 @@ module ::Metamodel
|
|
487
494
|
has_one :absorption, :mandatory => true # See Absorption.all_nesting
|
488
495
|
has_one :index_role, :class => Role, :mandatory => true # See Role.all_nesting_as_index_role
|
489
496
|
has_one :ordinal, :mandatory => true # See Ordinal.all_nesting
|
497
|
+
has_one :key_name, :class => Name # See Name.all_nesting_as_key_name
|
490
498
|
end
|
491
499
|
|
492
500
|
class ORMDiagram < Diagram
|
@@ -577,6 +585,9 @@ module ::Metamodel
|
|
577
585
|
one_to_one :role_display # See RoleDisplay.value_constraint_shape
|
578
586
|
end
|
579
587
|
|
588
|
+
class ValueField < Injection
|
589
|
+
end
|
590
|
+
|
580
591
|
class ValueRange
|
581
592
|
identified_by :minimum_bound, :maximum_bound
|
582
593
|
has_one :maximum_bound, :class => Bound # See Bound.all_value_range_as_maximum_bound
|
data/ruby/Supervision.rb
CHANGED
@@ -30,4 +30,10 @@ module ::Supervision
|
|
30
30
|
class CEO < Manager
|
31
31
|
end
|
32
32
|
|
33
|
+
class CEOShareholding
|
34
|
+
identified_by :ceo, :company
|
35
|
+
has_one :ceo, :class => CEO, :mandatory => true # See CEO.all_ceo_shareholding
|
36
|
+
has_one :company, :mandatory => true # See Company.all_ceo_shareholding
|
37
|
+
end
|
38
|
+
|
33
39
|
end
|
@@ -54,11 +54,11 @@ CREATE TABLE Seat (
|
|
54
54
|
GO
|
55
55
|
|
56
56
|
CREATE TABLE SeatAllocation (
|
57
|
-
-- Seat Allocation involves Seat and Seat has Seat Number,
|
57
|
+
-- Seat Allocation involves allocated-Seat and Seat has Seat Number,
|
58
58
|
AllocatedSeatNumber smallint NOT NULL,
|
59
|
-
-- Seat Allocation involves Seat and Seat is in Row and Row is in Cinema and Cinema has Cinema ID,
|
59
|
+
-- Seat Allocation involves allocated-Seat and Seat is in Row and Row is in Cinema and Cinema has Cinema ID,
|
60
60
|
AllocatedSeatRowCinemaID int NOT NULL,
|
61
|
-
-- Seat Allocation involves Seat and Seat is in Row and Row has Row Nr,
|
61
|
+
-- Seat Allocation involves allocated-Seat and Seat is in Row and Row has Row Nr,
|
62
62
|
AllocatedSeatRowNr char(2) NOT NULL,
|
63
63
|
-- Seat Allocation involves Booking and Booking involves Person and Person has Person ID,
|
64
64
|
BookingPersonID int NOT NULL,
|
@@ -114,11 +114,11 @@ CREATE TABLE Seat (
|
|
114
114
|
GO
|
115
115
|
|
116
116
|
CREATE TABLE SeatAllocation (
|
117
|
-
-- Seat Allocation involves Seat and Seat has Seat Number,
|
117
|
+
-- Seat Allocation involves allocated-Seat and Seat has Seat Number,
|
118
118
|
AllocatedSeatNumber smallint NOT NULL,
|
119
|
-
-- Seat Allocation involves Seat and Seat is in Row and Row is in Cinema and Cinema has Cinema ID,
|
119
|
+
-- Seat Allocation involves allocated-Seat and Seat is in Row and Row is in Cinema and Cinema has Cinema ID,
|
120
120
|
AllocatedSeatRowCinemaID int NOT NULL,
|
121
|
-
-- Seat Allocation involves Seat and Seat is in Row and Row has Row Nr,
|
121
|
+
-- Seat Allocation involves allocated-Seat and Seat is in Row and Row has Row Nr,
|
122
122
|
AllocatedSeatRowNr char(2) NOT NULL,
|
123
123
|
-- Seat Allocation involves Booking and Booking has Booking Nr,
|
124
124
|
BookingNr int NOT NULL,
|
data/sql/server/Genealogy.sql
CHANGED
@@ -34,7 +34,7 @@ GO
|
|
34
34
|
CREATE TABLE Friendship (
|
35
35
|
-- Friendship is confirmed,
|
36
36
|
IsConfirmed bit NULL,
|
37
|
-
-- Friendship involves User and User has User ID,
|
37
|
+
-- Friendship involves other-User and User has User ID,
|
38
38
|
OtherUserID int NOT NULL,
|
39
39
|
-- Friendship involves User and User has User ID,
|
40
40
|
UserID int NOT NULL,
|
data/sql/server/Insurance.sql
CHANGED
@@ -58,10 +58,10 @@ CREATE TABLE Claim (
|
|
58
58
|
IncidentReporterName varchar(256) NULL,
|
59
59
|
-- maybe Claim concerns Incident and maybe Incident is covered by Police Report and maybe Police Report was at station-Name,
|
60
60
|
IncidentStationName varchar(256) NULL,
|
61
|
-
-- Claim is involved in Lodgement and maybe Lodgement was made at Date Time,
|
61
|
+
-- maybe Claim is involved in Lodgement and maybe Lodgement was made at Date Time,
|
62
62
|
LodgementDateTime datetime NULL,
|
63
|
-
-- Claim is involved in Lodgement and Lodgement involves Person and Person is a kind of Party and Party has Party ID,
|
64
|
-
LodgementPersonID int
|
63
|
+
-- maybe Claim is involved in Lodgement and Lodgement involves Person and Person is a kind of Party and Party has Party ID,
|
64
|
+
LodgementPersonID int NULL,
|
65
65
|
-- Claim has Claim Sequence,
|
66
66
|
PSequence int NOT NULL CHECK((PSequence >= 1 AND PSequence <= 999)),
|
67
67
|
-- Claim is on Policy and Policy is for product having Product and Product has Product Code,
|
@@ -120,7 +120,7 @@ CREATE TABLE CoverWording (
|
|
120
120
|
CoverTypeCode char NOT NULL,
|
121
121
|
-- Cover Wording involves Policy Wording and Policy Wording has Policy Wording Text,
|
122
122
|
PolicyWordingText varchar NOT NULL,
|
123
|
-
-- Cover Wording involves Date,
|
123
|
+
-- Cover Wording involves start-Date,
|
124
124
|
StartDate datetime NOT NULL,
|
125
125
|
PRIMARY KEY(CoverTypeCode, PolicyWordingText, StartDate),
|
126
126
|
FOREIGN KEY (CoverTypeCode) REFERENCES CoverType (CoverTypeCode)
|
data/sql/server/Metamodel.sql
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
CREATE TABLE Aggregation (
|
2
2
|
-- Aggregation involves Aggregate and Aggregate has Aggregate Code,
|
3
3
|
AggregateCode varchar(32) NOT NULL,
|
4
|
-
-- Aggregation involves Variable and Variable has Ordinal position,
|
4
|
+
-- Aggregation involves aggregated-Variable and Variable has Ordinal position,
|
5
5
|
AggregatedVariableOrdinal smallint NOT NULL,
|
6
|
-
-- Aggregation involves Variable and Variable is in Query and Query is an instance of Concept and Concept has Guid,
|
6
|
+
-- Aggregation involves aggregated-Variable and Variable is in Query and Query is an instance of Concept and Concept has Guid,
|
7
7
|
AggregatedVariableQueryConceptGuid uniqueidentifier NOT NULL,
|
8
8
|
-- Aggregation involves Variable and Variable has Ordinal position,
|
9
9
|
VariableOrdinal smallint NOT NULL,
|
@@ -52,6 +52,8 @@ CREATE TABLE Component (
|
|
52
52
|
AbsorptionChildRoleOrdinal smallint NULL,
|
53
53
|
-- maybe Component is a Mapping and maybe Mapping is an Absorption and Absorption flattens,
|
54
54
|
AbsorptionFlattens bit NULL,
|
55
|
+
-- maybe Component is a Mapping and maybe Mapping is an Absorption and maybe Absorption uses Nesting Mode,
|
56
|
+
AbsorptionNestingMode varchar NULL CHECK(AbsorptionNestingMode = 'Array' OR AbsorptionNestingMode = 'Bag' OR AbsorptionNestingMode = 'Map' OR AbsorptionNestingMode = 'Repetition'),
|
55
57
|
-- maybe Component is a Mapping and maybe Mapping is an Absorption and Absorption traverses from parent-Role and Role belongs to Fact Type and Fact Type is an instance of Concept and Concept has Guid,
|
56
58
|
AbsorptionParentRoleFactTypeConceptGuid uniqueidentifier NULL,
|
57
59
|
-- maybe Component is a Mapping and maybe Mapping is an Absorption and Absorption traverses from parent-Role and Role fills Ordinal,
|
@@ -72,6 +74,8 @@ CREATE TABLE Component (
|
|
72
74
|
MappingObjectTypeVocabularyName varchar(64) NULL,
|
73
75
|
-- maybe Component projects Name,
|
74
76
|
Name varchar(64) NULL,
|
77
|
+
-- maybe Component has Ordinal rank,
|
78
|
+
Ordinal smallint NULL,
|
75
79
|
-- maybe Component belongs to Mapping and Mapping is a kind of Component and Component has Guid,
|
76
80
|
ParentGuid uniqueidentifier NULL,
|
77
81
|
PRIMARY KEY(Guid),
|
@@ -195,7 +199,7 @@ GO
|
|
195
199
|
CREATE TABLE ConceptAnnotation (
|
196
200
|
-- Concept Annotation involves Concept and Concept has Guid,
|
197
201
|
ConceptGuid uniqueidentifier NOT NULL,
|
198
|
-
-- Concept Annotation involves Annotation,
|
202
|
+
-- Concept Annotation involves mapping-Annotation,
|
199
203
|
MappingAnnotation varchar NOT NULL,
|
200
204
|
PRIMARY KEY(ConceptGuid, MappingAnnotation),
|
201
205
|
FOREIGN KEY (ConceptGuid) REFERENCES Concept (Guid)
|
@@ -309,7 +313,7 @@ CREATE TABLE ContextAgreedBy (
|
|
309
313
|
GO
|
310
314
|
|
311
315
|
CREATE TABLE Derivation (
|
312
|
-
-- Derivation involves Unit and Unit is an instance of Concept and Concept has Guid,
|
316
|
+
-- Derivation involves base-Unit and Unit is an instance of Concept and Concept has Guid,
|
313
317
|
BaseUnitConceptGuid uniqueidentifier NOT NULL,
|
314
318
|
-- Derivation involves Unit and Unit is an instance of Concept and Concept has Guid,
|
315
319
|
DerivedUnitConceptGuid uniqueidentifier NOT NULL,
|
@@ -372,9 +376,9 @@ CREATE TABLE FactType (
|
|
372
376
|
TypeInheritanceSubtypeName varchar(64) NULL,
|
373
377
|
-- maybe Fact Type is a Type Inheritance and Type Inheritance involves Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type and Object Type belongs to Vocabulary and Vocabulary is called Name,
|
374
378
|
TypeInheritanceSubtypeVocabularyName varchar(64) NULL,
|
375
|
-
-- maybe Fact Type is a Type Inheritance and Type Inheritance involves Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type and Object Type is called Name,
|
379
|
+
-- maybe Fact Type is a Type Inheritance and Type Inheritance involves super-Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type and Object Type is called Name,
|
376
380
|
TypeInheritanceSupertypeName varchar(64) NULL,
|
377
|
-
-- maybe Fact Type is a Type Inheritance and Type Inheritance involves Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type and Object Type belongs to Vocabulary and Vocabulary is called Name,
|
381
|
+
-- maybe Fact Type is a Type Inheritance and Type Inheritance involves super-Entity Type and Entity Type is a kind of Domain Object Type and Domain Object Type is a kind of Object Type and Object Type belongs to Vocabulary and Vocabulary is called Name,
|
378
382
|
TypeInheritanceSupertypeVocabularyName varchar(64) NULL,
|
379
383
|
PRIMARY KEY(ConceptGuid),
|
380
384
|
FOREIGN KEY (ConceptGuid) REFERENCES Concept (Guid)
|
@@ -414,10 +418,12 @@ GO
|
|
414
418
|
CREATE TABLE Nesting (
|
415
419
|
-- Nesting involves Absorption and Absorption is a kind of Mapping and Mapping is a kind of Component and Component has Guid,
|
416
420
|
AbsorptionGuid uniqueidentifier NOT NULL,
|
417
|
-
-- Nesting involves Role and Role belongs to Fact Type and Fact Type is an instance of Concept and Concept has Guid,
|
421
|
+
-- Nesting involves index-Role and Role belongs to Fact Type and Fact Type is an instance of Concept and Concept has Guid,
|
418
422
|
IndexRoleFactTypeConceptGuid uniqueidentifier NOT NULL,
|
419
|
-
-- Nesting involves Role and Role fills Ordinal,
|
423
|
+
-- Nesting involves index-Role and Role fills Ordinal,
|
420
424
|
IndexRoleOrdinal smallint NOT NULL,
|
425
|
+
-- maybe Nesting has key-Name,
|
426
|
+
KeyName varchar(64) NULL,
|
421
427
|
-- Nesting involves Ordinal,
|
422
428
|
Ordinal smallint NOT NULL,
|
423
429
|
PRIMARY KEY(AbsorptionGuid, Ordinal),
|
data/sql/server/OilSupply.sql
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
CREATE TABLE AcceptableSubstitution (
|
2
|
-
-- Acceptable Substitution involves Product and Product has Product Name,
|
2
|
+
-- Acceptable Substitution involves alternate-Product and Product has Product Name,
|
3
3
|
AlternateProductName varchar NOT NULL,
|
4
4
|
-- Acceptable Substitution involves Product and Product has Product Name,
|
5
5
|
ProductName varchar NOT NULL,
|
data/sql/server/Supervision.sql
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
CREATE TABLE CEOShareholding (
|
2
|
+
-- CEO Shareholding involves CEO and CEO is a kind of Manager and Manager is a kind of Employee and Employee works for Company and Company has CompanyName,
|
3
|
+
CEOCompanyName varchar NOT NULL,
|
4
|
+
-- CEO Shareholding involves CEO and CEO is a kind of Manager and Manager is a kind of Employee and Employee has EmployeeNr,
|
5
|
+
CEOEmployeeNr int NOT NULL,
|
6
|
+
-- CEO Shareholding involves Company and Company has CompanyName,
|
7
|
+
CompanyName varchar NOT NULL,
|
8
|
+
PRIMARY KEY(CEOCompanyName, CEOEmployeeNr, CompanyName)
|
9
|
+
)
|
10
|
+
GO
|
11
|
+
|
1
12
|
CREATE TABLE Company (
|
2
13
|
-- Company is run by CEO and CEO is a kind of Manager and Manager is a kind of Employee and Employee works for Company and Company has CompanyName,
|
3
14
|
CEOCompanyName varchar NOT NULL,
|
@@ -24,6 +35,14 @@ CREATE TABLE Employee (
|
|
24
35
|
)
|
25
36
|
GO
|
26
37
|
|
38
|
+
ALTER TABLE CEOShareholding
|
39
|
+
ADD FOREIGN KEY (CompanyName) REFERENCES Company (CompanyName)
|
40
|
+
GO
|
41
|
+
|
42
|
+
ALTER TABLE CEOShareholding
|
43
|
+
ADD FOREIGN KEY (CEOCompanyName, CEOEmployeeNr) REFERENCES Employee (CompanyName, EmployeeNr)
|
44
|
+
GO
|
45
|
+
|
27
46
|
ALTER TABLE Company
|
28
47
|
ADD FOREIGN KEY (CEOCompanyName, CEOEmployeeNr) REFERENCES Employee (CompanyName, EmployeeNr)
|
29
48
|
GO
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activefacts-examples
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.8
|
4
|
+
version: 1.9.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clifford Heath
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-03-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.10'
|
20
|
-
- - "~>"
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: 1.10.6
|
23
20
|
type: :development
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,9 +24,6 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '1.10'
|
30
|
-
- - "~>"
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: 1.10.6
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: rake
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -49,6 +43,9 @@ dependencies:
|
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
50
44
|
requirements:
|
51
45
|
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3'
|
48
|
+
- - ">="
|
52
49
|
- !ruby/object:Gem::Version
|
53
50
|
version: '3.3'
|
54
51
|
type: :development
|
@@ -56,6 +53,9 @@ dependencies:
|
|
56
53
|
version_requirements: !ruby/object:Gem::Requirement
|
57
54
|
requirements:
|
58
55
|
- - "~>"
|
56
|
+
- !ruby/object:Gem::Version
|
57
|
+
version: '3'
|
58
|
+
- - ">="
|
59
59
|
- !ruby/object:Gem::Version
|
60
60
|
version: '3.3'
|
61
61
|
- !ruby/object:Gem::Dependency
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
version: '1.8'
|
68
68
|
- - "~>"
|
69
69
|
- !ruby/object:Gem::Version
|
70
|
-
version: 1
|
70
|
+
version: '1'
|
71
71
|
type: :runtime
|
72
72
|
prerelease: false
|
73
73
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -77,7 +77,27 @@ dependencies:
|
|
77
77
|
version: '1.8'
|
78
78
|
- - "~>"
|
79
79
|
- !ruby/object:Gem::Version
|
80
|
-
version: 1
|
80
|
+
version: '1'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: activefacts-metamodel
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: 1.9.8
|
88
|
+
- - "~>"
|
89
|
+
- !ruby/object:Gem::Version
|
90
|
+
version: '1'
|
91
|
+
type: :runtime
|
92
|
+
prerelease: false
|
93
|
+
version_requirements: !ruby/object:Gem::Requirement
|
94
|
+
requirements:
|
95
|
+
- - ">="
|
96
|
+
- !ruby/object:Gem::Version
|
97
|
+
version: 1.9.8
|
98
|
+
- - "~>"
|
99
|
+
- !ruby/object:Gem::Version
|
100
|
+
version: '1'
|
81
101
|
description: Example models in the Constellation Query Language for use with ActiveFacts
|
82
102
|
email:
|
83
103
|
- clifford.heath@gmail.com
|
@@ -365,7 +385,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
365
385
|
version: '0'
|
366
386
|
requirements: []
|
367
387
|
rubyforge_project:
|
368
|
-
rubygems_version: 2.
|
388
|
+
rubygems_version: 2.4.5
|
369
389
|
signing_key:
|
370
390
|
specification_version: 4
|
371
391
|
summary: Example models for use with ActiveFacts
|