skip to main content
Corticon Studio: Rule Modeling Guide : Building the Vocabulary : Custom Data Types : Enumerations : How enumeration labels and values behave
 

Try Corticon Now
How enumeration labels and values behave
Before you start setting up and using enumerations, you should get acquainted with labels and values.
Note: It is important that you determine whether you want to use labels, as changing a set of enumerations later to add or remove the labels data will impact any Rulesheets and Ruletests that use that custom data type's enumerations as you can observe in this topic.
At the Vocabulary root, we created a String enumeration with only values. The base data type can be any Corticon data type except boolean. Every line requires a unique entry of its type, and the list must have no blank lines from the top down to the last line.
The following examples are String values. They can contain spaces and pretty much any other character. It needs to be set off in plain single quote marks. If you enter or paste text with the delimiters, they are added for you. Like this:
If you want to use labels, the label is always a String of any alphanumeric characters but cannot contain spaces. Each must be unique and must have a corresponding value. Even when you use labels, the values must be unique.
We set the Glove.color to use the colorUnlabeled data type:
We set the Ball.color to use the colorLabeled data type:
When we create a Rulesheet, the list offered at A1 contains the label (Ball.color = red) , while the list offered at B1 contains the value in qoutes (Glove.color='red').
We added Rule Statements so that we can see how the labeled and unlabeled items are handled.
In a simle Ruletest, we add some size tests to see what results. As shown, the labels and values in the result Output are both unquoted. The Rule Messages display the value when the label was in use and the value of the value-only enumeration.
Entry of test values in the Ruletest list the label+value's label...
… while the value-only list has quoted values...
… but both are reconciled to unquoted values in the displayed Input and Output.
Note: It is important that you determine in each custom data type whether you want to use labels. Some enumerations can have labels while others do not. Changing a set of enumerations later to add or remove the labels data will impact any Rulesheets and Ruletests that use that custom data type's enumerations as you can observe in this topic.