activefacts 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest.txt +4 -0
- data/examples/CQL/Metamodel.cql +11 -7
- data/lib/activefacts/api/concept.rb +10 -0
- data/lib/activefacts/api/entity.rb +2 -0
- data/lib/activefacts/api/instance_index.rb +71 -0
- data/lib/activefacts/api/role_proxy.rb +70 -0
- data/lib/activefacts/api/role_values.rb +117 -0
- data/lib/activefacts/generate/absorption.rb +20 -30
- data/lib/activefacts/generate/null.rb +1 -0
- data/lib/activefacts/generate/ruby.rb +12 -28
- data/lib/activefacts/generate/sql/server.rb +8 -22
- data/lib/activefacts/generate/text.rb +1 -0
- data/lib/activefacts/input/cql.rb +30 -32
- data/lib/activefacts/input/orm.rb +11 -12
- data/lib/activefacts/persistence.rb +5 -0
- data/lib/activefacts/persistence/columns.rb +28 -21
- data/lib/activefacts/persistence/concept.rb +73 -0
- data/lib/activefacts/persistence/foreignkey.rb +17 -1
- data/lib/activefacts/persistence/index.rb +21 -10
- data/lib/activefacts/persistence/reference.rb +6 -6
- data/lib/activefacts/persistence/tables.rb +8 -5
- data/lib/activefacts/version.rb +1 -1
- data/lib/activefacts/vocabulary/extensions.rb +17 -7
- data/lib/activefacts/vocabulary/metamodel.rb +22 -17
- data/spec/absorption_spec.rb +1 -1
- data/spec/cql_symbol_tables_spec.rb +1 -1
- data/spec/cqldump_spec.rb +8 -8
- data/spec/norma_tables_spec.rb +1 -1
- metadata +7 -3
data/spec/absorption_spec.rb
CHANGED
@@ -43,7 +43,7 @@ describe "Absorption" do
|
|
43
43
|
#{Prologue}
|
44
44
|
Month is in exactly one Season;
|
45
45
|
},
|
46
|
-
:tables => { "Month" => [ "
|
46
|
+
:tables => { "Month" => [["Month", "Value"], ["Season"]] }
|
47
47
|
},
|
48
48
|
|
49
49
|
{ :should => "absorb a one-to-one along the identification path",
|
@@ -101,7 +101,7 @@ describe "CQL Symbol table" do
|
|
101
101
|
it "should define #{description}" do
|
102
102
|
if result
|
103
103
|
# Predefine an entity type, some cases use it:
|
104
|
-
@constellation.EntityType(
|
104
|
+
@constellation.EntityType(@vocabulary.identifying_role_values, "Person")
|
105
105
|
|
106
106
|
player, bound = @symbols.bind(*args)
|
107
107
|
player.should_not be_nil
|
data/spec/cqldump_spec.rb
CHANGED
@@ -17,8 +17,8 @@ describe "CQL Dumper" do
|
|
17
17
|
setup do
|
18
18
|
@constellation = ActiveFacts::API::Constellation.new(ActiveFacts::Metamodel)
|
19
19
|
@vocabulary = @constellation.Vocabulary("TestVocab")
|
20
|
-
@string_type = @constellation.ValueType("String"
|
21
|
-
@integer_type = @constellation.ValueType("Integer"
|
20
|
+
@string_type = @constellation.ValueType(@vocabulary, "String")
|
21
|
+
@integer_type = @constellation.ValueType(@vocabulary, "Integer")
|
22
22
|
@dumper = ActiveFacts::Generate::CQL.new(@constellation)
|
23
23
|
end
|
24
24
|
|
@@ -30,7 +30,7 @@ describe "CQL Dumper" do
|
|
30
30
|
end
|
31
31
|
|
32
32
|
it "should dump a String ValueType" do
|
33
|
-
vt = @constellation.ValueType("Name",
|
33
|
+
vt = @constellation.ValueType(@vocabulary, "Name", :supertype => @string_type, :length => 20)
|
34
34
|
vt.supertype = @string_type
|
35
35
|
vt.length = 20
|
36
36
|
#p vt.class.roles.keys.sort_by{|s| s.to_s}
|
@@ -47,7 +47,7 @@ END
|
|
47
47
|
end
|
48
48
|
|
49
49
|
it "should dump an Integer ValueType" do
|
50
|
-
vt = @constellation.ValueType("Count",
|
50
|
+
vt = @constellation.ValueType(@vocabulary, "Count", :supertype => @integer_type, :length => 32)
|
51
51
|
cql.should == <<END
|
52
52
|
vocabulary TestVocab;
|
53
53
|
|
@@ -60,8 +60,8 @@ END
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def value_type(name, datatype = "String", length = 0, scale = 0)
|
63
|
-
dt = @constellation.ValueType(
|
64
|
-
vt = @constellation.ValueType(
|
63
|
+
dt = @constellation.ValueType(@vocabulary, datatype)
|
64
|
+
vt = @constellation.ValueType(@vocabulary, name, :supertype => dt)
|
65
65
|
vt.length = length if length != 0
|
66
66
|
vt.scale = scale if scale != 0
|
67
67
|
vt
|
@@ -143,8 +143,8 @@ END
|
|
143
143
|
end
|
144
144
|
|
145
145
|
it "should dump an named EntityType" do
|
146
|
-
vt = @constellation.ValueType("Name",
|
147
|
-
et = @constellation.EntityType("Company"
|
146
|
+
vt = @constellation.ValueType(@vocabulary, "Name", :supertype => @string_type, :length => 20)
|
147
|
+
et = @constellation.EntityType(@vocabulary, "Company")
|
148
148
|
|
149
149
|
ft = one_to_one(et, vt, "{0} is called {1}")
|
150
150
|
|
data/spec/norma_tables_spec.rb
CHANGED
@@ -19,7 +19,7 @@ include ActiveFacts::Metamodel
|
|
19
19
|
Exceptions = {
|
20
20
|
"Blog" => ["Author", "Comment", "Paragraph", "Post", "Topic"],
|
21
21
|
"JoinEquality" => ["Event", "Seat", "Ticket", "Venue"],
|
22
|
-
"Metamodel" => ["AllowedRange", "Constraint", "Correspondence", "Derivation", "Fact", "FactType", "Feature", "Instance", "
|
22
|
+
"Metamodel" => ["AllowedRange", "Constraint", "Correspondence", "Derivation", "Fact", "FactType", "Feature", "Instance", "Join", "Reading", "Role", "RoleRef", "RoleSequence", "RoleValue", "SetComparisonRoles", "Unit", "ValueRestriction"],
|
23
23
|
"MetamodelTerms" => ["AllowedValue", "Concept", "Constraint", "Derivation", "Fact", "FactType", "Import", "Instance", "Join", "JoinRole", "ParamValue", "Reading", "Role", "RoleRef", "RoleSequence", "RoleValue", "SetComparisonRoles", "Term", "Unit", "ValueRestriction"],
|
24
24
|
"OilSupply" => ["AcceptableSubstitutes", "Month", "ProductionForecast", "RegionalDemand", "TransportRoute"],
|
25
25
|
"Orienteering" => ["Club", "Entry", "Event", "EventControl", "EventScoringMethod", "Map", "Person", "Punch", "PunchPlacement", "Series", "Visit"],
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activefacts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Clifford Heath
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-01-
|
12
|
+
date: 2009-01-31 00:00:00 +11:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -83,8 +83,11 @@ files:
|
|
83
83
|
- lib/activefacts/api/constellation.rb
|
84
84
|
- lib/activefacts/api/entity.rb
|
85
85
|
- lib/activefacts/api/instance.rb
|
86
|
+
- lib/activefacts/api/instance_index.rb
|
86
87
|
- lib/activefacts/api/numeric.rb
|
87
88
|
- lib/activefacts/api/role.rb
|
89
|
+
- lib/activefacts/api/role_proxy.rb
|
90
|
+
- lib/activefacts/api/role_values.rb
|
88
91
|
- lib/activefacts/api/standard_types.rb
|
89
92
|
- lib/activefacts/api/support.rb
|
90
93
|
- lib/activefacts/api/value.rb
|
@@ -112,6 +115,7 @@ files:
|
|
112
115
|
- lib/activefacts/input/orm.rb
|
113
116
|
- lib/activefacts/persistence.rb
|
114
117
|
- lib/activefacts/persistence/columns.rb
|
118
|
+
- lib/activefacts/persistence/concept.rb
|
115
119
|
- lib/activefacts/persistence/foreignkey.rb
|
116
120
|
- lib/activefacts/persistence/index.rb
|
117
121
|
- lib/activefacts/persistence/reference.rb
|
@@ -174,7 +178,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
178
|
requirements: []
|
175
179
|
|
176
180
|
rubyforge_project: cjheath@rubyforge.org
|
177
|
-
rubygems_version: 1.
|
181
|
+
rubygems_version: 1.3.1
|
178
182
|
signing_key:
|
179
183
|
specification_version: 2
|
180
184
|
summary: ActiveFacts is a semantic modeling toolkit, comprising an implementation of the Constellation Query Language, the Constellation API, and code generators that receive CQL or ORM (Object Role Modeling files, from NORMA) to emit CQL, Ruby and SQL
|