<?xml version='1.0'?>

<!-- Incorrect Range Indication - Datatypes -->

<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:ont1="http://www.daml.org/validator/examples/ont1.daml#"
  xmlns:dt2 ="http://www.daml.org/validator/examples/dt2.xsd#"
  xmlns     ="http://www.daml.org/validator/examples/in1.daml#"
>

<!-- Set up a class to test daml:toClass -->
<daml:Class rdf:ID="Infant">
  <rdfs:comment>An infant is a person aged 3 or under</rdfs:comment>
  <daml:subClassOf rdf:resource="http://www.daml.org/validator/examples/ont1.daml#Person"/>
  <daml:subClassOf>
    <daml:Restriction>
       <daml:onProperty rdf:resource="http://www.daml.org/validator/examples/ont1.daml#age"/>
       <daml:toClass rdf:resource="http://www.daml.org/validator/examples/dt1.xsd#under4"/>
    </daml:Restriction>
  </daml:subClassOf>
</daml:Class>

<!-- OK - This infant has an age < 4 -->
<Infant rdf:ID="april">
  <ont1:age>2</ont1:age>
</Infant>

<!-- OK - This does not violate the restriction, because there is no age value -->
<Infant rdf:ID="may"/>

<!-- ERROR - The age is > 3 so an indication is generated -->
<Infant rdf:ID="june">
  <ont1:age>10</ont1:age>
</Infant>

<!-- ERROR - The age is not a literal -->
<Infant rdf:ID="august">
  <ont1:age rdf:resource="#may"/>
</Infant>

<!-- OK - This typed value should be ok -->
<Infant rdf:ID="september">
  <ont1:age><xsd:integer rdf:value="2"/></ont1:age>
</Infant>

</rdf:RDF>
