<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
    xmlns:pxb="http://www.cnrtl.fr/lexiques/prolex/"
    targetNamespace="http://www.cnrtl.fr/lexiques/prolex/" elementFormDefault="qualified">
    
    <element name="LexicalRessource" type="pxb:LexicalRessource_type">
        <key name="senseAxis_key">
            <selector xpath="./pxb:SenseAxis"/>
            <field xpath="@id"/>
        </key>
        <key name="senseAxisRelation_key">
            <selector xpath="./pxb:SenseAxis/pxb:SenseAxisRelation"/>
            <field xpath="@id"/>
        </key>
        <keyref name="senseAxis_senseAxisRelation_references" refer="pxb:senseAxis_key">
            <selector xpath="./pxb:SenseAxis/pxb:SenseAxisRelation"/>
            <field xpath="@target"/>
        </keyref>
        <keyref name="senseAxis_sense_references" refer="pxb:senseAxis_key">
            <selector xpath="./pxb:Lexicon/pxb:LexicalEntry/pxb:Sense"/>
            <field xpath="@refSenseAxis"/>
        </keyref>
        <keyref name="senseAxisRelation_syntacticBehaviour_references" refer="pxb:senseAxisRelation_key">
            <selector xpath="./pxb:Lexicon/pxb:LexicalEntry/pxb:Sense/pxb:SyntacticBehaviour"/>
            <field xpath="@refSenseAxisRelation"/>
        </keyref>     
    </element>
    
    <element name="GlobalInformation" type="pxb:GlobalInformation_type"/>
    
    <element name="Lexicon" type="pxb:Lexicon_type">
        <key name="subcategorizationFrame_key">
            <selector xpath="./pxb:SubcategorisationFrame"/>
            <field xpath="@id"/>
        </key>
        <keyref name="subcategorizationFrame_references" refer="pxb:subcategorizationFrame_key">
            <selector xpath="./pxb:LexicalEntry/pxb:Sense/pxb:SyntacticBehaviour"/>
            <field xpath="@refSubcategorizationFrame"/>
        </keyref>
    </element>
    
    <element name="LexicalEntry" type="pxb:LexicalEntry_type"/>
    
    <element name="Lemma" type="pxb:Word_type"/>
    
    <element name="WordForm" type="pxb:WordForm_type"/>
    
    <element name="FormRepresentation" type="pxb:Word_type"/>
    
    <element name="Sense" type="pxb:Sense_type"/>
    
    <element name="MonolingualExternalRef" type="pxb:ExternalRef_type"/>
    
    <element name="SyntacticBehaviour" type="pxb:SyntacticBehaviour_type"/>
    
    <element name="SubcategorizationFrame" type="pxb:SubcategorizationFrame_type"/>
    
    <element name="SenseAxis" type="pxb:SenseAxis_type"/>
    
    <element name="SenseAxisRelation" type="pxb:SenseAxisRelation_type"/>
    
    <element name="InterlingualExternalRef" type="pxb:ExternalRef_type"/>
    
    <complexType name="LexicalRessource_type">
        <sequence>
            <element ref="pxb:GlobalInformation"/>
            <element ref="pxb:Lexicon" maxOccurs="unbounded"/>
            <element ref="pxb:SenseAxis" maxOccurs="unbounded"/>
        </sequence>
    </complexType>
    
    <complexType name="GlobalInformation_type">
        <attribute name="entrySource" type="string" use="required"/>
        <attribute name="languageCoding" type="string" use="required"/>
        <attribute name="resourceName" type="string" use="required"/>
        <attribute name="version" type="string" use="required"/>
    </complexType>
    
    <complexType name="Lexicon_type">
        <sequence>
            <element ref="pxb:LexicalEntry" maxOccurs="unbounded"/>
            <element ref="pxb:SubcategorizationFrame" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="languageIdentifier" use="required">
            <simpleType>
                <restriction base="string">
                    <pattern value="[a-z][a-z][a-z]"/>
                </restriction>
            </simpleType>
        </attribute>
        <attribute name="script" type="string" use="optional"/> 
    </complexType>
    
    <complexType name="LexicalEntry_type">
        <sequence>
            <element ref="pxb:Lemma"/>
            <element ref="pxb:WordForm" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="pxb:Sense" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="partOfSpeech" use="required">
            <simpleType>
                <restriction base="string">
                    <enumeration value="adjective"/>
                    <enumeration value="noun"/>
                    <enumeration value="prefix"/>
                    <enumeration value="verb"/>
                </restriction>
            </simpleType>
        </attribute>
    </complexType>
    
    <complexType name="Word_type">
        <simpleContent>
            <extension base="string">
                <attribute name="script" type="string" use="optional"/>
                <attribute name="orthographyName" type="string" use="optional"/>
            </extension>
        </simpleContent>
    </complexType>
    
    <complexType name="WordForm_type">
        <simpleContent>
            <extension base="string">
                <attribute name="script" type="string" use="optional"/>
                <attribute name="orthographyName" type="string" use="optional"/>
                <attribute name="grammaticalGender" type="pxb:Gender_type" use="optional"/>
                <attribute name="grammaticalNumber" type="pxb:Number_type" use="optional"/>
                <attribute name="grammaticalTense" type="string" use="optional"/>
                <attribute name="grammaticalMood" type="string" use="optional"/>
                <attribute name="grammaticalPerson" type="string" use="optional"/>
            </extension>
        </simpleContent>
    </complexType>
    
    <simpleType name="Gender_type">
        <restriction base="string">
            <enumeration value="masculine"/>
            <enumeration value="feminine"/>
            <enumeration value="masculineFeminine"/>
            <enumeration value="none"/>
        </restriction>
    </simpleType>
    
    <simpleType name="Number_type">
        <restriction base="string">
            <enumeration value="singular"/>
            <enumeration value="plural"/>
            <enumeration value="singularPlural"/>
            <enumeration value="none"/>
        </restriction>
    </simpleType>
    
    <complexType name="Sense_type">
        <sequence>
            <element ref="pxb:SyntacticBehaviour" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="pxb:MonolingualExternalRef" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="id" type="integer" use="required"/> 
        <attribute name="refSenseAxis" type="integer" use="required"/>
        <attribute name="refSense" type="integer" use="required"/>
        <attribute name="label" use="optional">
            <simpleType>
                <restriction base="string">
                    <enumeration value="alias"/>
                    <enumeration value="derivative"/>
                </restriction>
            </simpleType>
         </attribute>
         <attribute name="termProvenance" use="required">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="fullForm"/>
                        <enumeration value="abbreviation"/>
                        <enumeration value="variant"/>
                        <enumeration value="shortForm"/>
                        <enumeration value="diatopicQuasiSynonym"/>
                        <enumeration value="diastraticQuasiSynonym"/>
                        <enumeration value="transcribedForm"/>
                        <enumeration value="acronym"/>
                        <enumeration value="explanation"/>
                        <enumeration value="translationVariant"/>
                        <enumeration value="relationalAdjectif"/>
                        <enumeration value="possessiveAdjective"/>
                        <enumeration value="quasiRelationalAdjective"/>
                        <enumeration value="relationalName"/>
                        <enumeration value="quasiRelationalName"/>
                        <enumeration value="masculineRelationalName"/>
                        <enumeration value="feminineRelationalName"/>
                        <enumeration value="prefix"/>
                    </restriction>
                </simpleType>
         </attribute>
         <attribute name="frequency" use="required">
                <simpleType>
                    <restriction base="string">
                        <enumeration value="infrequentlyUsed"/>
                        <enumeration value="rarelyUsed"/>
                        <enumeration value="commonlyUsed"/>
                    </restriction>
                </simpleType>
         </attribute>
    </complexType>
        
    <complexType name="ExternalRef_type">
        <attribute name="externalSystem" type="string" use="required"/>
        <attribute name="externalReference" type="string" use="required"/>
    </complexType>
    
    <complexType name="SyntacticBehaviour_type">
        <attribute name="refSubcategorizationFrame" type="string" use="required"/>
        <attribute name="refSenseAxisRelation" type="string" use="optional"/>
    </complexType>
    
    <complexType name="SubcategorizationFrame_type">
        <simpleContent>
            <extension base="string">
                <attribute name="id" type="integer" use="required"/>
                <attribute name="introducer" use="required">
                    <simpleType>
                        <restriction base="string">
                            <enumeration value="determiner"/>
                            <enumeration value="locativePreposition"/>
                            <enumeration value="classifyingContext"/>
                            <enumeration value="accessibilityContext"/>
                        </restriction>
                    </simpleType>
                </attribute>
                <attribute name="grammaticalGender" type="pxb:Gender_type" use="optional"/>
                <attribute name="grammaticalNumber" type="pxb:Number_type" use="optional"/>
                <attribute name="restrictionRank" type="integer" use="optional"/>
            </extension>
        </simpleContent>
    </complexType>
    
    <complexType name="SenseAxis_type">
        <sequence>
            <element ref="pxb:SenseAxisRelation" minOccurs="0" maxOccurs="unbounded"/>
            <element ref="pxb:InterlingualExternalRef" minOccurs="0" maxOccurs="unbounded"/>
        </sequence>
        <attribute name="id" type="integer" use="required"/>
    </complexType>
    
    <complexType name="SenseAxisRelation_type">
        <attribute name="id" type="integer" use="required"/>
        <attribute name="label" use="required">
            <simpleType>
                <restriction base="string">
                    <enumeration value="partitiveRelation"/>
                    <enumeration value="quasiSynonymy"/>
                    <enumeration value="associativeRelation"/>
                </restriction>
            </simpleType>
        </attribute>
        <attribute name="target" type="integer" use="required"/>
        <attribute name="subjectField" use="optional">
            <simpleType>
                <restriction base="string">
                    <enumeration value="relative"/>
                    <enumeration value="capital"/>
                    <enumeration value="leader"/>
                    <enumeration value="founder"/>
                    <enumeration value="follower"/>
                    <enumeration value="creator"/>
                    <enumeration value="manager"/>
                    <enumeration value="tenant"/>
                    <enumeration value="heir"/>
                    <enumeration value="headquaters"/>
                    <enumeration value="rival"/>
                    <enumeration value="companion"/>
                </restriction>
            </simpleType>
        </attribute>
        <attribute name="usageNote" use="optional">
            <simpleType>
                <restriction base="string">
                    <enumeration value="diaphasic"/>
                    <enumeration value="diachronic"/>
                    <enumeration value="diastratic"/>
                </restriction>
            </simpleType>
        </attribute>
    </complexType>
    
</schema>

