19 March 2002
©2002 Lucent Technologies, Inc. Frank van Harmelen, and Ian Horrocks.
Male is a class with Animal as its superclass
PrimitiveClass(Male, supers(Animal)) PrimitiveClass(Female, supers(Animal))
Multiple superclasses are allowed;
Note the use of named classes only (ie
no class-expressions);
Note the use of DefinedClass: not only does a Man
have these properties, but anything with these properties (ie being both Person
and Male) is also Man
DefinedClass(Man, supers(Person, Male)) DefinedClass(Woman, supers(Person, Female))
hasMother is a subproperty of hasParent
SubPropertyOf(hasMother, hasParent)
The class Animals has two properties:
hasParent (with range Animal) and
hasMother (with range Female).
hasMother must have at least and at most one
value (ie exactly one value).
hasParent must have at least one value.
The multiplicity constraint is not specified for hasParent, so it defaults
to
the value: "multiplicity=multivalued", ie we may have multiple values.
PrimitiveClass(Animal, slot(hasParent, range=Animal, required) slot(hasMother, range=Female, required, singlevalued))
A further property of Animal is defined.
Notice that class definitions
can be spread over multiple statements.
This is unlike frame-systems, but
crucial in a Web context
SingleValuedProperty(age) PrimitiveClass(Animal, slot(age, range=xsd:NonNegativeInteger, required))
Persons are required to have a parent that is also a person.
The
cardinality constraint of exactly 2 is inexpressible in the light subset of OWL.
Instead we use the weaker standard value multiplicity=multivalue.
A
spouse is optional, but there can be at most one (multiplicity=singlevalued)
and it must be of type person (range=Person).
A height may also be
specified. Modality and multiplicity of this default to optional and multivalued
respectively, so anything is allowed (0, 1 or many values). However, if a person
does have a height, it must be of type Height (range=Height).
PrimitiveClass(Person, slot(hasParent, range=Person, required), slot(hasSpouse, range=Person, optional, singlevalued), slot(hasHeight, range=Height))
shoesize is given a global range, using a datatype. (contrast this with the local range definition in a slot)
Range(shoesize, xsd:decimal)
shoesize is globally stated to be functional. (constrast this with the local definition multiplicity=singlevalued in a slot)
SingleValuedProperty(shoesize) TransitiveProperty(hasAncestor) TransitiveProperty(hasDescendant)
A further property of hasParent is defined.
Like class definitions,
property definitions can be spread over multiple statements.
SubPropertyOf(hasParent, hasAncestor)
disjointness is not a typical frame idiom, but often used, and crucial in a Web context
Disjoint(Male,Female)
These three classes are pairwise disjoint
Disjoint(Car, Person, Plant)
Class identity (= have the same extension)
SameClassAs(HumanBeing, Person)
a MarriedPerson is any Person who has exactly one spouse.
Note the use of
DefinedClass, ie anything with these properties is also a MarriedPeron
Notice the absence of range, ie anything (Thing) can be a spouse
DefinedClass(MarriedPerson, supers(Person), slot(hasSpouse, required, singlevalued))
Adults are any person whose age is over 17 (assuming over17 has been defined as an xsd:simpleType as in the DAML+OIL walkthrough).
DefinedClass(Adult, supers(Person), slot(age, range=foo:over17, required))
Defining an individual with an ID, being of a certain type, and having certain values for various properties
Individual(Adam, Person, (age, xsd:integer, 13), (shoesize, xsd:decimal, 9.5))
defining a class by enumerating its instances
EnumeratedClass(Height, short, medium, tall)
Here we use of a required slot-value to define a class:
TallThing are
anything whose hasHeight slot has only the value tall.
Note the use
of singlevalued, which justified the phrase "has only the value"
Note
the absence of superclasses, ie this is a subclass of Thing.
DefinedClass(TallThing, slot(hasHeight,singlevalued,value=tall))
A more sophisticated version of the Person class above would not only demand that a Person has multiple Persons as their parents, but also require that at least one of them is a Man, and one of them is a Woman:
PrimitiveClass(Person, slot(hasParent, range=Person, required=Man, required=Woman, multivalued))