Previous Next

Extending the model to a second classification

Let us consider that we also want to classify vehicles by the type of fuel they use.

Then the best way to do this is in three steps:

  1. Create a hierarchy of kinds of fuel and an attribute linking that hierarchy to vehicles;
  2. Use necessary statements to describe which kinds of vehicle use which kinds of fuel;
  3. Create the general categories such as petrol driven vehicle as composite concepts using which or whichG expressions and giving them convenient names.

To illustrate, create a hierarchy of kinds of fuel by typing the following into the file editor and evaluating it. (Anything between "..." is a comment and is ignored by the compiler.)

Step 1

DomainCategory newSub Fuel.
  Fuel newSub Petrol.
  Fuel newSub Diesel.
  Fuel newSub Electricity.

Step 2

Attribute newAttribute hasFuel isFuelOf allAll manyOne.
Vehicle grammaticallyAndSensibly hasFuel Fuel.
Car topicNecessarily hasFuel Petrol.
Bus topicNecessarily hasFuel Diesel.
Tram topicNecessarily hasFuel Electricity.

Step 3

(Vehicle which hasFuel Petrol) name PetrolVehicle.
(Vehicle which hasFuel Diesel) name DieselVehicle.
(Vehicle which hasFuel Electricity) name ElectricVehicle.

Now browse Car. Note that Car is now classified under both PetrolVehicle and RoadVehicle. We often say that it has two parents.

Also browse DieselVehicle. Finally, browse Vehicle and expand all levels, as illustrated below:

(The carets up-arrow beside categories mean that they have already appeared further up the hierarchy and are visible on this screen.)

Notice that only Train has not been multiply classified because we have not said anything further about trains, because trains can be fuelled by either Diesel or Electricity or Petrol. (We have simplified the world by saying that all buses use diesel and all cars petrol, but that is convenient for the illustration.)

Note therefore that what we have found is not all of the vehicles which might use a particular fuel - that list could be very long indeed, but all of the vehicles which anybody has thought it worth modelling which use a particular fuel.

If we decide it is worth modelling diesel and electric trains, we can add the statements.

(Train which hasFuel Diesel) name DieselTrain.
(Train which hasFuel Electricity) name ElectricTrain.

Then DieselTrain and ElectricTrain will be multiply classified as required.

Previous Next
Making the impossible very difficult, ©, All rights reserved