examples/CQL/MetamodelNext.cql in activefacts-0.8.9 vs examples/CQL/MetamodelNext.cql in activefacts-0.8.10
- old
+ new
@@ -4,39 +4,35 @@
* Value Types
*/
Adjective is written as String(64);
Agent Name is written as String;
Assimilation is written as String restricted to {'partitioned', 'separate'};
-Context Note Id is written as Auto Counter;
Context Note Kind is written as String restricted to {'as_opposed_to', 'because', 'so_that', 'to_avoid'};
Date is written as Date;
Denominator is written as Unsigned Integer(32);
Discussion is written as String;
Display Role Names Setting is written as String restricted to {'false', 'true'};
Enforcement Code is written as String(16);
Ephemera URL is written as String;
Exponent is written as Signed Integer(16);
-Fact Id is written as Auto Counter;
Frequency is written as Unsigned Integer(32);
GUID is written as String;
-Instance Id is written as Auto Counter;
-Join Id is written as Auto Counter;
+Language Code is written as Char(3);
Length is written as Unsigned Integer(32);
Literal is written as String;
Name is written as String(64);
Numerator is written as Decimal;
Offset is written as Decimal;
Ordinal is written as Unsigned Integer(16);
Pronoun is written as String(20) restricted to {'feminine', 'masculine', 'neuter', 'personal'};
Ring Type is written as String;
-Role Sequence Id is written as Auto Counter;
Rotation Setting is written as String restricted to {'left', 'right'};
Scale is written as Unsigned Integer(32);
-Shape Id is written as Auto Counter;
-Subscript is written as String;
+Subscript is written as Unsigned Integer(16);
Text is written as String(256);
-Unit Id is written as Auto Counter;
+Transaction Timing is written as String restricted to {'assert', 'commit'};
+Unit Code is written as Char;
X is written as Signed Integer(32);
Y is written as Signed Integer(32);
/*
* Entity Types
@@ -50,15 +46,17 @@
Concept is identified by GUID where
Concept has one GUID,
GUID is of at most one Concept;
-Constraint is a kind of Concept [partitioned];
+Constraint is a kind of Concept;
Name is of Constraint,
Constraint is called at most one Name;
-Context Note is identified by its Id;
+Context Note is identified by GUID where
+ Context Note has one GUID,
+ GUID is of at most one Context Note;
Concept has Context Note,
Context Note applies to at most one Concept;
Context Note has one Context Note Kind,
Context Note Kind is of Context Note;
Context Note has one Discussion,
@@ -69,31 +67,41 @@
Enforcement applies to one Constraint;
Enforcement notifies at most one Agent;
Enforcement has one Enforcement Code,
Enforcement Code is of Enforcement;
-Fact is identified by its Id;
+Fact is identified by GUID where
+ Fact has one GUID,
+ GUID is of at most one Fact;
-Fact Type is a kind of Concept [partitioned];
+Fact Type is a kind of Concept;
Fact is of one Fact Type;
Implicit Fact Type is a kind of Fact Type;
-Instance is identified by its Id;
+Instance is identified by GUID where
+ Instance has one GUID,
+ GUID is of at most one Instance;
Instance objectifies at most one Fact,
Fact is objectified as at most one Instance;
-Join is identified by its Id;
+Join is identified by GUID where
+ Join has one GUID,
+ GUID is of at most one Join;
Join Node is identified by Join and Ordinal where
Join includes Join Node,
Join Node is in one Join,
Join Node has one Ordinal position;
Join Node has at most one Subscript,
Subscript is of Join Node;
+Join Node has at most one role-Name,
+ Name is of Join Node;
-Object Type is a kind of Concept [partitioned];
+Language is identified by its Code;
+
+Object Type is a kind of Concept;
Instance is of one Object Type;
Join Node is for one Object Type,
Object Type is referenced in Join Node;
Object Type uses at most one Pronoun;
Object Type is independent;
@@ -116,23 +124,25 @@
Reading has one Text;
Ring Constraint is a kind of Constraint;
Ring Constraint is of one Ring Type;
-Role is a kind of Concept [partitioned] where
+Role is a kind of Concept where
Fact Type has at least one Ordinal role;
-Implicit Fact Type is implied by one Role,
- Role implies at most one Implicit Fact Type;
+Implicit Fact Type is implied by one Role (as Implying Role),
+ Implying Role implies at most one Implicit Fact Type;
Object Type plays Role,
Role is played by one Object Type;
-Ring Constraint has at most one other-Role;
Ring Constraint has at most one other-Role,
other-Role is of Ring Constraint;
+Role is of Ring Constraint; // Avoid ambiguity; this is a new fact type
Role is of Ring Constraint,
Ring Constraint has at most one Role;
-Role Sequence is identified by its Id;
+Role Sequence is identified by GUID where
+ Role Sequence has one GUID,
+ GUID is of at most one Role Sequence;
Presence Constraint covers one Role Sequence;
Reading is in one Role Sequence,
Role Sequence is for Reading;
Role Sequence has unused dependency to force table in norma;
@@ -143,19 +153,25 @@
Fact includes at least one Role Value;
Role Value is of one Role;
Set Constraint is a kind of Constraint;
-Shape is identified by its Id;
+Shape is identified by GUID where
+ Shape has one GUID,
+ GUID is of at most one Shape;
Shape is at at most one Position;
Shape is expanded;
Subset Constraint is a kind of Set Constraint;
Subset Constraint covers one subset-Role Sequence;
Subset Constraint covers one superset-Role Sequence;
-Unit is identified by its Id;
+Topic is identified by Name where
+ Topic has one Name,
+ Name is of at most one Topic;
+
+Unit is identified by its Code;
Ephemera URL provides Unit coefficient,
Unit uses coefficient from at most one Ephemera URL;
Name is of Unit,
Unit is called one Name;
Unit has at most one Coefficient;
@@ -167,11 +183,12 @@
Value is represented by one Literal,
Literal represents Value,
Value is a string,
Value is in at most one Unit,
Unit is of Value;
-Instance has at most one Value;
+Instance has at most one Value,
+ Value is of Instance;
Join Node has at most one Value;
Value Constraint is a kind of Constraint;
Role has at most one role-Value Constraint,
Value Constraint applies to at most one Role;
@@ -182,15 +199,19 @@
Value Type has at most one Scale,
Scale is of Value Type;
Value Type is of at most one Unit;
Value Type has at most one Value Constraint,
Value Constraint constrains at most one Value Type;
+Value Type has at most one auto- assigned Transaction Timing;
Value Type is subtype of at most one super-Value Type (as Supertype) [acyclic],
Supertype is supertype of Value Type;
-Vocabulary is identified by Name where
- Vocabulary is called one Name;
+Vocabulary is where
+ Topic is described in Language,
+ Language describes Topic;
+Reading is for at most one Vocabulary,
+ Vocabulary contains Reading;
Vocabulary contains Constraint,
Constraint belongs to at most one Vocabulary;
Vocabulary includes Unit,
Unit is in one Vocabulary;
@@ -228,30 +249,41 @@
Name is of Diagram;
Shape is in one Diagram,
Diagram includes Shape;
Entity Type is a kind of Object Type;
-Entity Type nests at most one Fact Type,
- Fact Type is nested as at most one Entity Type;
+Entity Type objectifies at most one Fact Type,
+ Fact Type is objectified as at most one Entity Type;
+Facet is where
+ Value Type has facet called Name,
+ Name is a facet of Value Type;
+Facet has values of at most one Value Type;
+
+Facet Value is where
+ Value Type defines Facet as having one Value,
+ Value for Facet applies to Value Type;
+
Fact Type Shape is a kind of Shape;
Fact Type Shape has at most one Display Role Names Setting;
Fact Type Shape is for one Fact Type,
Fact Type has Fact Type Shape;
Fact Type Shape has at most one Rotation Setting;
-ImplicitBooleanValueType is a kind of Value Type;
+Implicit Boolean Value Type is a kind of Value Type;
-Join Role is where
- Join Node includes Role,
+Join Role is independent where
+ Join Node includes at least one Role,
Role connects to Join Node;
Join Step is identified by input-Join Role and output-Join Role where
Join Step has one input-Join Role,
Join Step has one output-Join Role;
Join Step traverses one Fact Type,
Fact Type directs Join Step;
+Join Step involves incidental-Join Role,
+ Join Role is incidentally involved in at most one Join Step;
is anti Join Step;
Join Step is outer;
Model Note Shape is a kind of Shape;
Model Note Shape is for one Context Note;
@@ -263,17 +295,13 @@
Objectified Fact Type Name Shape is a kind of Shape identified by Fact Type Shape where
Objectified Fact Type Name Shape is for one Fact Type Shape,
Fact Type Shape has at most one Objectified Fact Type Name Shape;
-Parameter is where
- Name is a parameter of Value Type,
- Value Type has parameter called Name;
-
-Population is identified by Vocabulary and Name where
- Vocabulary includes Population,
- Population belongs to at most one Vocabulary,
+Population is identified by Topic and Name where
+ Topic includes Population,
+ Population belongs to at most one Topic,
Population has one Name,
Name is of Population;
Population includes Fact,
Fact belongs to one Population;
Population includes Instance,
@@ -319,23 +347,24 @@
Set Exclusion Constraint is a kind of Set Comparison Constraint;
Set Exclusion Constraint is mandatory;
Term is where
- Vocabulary contains Name;
-Term designates at most one Object Type,
- Object Type uses one Term;
-Term is secondary for at most one Object Type (as Secondary),
- Secondary has secondary-Term;
-Term (as Role Name) is name of Role Ref,
- Role Ref has at most one Role Name;
+ Vocabulary uses Name for one Object Type,
+ Vocabulary refers to Object Type as Name,
+ Name applies to Object Type in Vocabulary;
+Term (as Role Name) is name of Role,
+ Role has at most one Role Name;
+Term is preferred;
-Type Inheritance is a kind of Fact Type identified by Subtype and Supertype where
+Type Inheritance is where
Entity Type (as Subtype) is subtype of super-Entity Type (as Supertype) [acyclic, intransitive],
Supertype is supertype of Subtype;
Assimilation applies to Type Inheritance,
Type Inheritance uses at most one Assimilation;
+Type Inheritance implies one Fact Type,
+ Fact Type is implied by at most one Type Inheritance;
Type Inheritance provides identification;
Value Constraint Shape is a kind of Constraint Shape;
Role Display has at most one Value Constraint Shape,
Value Constraint Shape is for at most one Role Display;
@@ -347,13 +376,10 @@
Value Range has at most one maximum-Bound;
Allowed Range is where
Value Constraint allows at least one Value Range;
-Param Value is where
- Value for Parameter applies to one Value Type;
-
/*
* Constraints:
*/
for each Concept exactly one of these holds:
Concept is an Object Type,
@@ -378,19 +404,16 @@
either Value Constraint Shape is for Object Type Shape or Value Constraint Shape is for Role Display but not both;
either Value Constraint constrains Value Type or Value Constraint applies to Role but not both;
for each Instance at most one of these holds:
Instance has Value,
Instance objectifies Fact;
-for each Term at most one of these holds:
- Term designates Object Type,
- Term is name of Role Ref;
-for each Term at most one of these holds:
- Term designates Object Type(1),
- Term is secondary for Object Type(2);
-for each Term at most one of these holds:
- Term is secondary for Object Type,
- Term is name of Role Ref;
+for each Join Role at most one of these holds:
+ Join Step(1) has input-Join Role,
+ Join Role is incidentally involved in Join Step;
+for each Join Role at most one of these holds:
+ Join Step(1) has output-Join Role,
+ Join Role is incidentally involved in Join Step;
Join Node is for Object Type that plays Role
if and only if
Join Node includes Role;
Role Value is of Instance that is of Object Type
if and only if
@@ -404,29 +427,28 @@
only if Value Type has Length;
either Agreement was reached by Agent or Agreement was on Date;
each combination Diagram, Position occurs at most one time in
Shape is in Diagram,
Shape is at Position;
-each combination Entity Type, Type Inheritance occurs at most one time in
- Entity Type is subtype of super Entity Type,
+each combination Entity Type(1), Type Inheritance occurs at most one time in
+ Entity Type(1) is subtype of super Entity Type(2),
Type Inheritance provides identification;
each Presence Constraint occurs at least one time in
- Presence Constraint has min Frequency,
- Presence Constraint has max Frequency,
+ Presence Constraint has min Frequency(2),
+ Presence Constraint has max Frequency(1),
Presence Constraint is mandatory;
each Role Ref occurs at most one time in
Join Role projects Role Ref;
each Role Sequence occurs at least one time in
Role Sequence in Ordinal position includes Role;
each Set Comparison Constraint occurs at least 2 times in
Set Comparison Constraint has in Ordinal position Role Sequence;
-each Term occurs at least one time in
- Term designates Object Type,
- Term is secondary for Object Type,
- Term is name of Role Ref;
-either Value Range has minimum Bound or Value Range has maximum Bound;
+either Value Range has minimum Bound(2) or Value Range has maximum Bound(1);
each combination Vocabulary, Name occurs at most one time in
Constraint belongs to Vocabulary,
Constraint is called Name;
each combination Vocabulary, Name occurs at most one time in
Unit is in Vocabulary,
Unit is called Name;
+each combination Vocabulary, Object Type, Term occurs at most one time in
+ Vocabulary uses Name for Object Type,
+ Term is preferred;