Customizing the metamodel : Specifying key and keyed by properties : Examples of key and keyed by : Example of using the where clause
  
Example of using the where clause
We want to specify that a “car version” fits into a category of automobiles: it will be an SUV; a sub-compact; a compact; a midsize sedan; a full size sedan; a luxury car; or a truck. Since this list is fairly stable, you do not need to create a new definition type for it. You create a list of “vehicle types”.
LIST "Vehicle Types"
{
Value "SUV"
Value "Sub-Compact"
Value "Compact"
Value "Midsize Sedan"
Value "Fullsize Sedan"
Value "Luxury Sedan"
Value "Convertible"
Value "Truck"
}
Definition "Car Version"
{
Property "Car Model"
{Key Edit oneOf "Car Model" KEYED BY {"Make":"Brand", Name} RELATE BY "is keyed by"}
Property "Brand"
{KEY EDIT OneOf "Car Brand" RELATE BY "is keyed by"}Property "Vehicle Type"{EDIT Text List "Vehicle Types" DEFAULT "Midsize Sedan"}}
Where clause continued
Create a new definition of type “SUV Ad Campaign”. In a property of this definition, we want users to be able to select instances of automobiles of a certain type. In other words, you want this property to be filtered to contain only the instances of definitions in the encyclopedia that satisfy the stated condition of 'vehicle type' = 'SUV'. Use the WHERE clause to provide this filtering.
Definition "SUV Ad Campaign"
{
Property "SUV Type"
{ Edit OneOf "Vehicle Types" WHERE "Vehicle Types" = "SUV" }
}