<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.nexml.org/2009"
    xmlns="http://www.nexml.org/2009" xmlns:sawsdl="http://www.w3.org/ns/sawsdl"
    xmlns:xml="http://www.w3.org/XML/1998/namespace" elementFormDefault="qualified">
    <xs:annotation>
        <xs:documentation>
            This module defines concrete subclasses for the 
            <a href="../abstract">abstract</a> character matrix components 
            that all character matrices must implement. The subclasses
            defined here apply to continuous-valued character data, such as
            length or width measurements. In a verbose notation, this data
            is represented as the "state" attribute of the &lt;cell&gt; 
            element. In a compact notation, the same data is represented as
            a sequence of space-separated doubles.
        </xs:documentation>
    </xs:annotation>

    <xs:include schemaLocation="abstractcharacters.xsd"/>


    <xs:simpleType name="ContinuousToken">
        <xs:restriction base="xs:double"/>
    </xs:simpleType>

    <xs:complexType name="ContinuousChar"
        sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#ContinuousCharacter">
        <xs:annotation>
            <xs:documentation> 
                A concrete implementation of the char element, which requires
                only an id attribute.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractChar">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                </xs:sequence>
                <xs:attribute name="states" type="xs:IDREF" use="prohibited"/>
                <xs:attribute name="codon" type="CodonPosition" use="prohibited"/>
                <xs:attribute name="tokens" type="MSTokenLength" use="prohibited"/>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousFormat" abstract="false">
        <xs:annotation>
            <xs:documentation> 
                The ContinuousFormat class is the container of continuous column definitions.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractFormat">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="char" type="ContinuousChar" minOccurs="1"
                        maxOccurs="unbounded"/>
                    <xs:element name="set" minOccurs="0" maxOccurs="unbounded" type="CharSet"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousObs" abstract="false"
        sawsdl:modelReference="http://evolutionaryontology-dev.nescent.org/cdao.owl#ContinuousStateDatum">
        <xs:annotation>
            <xs:documentation> 
                This is a single cell in a matrix containing a continuous
                observation. 
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractObs">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                </xs:sequence>
                <xs:attribute name="char" use="required" type="xs:IDREF"/>
                <xs:attribute name="state" use="required" type="ContinuousToken"/>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:simpleType name="ContinuousSeq">
        <xs:annotation>
            <xs:documentation> 
                This is a simple type that specifies 
                a list of xs:double characters.
            </xs:documentation>
        </xs:annotation>
        <xs:restriction base="AbstractTokenList"/>
    </xs:simpleType>

    <xs:complexType name="ContinuousMatrixSeqRow" abstract="false">
        <xs:annotation>
            <xs:documentation> 
                This is a row in a matrix of continuous data as character sequences. 
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractSeqRow">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                    <xs:element name="seq" minOccurs="1" maxOccurs="1" type="ContinuousSeq"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousMatrixObsRow" abstract="false">
        <xs:annotation>
            <xs:documentation> 
                This is a row in a matrix of continuous data as granular obervations. 
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractObsRow">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                    <xs:element name="cell" minOccurs="1" maxOccurs="unbounded" type="ContinuousObs"
                    />
                    <xs:element name="set" minOccurs="0" maxOccurs="unbounded" type="CellSet"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousSeqMatrix" abstract="false">
        <xs:annotation>
            <xs:documentation>
                A matrix of rows with seq strings of type continuous.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractSeqMatrix">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="row" minOccurs="1" maxOccurs="unbounded"
                        type="ContinuousMatrixSeqRow"/>
                    <xs:element name="set" minOccurs="0" maxOccurs="unbounded" type="RowSet"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousObsMatrix" abstract="false">
        <xs:annotation>
            <xs:documentation>
                A matrix of rows with single character observations.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractObsMatrix">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="row" minOccurs="1" maxOccurs="unbounded"
                        type="ContinuousMatrixObsRow"/>
                    <xs:element name="set" minOccurs="0" maxOccurs="unbounded" type="RowSet"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousSeqs" abstract="false">
        <xs:annotation>
            <xs:documentation>
                A continuous characters block consisting of float sequences preceded by metadata.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractSeqs">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                    <xs:element name="format" minOccurs="1" maxOccurs="1" type="ContinuousFormat"/>
                    <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="ContinuousSeqMatrix"
                    />
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="ContinuousCells" abstract="false">
        <xs:annotation>
            <xs:documentation>
                A continuous characters block consisting of granular cells preceded by metadata.
            </xs:documentation>
        </xs:annotation>
        <xs:complexContent>
            <xs:restriction base="AbstractCells">
                <xs:sequence minOccurs="1" maxOccurs="1">
                    <xs:element name="meta" minOccurs="0" maxOccurs="unbounded" type="Meta"/>
                    <xs:element name="format" minOccurs="1" maxOccurs="1" type="ContinuousFormat"/>
                    <xs:element name="matrix" minOccurs="1" maxOccurs="1" type="ContinuousObsMatrix"
                    />
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

</xs:schema>
