\hypertarget{sequence}{}\subsection{sequence}\label{sequence}
Compositors like xs:sequence are not represented in OWL because they are primarily concerned with the lexical form of a document. However, they are used to derive restrictions on the cardinality of individual properties appearing within a class. Cardinalities involving xs:sequence are derived by multiplying all nested cardinalities by the minimum and maximum number of occurences of that sequence. By default the minimum and maximum are 1, leaving the nested cardinalities unchanged.

The example below demonstrates this multiplication at work. Element 'foo' has the default cardinality of 1. It's containing sequence has a minimum occurence of 0, so we derive a minimum cardinality of 1$\ast$0=0 on 'foo'. From the default maximum (1) we derive a maximum cardinality on 'foo' of 1$\ast$1=1. A minimum of 0 is no constraint at all, so only the maximum cardinality restriction appears in the OWL.



\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:element name="foo" />
        <xs:element name="bar" />
        
        <xs:element name="foobar">
                <xs:complexType>
                        <xs:sequence minOccurs="0">
                                <xs:element ref="foo" />
                                <xs:element ref="bar" maxOccurs="unbounded"/>
                        </xs:sequence>
                </xs:complexType>
        </xs:element>
        
</xs:schema>
\end{verbatim}
\end{DocInclude}


The element 'bar' is a little more interesting, having an unbounded number of occurrences and a default minimum cardinality of 1. The derived maximum cardinality is 1$\ast$unbounded=unbounded, and in effect unrestricted. Similarly, the derived minimum cardinality is 0$\ast$1=0, also unrestricted. There are therefore no cardinality restrictions on element 'bar'. The, possibly counter-intuitive, result is that 'bar' does not appear in the class definition.



\begin{DocInclude}\begin{verbatim}# Base: http://example.org/sequence.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:bar
      a       rdf:Property .

ns1:foobar
      a       owl:ObjectProperty ;
      rdfs:range
              [ a       owl:Class ;
                rdfs:subClassOf
                        [ a       owl:Restriction ;
                          owl:maxCardinality "1"^^xs_:int ;
                          owl:onProperty ns1:foo
                        ]
              ] .

ns1:foo
      a       rdf:Property .
\end{verbatim}
\end{DocInclude}


Note that the default type of elements 'foo' and 'bar' is xs:any\-Type, which is effectively unconstrained hence there are no ranges defined for either property. Also, because xs:any\-Type is a super-class of xs:any\-Simple\-Type, it is unknown whether or not 'foo' and 'bar' are object or datatype properties (or both).\hypertarget{sequence_sequenceChildren}{}\subsubsection{Child components}\label{sequence_sequenceChildren}
\begin{itemize}
\item \hyperlink{element}{element}\item \hyperlink{choice}{choice}\item \hyperlink{sequence}{sequence}\item \hyperlink{any}{any}\item \hyperlink{group}{group} \end{itemize}
