activefacts 0.8.18 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/Rakefile +0 -8
- data/examples/CQL/CompanyDirectorEmployee.cql +12 -8
- data/examples/CQL/Metamodel.cql +40 -24
- data/examples/CQL/OilSupply.cql +10 -8
- data/examples/CQL/unit.cql +52 -51
- data/lib/activefacts/cql/LexicalRules.treetop +1 -1
- data/lib/activefacts/cql/compiler.rb +1 -1
- data/lib/activefacts/cql/compiler/clause.rb +16 -24
- data/lib/activefacts/cql/compiler/constraint.rb +4 -4
- data/lib/activefacts/cql/compiler/entity_type.rb +16 -16
- data/lib/activefacts/cql/compiler/expression.rb +3 -3
- data/lib/activefacts/cql/compiler/fact.rb +1 -1
- data/lib/activefacts/cql/compiler/fact_type.rb +14 -4
- data/lib/activefacts/cql/compiler/shared.rb +1 -1
- data/lib/activefacts/cql/compiler/value_type.rb +2 -2
- data/lib/activefacts/generate/cql.rb +10 -34
- data/lib/activefacts/generate/helpers/oo.rb +10 -6
- data/lib/activefacts/generate/helpers/ordered.rb +32 -6
- data/lib/activefacts/generate/json.rb +2 -2
- data/lib/activefacts/generate/ruby.rb +7 -15
- data/lib/activefacts/generate/transform/surrogate.rb +7 -7
- data/lib/activefacts/input/orm.rb +23 -26
- data/lib/activefacts/persistence/index.rb +1 -1
- data/lib/activefacts/persistence/reference.rb +5 -2
- data/lib/activefacts/version.rb +3 -3
- data/lib/activefacts/vocabulary/extensions.rb +59 -19
- data/lib/activefacts/vocabulary/metamodel.rb +30 -14
- data/spec/cql/parser/bad_literals_spec.rb +1 -1
- data/spec/cql/parser/expressions_spec.rb +1 -1
- data/spec/cql_dm_spec.rb +15 -0
- data/spec/cql_mysql_spec.rb +1 -1
- data/spec/cqldump_spec.rb +12 -12
- data/spec/norma_cql_spec.rb +0 -1
- data/spec/norma_ruby_sql_spec.rb +3 -2
- data/spec/norma_tables_spec.rb +1 -1
- metadata +78 -127
- data/examples/CQL/JoinEquality.cql +0 -35
- data/examples/CQL/MonthInSeason.cql +0 -23
- data/examples/CQL/Moon.cql +0 -23
- data/examples/CQL/SubtypePI.cql +0 -31
- data/examples/CQL/Tests.Test5.Load.cql +0 -38
@@ -1,35 +0,0 @@
|
|
1
|
-
vocabulary JoinEquality;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Value Types
|
5
|
-
*/
|
6
|
-
Event Id is written as Auto Counter;
|
7
|
-
Number is written as Unsigned Integer(16);
|
8
|
-
Reserve is written as String(20);
|
9
|
-
Row is written as Char(2);
|
10
|
-
Venue Id is written as Auto Counter;
|
11
|
-
|
12
|
-
/*
|
13
|
-
* Entity Types
|
14
|
-
*/
|
15
|
-
Event is identified by its Id;
|
16
|
-
|
17
|
-
Venue is independent identified by its Id;
|
18
|
-
Event is held at one Venue;
|
19
|
-
|
20
|
-
Seat is independent identified by Venue and Reserve and Row and Number where
|
21
|
-
Seat is at one Venue,
|
22
|
-
Seat is in one Reserve,
|
23
|
-
Seat is in one Row,
|
24
|
-
Seat has one Number;
|
25
|
-
|
26
|
-
Ticket is identified by Event and Seat where
|
27
|
-
Ticket is for one Event,
|
28
|
-
Ticket is for one Seat;
|
29
|
-
|
30
|
-
/*
|
31
|
-
* Constraints:
|
32
|
-
*/
|
33
|
-
Ticket is for Seat that is at Venue
|
34
|
-
if and only if
|
35
|
-
Ticket is for Event that is held at Venue;
|
@@ -1,23 +0,0 @@
|
|
1
|
-
vocabulary MonthInSeason;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Value Types
|
5
|
-
*/
|
6
|
-
Event Id is written as Auto Counter;
|
7
|
-
Month is written as String;
|
8
|
-
Season is written as String;
|
9
|
-
|
10
|
-
/*
|
11
|
-
* Entity Types
|
12
|
-
*/
|
13
|
-
Event is identified by its Id;
|
14
|
-
|
15
|
-
Occurrence is where
|
16
|
-
Event occurred in Month;
|
17
|
-
|
18
|
-
/*
|
19
|
-
* Fact Types
|
20
|
-
*/
|
21
|
-
Month is in at most one Season,
|
22
|
-
Season contains at least one Month;
|
23
|
-
|
data/examples/CQL/Moon.cql
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
vocabulary Moon;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Value Types
|
5
|
-
*/
|
6
|
-
Moon Name is written as String;
|
7
|
-
Nr Days Nr is written as Signed Integer(32);
|
8
|
-
Planet Name is written as String;
|
9
|
-
|
10
|
-
/*
|
11
|
-
* Entity Types
|
12
|
-
*/
|
13
|
-
Moon is identified by its Name;
|
14
|
-
|
15
|
-
Nr Days is identified by its Nr;
|
16
|
-
|
17
|
-
Orbit is where
|
18
|
-
Moon is in orbit;
|
19
|
-
Orbit has a synodic period of at most one Nr Days;
|
20
|
-
|
21
|
-
Planet is identified by its Name;
|
22
|
-
Orbit is around one Planet;
|
23
|
-
|
data/examples/CQL/SubtypePI.cql
DELETED
@@ -1,31 +0,0 @@
|
|
1
|
-
vocabulary SubtypePI;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Value Types
|
5
|
-
*/
|
6
|
-
Entrant ID is written as Auto Counter;
|
7
|
-
Family Name is written as String;
|
8
|
-
Given Name is written as String;
|
9
|
-
Team ID is written as Auto Counter;
|
10
|
-
|
11
|
-
/*
|
12
|
-
* Entity Types
|
13
|
-
*/
|
14
|
-
Entrant is identified by its ID;
|
15
|
-
|
16
|
-
Entrant Given Name is where
|
17
|
-
Entrant has at least one Given Name,
|
18
|
-
Given Name is of Entrant;
|
19
|
-
|
20
|
-
Team is a kind of Entrant identified by its ID;
|
21
|
-
|
22
|
-
Competitor is a kind of Entrant;
|
23
|
-
Competitor has one Family Name;
|
24
|
-
|
25
|
-
/*
|
26
|
-
* Constraints:
|
27
|
-
*/
|
28
|
-
either Entrant is a Competitor or Entrant is a Team but not both;
|
29
|
-
each combination Family Name, Given Name occurs at most one time in
|
30
|
-
Competitor has Family Name,
|
31
|
-
Entrant has Given Name;
|
@@ -1,38 +0,0 @@
|
|
1
|
-
vocabulary ORMModel1;
|
2
|
-
|
3
|
-
/*
|
4
|
-
* Value Types
|
5
|
-
*/
|
6
|
-
Accuracy Level is written as Signed Integer(32);
|
7
|
-
Party Id is written as Auto Counter;
|
8
|
-
Party Name is written as String;
|
9
|
-
ymd is written as Date;
|
10
|
-
|
11
|
-
/*
|
12
|
-
* Entity Types
|
13
|
-
*/
|
14
|
-
Accuracy is identified by its Level restricted to {1..5};
|
15
|
-
|
16
|
-
Event Date is identified by ymd where
|
17
|
-
Event Date has one ymd,
|
18
|
-
ymd is of at most one Event Date;
|
19
|
-
|
20
|
-
Party is independent identified by its Id;
|
21
|
-
|
22
|
-
Party Moniker is where
|
23
|
-
Party is called one Party Name;
|
24
|
-
Party Moniker has one Accuracy;
|
25
|
-
|
26
|
-
Person is a kind of Party;
|
27
|
-
|
28
|
-
Birth is where
|
29
|
-
Person was born on one Event Date;
|
30
|
-
|
31
|
-
Death is where
|
32
|
-
Person died;
|
33
|
-
Death occurred on at most one death-Event Date;
|
34
|
-
|
35
|
-
Doctor is a kind of Person;
|
36
|
-
Birth was assisted by at most one attending-Doctor,
|
37
|
-
Doctor attended Birth;
|
38
|
-
|