12.7 Designing the Properties 311
defined on a general domain, but which do not apply for some subsets. One
cannot specify this in an XML DTD or Perl pattern. The various ontology
languages differ a great deal with respect to their ability to specify cardinality
constraints.
XML DTD.An attribute can only appear once in an element. In other
words, every attribute has maximum cardinality equal to 1. If an attribute is
#IMPLIED, then the attribute is optional. One can specify that an attribute is
#REQUIRED. This is the same as requiring that the cardinality be equal to 1.
The number of occurrences of a child element is specified using the character
in the last column of the table above.
XSD.As in XML DTDs, an attribute can only appear once in an element.
For child elements, the number of occurrences is specified usingminOccurs
andmaxOccurs.
RDF.In this case, properties can have any number of values, and one can-
not impose any cardinality constraints.
OWL.This language has the most elaborate cardinality constraints, and
they can be either global (i.e., applying to the property no matter how it
is used) or local (i.e., applying only to specific uses of the property). The
global cardinality constraints areowl:FunctionalPropertyandowl:
InverseFunctionalProperty. If a property is declared to be anowl:
FunctionalProperty, then it is mathematically a partial function, that is,
it can take at most one value on each domain element. This is the same as
stating that this property has a maximum cardinality equal to 1. If a property
is declared to be anowl:InverseFunctionalProperty, then its inverse
property is a partial function.
The local cardinality constraints are:
- owl:someValuesFrom.A constraint of this kind specifies that the prop-
erty has a minimum cardinality equal to 1 for a specified domain. In ad-
dition, the minimum cardinality must be fulfilled by using values from
a particular class. For example, in the medical chart ontology, suppose
that admission events must be authorized by a doctor. This is specified as
follows:
<owl:Class rdf:about="#Admission">
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="#authorizedBy"/>
<owl:someValuesFrom rdf:resource="#Doctor"/>