<?xml version='1.0'?>

<!-- Incorrect Range Indication - Datatype - typed literal doesn't match datatype.
     When given a typed literal, both the type and the value must match.   The type
     can be derived from the expected datatype or the expected datatype can be 
     derived from the given type.  Plus, the value must be in the lexical
     space of the expected datatype.  See examples below -->


<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     ="http://www.daml.org/validator/examples/st10.daml#"
>

<!-- OK -->
<ont1:Man rdf:ID="dave">
  <ont1:name>Dave</ont1:name>
  <ont1:age><xsd:nonNegativeInteger rdf:value="30"/></ont1:age>
</ont1:Man>

<!-- OK - xsd:nonNegativeInteger is derived from xsd:decimal and the value
     '8' is in the lexical space of xsd:nonNegativeInteger.  Values of a 
     'parent' datatype are valid only if they are in the lexical space of the 
     derived datatype. -->
<ont1:Man rdf:ID="brian">
  <ont1:name>Brian</ont1:name>
  <ont1:age><xsd:decimal rdf:value="8"/></ont1:age>
</ont1:Man>


<!-- While the expected datatype is derived from xsd:decimal, the given value
     '10.5' is not in the lexical space of xsd:nonNegativeInteger. -->
<ont1:Man rdf:ID="sean">
  <ont1:name>Sean</ont1:name>
  <ont1:age><xsd:decimal rdf:value="10.5"/></ont1:age>
</ont1:Man>


<!-- OK - xsd:positiveInteger is derived from the expected xsd:nonNegativeInteger.
     All datatypes derived by restriction from the expected datatype are valid. -->
<ont1:Woman rdf:ID="reiko">
  <ont1:name>Reiko</ont1:name>
  <ont1:age><xsd:positiveInteger rdf:value="20"/></ont1:age>
</ont1:Woman>


<!-- This produces an indication because xsd:nonNegativeInteger is not derived from
     xsd:byte, nor the other way around. -->
<ont1:Woman rdf:ID="barrie">
  <ont1:name>Barrie</ont1:name>
  <ont1:age><xsd:byte rdf:value="10"/></ont1:age>
</ont1:Woman>


<!-- Same for xsd:String -->
<ont1:Man rdf:ID="jeff">
  <ont1:name>Jeff</ont1:name>
  <ont1:age><xsd:string rdf:value="40"/></ont1:age>
</ont1:Man>



</rdf:RDF>


