308 12 Building Bioinformatics Ontologies
set of nonnegative numbers as its domain and range. However, ontological
properties differ from functions in two important ways:
- A mathematical function is allowed to have only one value on each do-
main element. A property may, in general, have many values on each
domain element. One sometimes says that properties are “multivalued.”
For example, every positive number actually has two squareroots. The
property that maps every nonnegative number to all of its square roots
has the nonnegative numbers as its domain and all real numbers as its
range. This property is not a mathematical function. - A mathematical function must take a value on every element of its do-
main. A property need not have any values for some domain elements.
Mathematically, properties are onlypartial functionsin general.
Thedomainof a property is the set of entities that are allowed to have that
property. For example, thesupervisorproperty applies only to people.
Therangeof a property is the set of entities that may be values of the prop-
erty. For example, aheightis a nonnegative number. When designing an
ontology it is useful to choose appropriate domains and ranges for proper-
ties. They should be neither too specific nor too general. If a domain or range
is too limiting, then acceptable statements may be disallowed. If a domain
or range is too general, then meaningless statements will be allowed.
A more subtle ontology design issue is to ensure that the property is at-
tached to the right set in the first place. For example, it may seem obvious
that the body temperature is a property of a person. However, this fails to
consider the fact that a person’s body temperature varies with time. This
may be important when one is recording more than one temperature mea-
surement as in the medical chart ontology. As a result, it would be more
appropriate for the domain of the body temperature to be an event rather
than a person.
In XML and XSD, the domain of an attribute is the set of elements that use
the attribute. In the BioML DTD, for example, virtually every element can
have anameattribute, but not every element can have astartattribute.
XML DTDs have only a limited capability for specifying ranges of attributes.
The most commonly used ranges areCDATA(arbitrary text) andNMTOKEN
(which limits the attribute to names using only letters, digits, and a few other
characters such as underscores). XSD has a much more elaborate capability
for specifying attribute ranges, as discussed in section 2.4.