Example
Suppose you are writing a rule in a Car Concept and wish to access an
attribute that is defined in the Engine. You can do so this way:
Rule
{
If carEngine\MotorType == “diesel”
{
carFuel = “Diesel”
}
else
{
carFuel = “Gasoline”
}
};
Paths can be deterministic or not, for example:
Concept MyFirstConcept: BaseAttribute
{
Attributes
{
Outputs
{
Integer MyNumber;
}
}
}
Concept MyConcept2: KBEFeature
{
Children
{
KBEFeature MyChild1;
MySecondConcept MyChild2;
}
}
Consider these two paths (starting in MyConcept2):
- MyChild2\MyNumber: this path is deterministic. You can determine
from the Concept Structure that the Attribute MyNumber on the Child MyChild2
exists and is of type Integer.
- MyChild1\MyNumber: this path is NOT deterministic. You only know
that MyChild1 exists and is of type KBEFeature but at this point you do not
know if this BaseAttribute has a MyNumber Attribute. This path is acceptable
from the parser point of view (it might turn out to be wrong at evaluation
though), but its type is unknown. To use it as an Integer, a cast operator has
been introduced:
<Value>:<Type>
. In this example, if you
want to handle the Path as an Integer, you could write:
MyChild1\MyNumber:Integer
.