\hypertarget{restrictionComplexContent}{}\subsection{Restriction of complex content}\label{restrictionComplexContent}
Restrictions are easier to map because they only add new constraints, thereby reducing the set of valid instances. The occurrences of elements and attributes may be reduced (though not below the minimum of the parent class) and their types may be narrowed.

In the example below, the complex type 'Bar' restricts 'Foo' by reducing the number of occurrences of element 'foo' from unbounded to 1; by narrowing the type from xs:any\-Simple\-Type to xs:string; and by disallowing mixed content.



\begin{DocInclude}\begin{verbatim}<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" 
        targetNamespace="http://example.org/" xmlns="http://example.org/"
        elementFormDefault="qualified">
        
        <xs:complexType name="Bar" mixed="true">
                <xs:sequence maxOccurs="unbounded">
                        <xs:element name="foobar" type="xs:anySimpleType" />
                </xs:sequence>
        </xs:complexType>
        
        <xs:complexType name="Foo">
                <xs:complexContent>
                        <xs:restriction base="Bar">
                                <xs:sequence>
                                        <xs:element name="foobar" type="xs:string" />
                                </xs:sequence>
                        </xs:restriction>
                </xs:complexContent>
        </xs:complexType>

</xs:schema>
\end{verbatim}
\end{DocInclude}


\hyperlink{classcom_1_1hp_1_1gloze_1_1_gloze}{Gloze} assumes correctness of the schema and asserts the subclass relationship without further checks.



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/restriction.owl
@prefix ns1:     <http://example.org/> .
@prefix xs:      <http://www.w3.org/2001/XMLSchema> .
@prefix ns2:     <http://example.org/def/> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix daml:    <http://www.daml.org/2001/03/daml+oil#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xs_:     <http://www.w3.org/2001/XMLSchema#> .
@prefix :        <#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .

<>    a       owl:Ontology .

ns1:foobar
      a       owl:DatatypeProperty , rdf:Property .

ns1:Bar
      a       owl:Class ;
      rdfs:subClassOf
              [ a       owl:Restriction ;
                owl:allValuesFrom rdfs:Literal ;
                owl:onProperty ns1:foobar
              ] ;
      rdfs:subClassOf
              [ a       owl:Restriction ;
                owl:minCardinality "1"^^xs_:int ;
                owl:onProperty ns1:foobar
              ] .

ns1:Foo
      a       owl:Class ;
      rdfs:subClassOf ns1:Bar ;
      rdfs:subClassOf
              [ a       owl:Restriction ;
                owl:allValuesFrom xs_:string ;
                owl:onProperty ns1:foobar
              ] ;
      rdfs:subClassOf
              [ a       owl:Restriction ;
                owl:cardinality "1"^^xs_:int ;
                owl:onProperty ns1:foobar
              ] .
\end{verbatim}
\end{DocInclude}
 