Previous Next

The specialisedBy operator (refinement)

The specialisedBy operator (and its converse form refinedAlong) are slightly more complicated.

The pattern is that Damage to a part is a kind of damage to the whole. For example, damage to a tyre’s tread is a kind of damage to a vehicle. Conversely, a vehicle with a damaged part is itself damaged, e.g. a vehicle with a damaged tyre tread is a kind of damaged vehicle.

To illustrate the point, add the following to the model:

">>>>>>>>>>>>>>>>>>>>>>>
>New attribute and specialisedBy declaration
<<<<<<<<<<<<<<<<<<<<<<<<"
DomainAttribute newAttribute hasLocation isLocationOf allAll manyOne.
hasLocation specialisedBy isPartOf.
">>>>>>>>>>>>>>>>>>>>>>
>Sanctions for hasLocation
<<<<<<<<<<<<<<<<<<<<<<<"
Damage grammaticallyAndSensibly hasLocation VehiclePart.
Damage grammaticallyAndSensibly hasLocation Vehicle.
">>>>>>>>>>>>>>>>>>>>>>>>>>>>
> The definitions for demonstrating specialisedBy
<<<<<<<<<<<<<<<<<<<<<<<<<<<<"
(Wear which hasLocation Tread) name TreadWear.
(Damage which hasLocation Seat) name SeatDamage.
(Damage which hasLocation Vehicle) name VehicleDamage.

Evaluate the above and then browse VehicleDamage. You should find a pattern as shown in the screen dump below. Both SeatDamage and TreadWear are subsumed by VehicleDamage because of the specialisedBy declaration.

To illustrate the effect of the converse pattern, enter the following further definitions, evaluate them and browse DamagedVehicle.

(Tread which isLocationOf Wear)
  name WornTread.
(Seat which isLocationOf Damage)
  name DamagedSeat.
(Car which hasPart (Tyre which hasPart WornTread))
  name CarWithWornTread.
(Bus which hasPart DamagedSeat)
  name BusWithDamagedSeat.
(Vehicle which isLocationOf Damage)
  name DamagedVehicle.

DamagedVehicle should now subsume both CarWithWornTread and BusWithDamagedSeat.

(Note also in passing the use of two levels of parentheses in the definition of CarWithWornTread. GRAIL syntax allows definitions to be nested to any level required, but each category must be enclosed in brackets as shown in the example.)

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