<?xml version='1.0'?>

<!-- CardinalityIndication - a property restriction on the number of properties on an instance. -->
<!-- maxCardinality -->

<rdf:RDF
  xmlns:rdf ="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
  xmlns:xsd ="http://www.w3.org/2000/10/XMLSchema#"
  xmlns:daml="http://www.daml.org/2001/03/daml+oil#"
  xmlns:ont3="http://www.daml.org/validator/examples/ont3.daml#"
  xmlns:dt2 ="http://www.daml.org/validator/examples/dt2.xsd#"
  xmlns     ="http://www.daml.org/validator/examples/in7.daml#"
>

<!-- A ont3:Person has at most one spouse --> 
<daml:Class rdf:about="http://www.daml.org/validator/examples/ont3.daml#Person">
  <daml:subClassOf>
    <daml:Restriction>
      <daml:onProperty rdf:resource="http://www.daml.org/validator/examples/ont3.daml#hasSpouse"/>
      <daml:maxCardinality>1</daml:maxCardinality>
    </daml:Restriction>
  </daml:subClassOf>
</daml:Class>


<!-- Note: in this example hasSpouse doesn't take on the traditional
meaning.  hasSpouse(x,y) does not imply hasSpouse(y,x) -->

<!-- OK - no spouse -->
<ont3:Person rdf:ID="a1"/>

<!-- OK - one spouse -->
<ont3:Person rdf:ID="a2">
  <ont3:hasSpouse rdf:resource="#a1"/>
</ont3:Person>

<!-- OK - an instance can be defined here -->
<ont3:Person rdf:ID="a4">
  <ont3:hasSpouse><ont3:Person rdf:ID="a5"/></ont3:hasSpouse>
</ont3:Person>

<!-- ERROR - two spouses -->
<ont3:Person rdf:ID="a3">
  <ont3:hasSpouse rdf:resource="#a1"/>
  <ont3:hasSpouse rdf:resource="#a2"/>
</ont3:Person>

</rdf:RDF>
