Value Types
So far, we've been dealing with fairly simple basic categories and combinations of those. Next, we'll go on to look at value types. These are again categories that sit in the hierarchy, but we separate them out for convenience in a special section of the model subsumed under a special built-in category, SymbolicValueType.
Introduce a new Value Type to represent gender, along with a couple of subsumptions:
SymbolicValueType newSub SexValueType.
SexValueType newSub male.
SexValueType newSub female.
The categories, male and female have been given lower case initial letters - this is simply a convention which helps to distinguish between value types and other categories.
Now, a new attribute:
DomainAttribute newAttribute hasSex isSexOf
allAll manyOne.
The sanctioning expression which describes the way this attribute can be combined with categories:
Person grammaticallyAndSensibly hasSex SexValueType.
We've introduced the statement at both the grammatical and sensible levels with one operation. This is simply a time saving measure, and has the same effect as if the statements were introduced individually, i.e. this is exactly the same as:
Person grammatically hasSex SexValueType.
Person sensibly hasSex SexValueType.
We can now evaluate the expression
Person which hasSex male.
Try it, and browse the category to see where it fits in the hierarchy. In a similar way, we'll introduce the concept of age:
SymbolicValueType newSub AgeValueType.
AgeValueType newSub young.
AgeValueType newSub old.
DomainAttribute newAttribute hasAge isAgeOf allAll manyOne.
Person grammaticallyAndSensibly hasAge AgeValueType.
We can combine expressions
(Person which hasSex male) which hasAge young.
We can write this expression more simply using the <...> brackets to put both criteria in a criteria set.
Person which < hasSex male hasAge young >.
We might translate this roughly into English as Person which is male and young which means the same thing as Person which is male which is young.
Similarly, we can form the composite category:
(Person which hasSex female) which hasAge old.
However, the cardinality of the hasSex attribute will prevent us doing anything silly. The expression:
(Person which hasSex male) which hasSex female.
will produce an error if we try and evaluate it, due to the manyOne cardinality of hasSex.