<commit_before><?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xlink="http://www.w3.org/1999/xlink"
           xmlns:caom2="vos://cadc.nrc.ca!vospace/CADC/xml/CAOM/v2.0"
           targetNamespace="vos://cadc.nrc.ca!vospace/CADC/xml/CAOM/v2.0"
           elementFormDefault="qualified"
           attributeFormDefault="qualified">

    <!-- Observation -->
    <xs:element name="Observation" type="caom2:ObsType" />

    <xs:complexType name="ObsType" abstract="true">
        <xs:sequence>
            <xs:element name="collection" type="xs:string"/>
            <xs:element name="observationID" type="xs:string"/>
            <xs:element name="metaRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The metaRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="sequenceNumber" type="xs:integer" minOccurs="0"/>
            <xs:element name="algorithm" type="caom2:Algorithm"/>
            <xs:element name="type" type="xs:string" minOccurs="0"/>
            <xs:element name="intent" type="caom2:ObservationIntentType" minOccurs="0"/>
            <xs:element name="proposal" type="caom2:Proposal" minOccurs="0"/>
            <xs:element name="target" type="caom2:Target" minOccurs="0"/>
            <xs:element name="telescope" type="caom2:Telescope" minOccurs="0"/>
            <xs:element name="instrument" type="caom2:Instrument" minOccurs="0"/>
            <xs:element name="environment" type="caom2:Environment" minOccurs="0"/>
            <xs:element name="planes" type="caom2:Planes" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:long" use="required"/>
        <xs:attribute name="lastModified" type="xs:string"/>
    </xs:complexType>
    
    <xs:complexType name="SimpleObservation">
        <xs:complexContent>
            <xs:extension base="caom2:ObsType"/>
        </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="CompositeObservation">
        <xs:complexContent>
            <xs:extension base="caom2:ObsType">
                <xs:sequence>
                    <xs:element name="members" type="caom2:ObservationMemberList" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="Algorithm">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Proposal">
        <xs:sequence>
            <xs:element name="id" type="xs:string"/>
            <xs:element name="pi" type="xs:string" minOccurs="0"/>
            <xs:element name="project" type="xs:string" minOccurs="0"/>
            <xs:element name="title" type="xs:string" minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Target">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="type" type="caom2:TargetType" minOccurs="0"/>
            <xs:element name="standard" type="xs:boolean"  minOccurs="0"/>
            <xs:element name="redshift" type="xs:double" minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Telescope">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="geoLocationX" type="xs:double" minOccurs="0"/>
            <xs:element name="geoLocationY" type="xs:double" minOccurs="0"/>
            <xs:element name="geoLocationZ" type="xs:double" minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Instrument">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Environment">
        <xs:sequence>
            <xs:element name="seeing" type="xs:double" minOccurs="0"/>
            <xs:element name="humidity" type="xs:double" minOccurs="0"/>
            <xs:element name="elevation" type="xs:double" minOccurs="0"/>
            <xs:element name="tau" type="xs:double" minOccurs="0"/>
            <xs:element name="wavelengthTau" type="xs:double" minOccurs="0"/>
            <xs:element name="ambientTemp" type="xs:double" minOccurs="0"/>
            <xs:element name="photometric" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="ObservationMemberList">
        <xs:sequence>
            <xs:element name="observationURI" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>
                        The observationURI must be constructed as follows:
                            caom:{collection}/{observationID}
                            
                         TODO: formally specify the ObservationURI type
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    
    <!-- Plane -->
    
    <xs:complexType name="Planes">
        <xs:sequence>
            <xs:element name="plane" type="caom2:Plane" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Plane">
        <xs:sequence>
            <xs:element name="productID" type="xs:string"/>
            <xs:element name="metaRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The metaRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="dataRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The dataRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="dataProductType" type="caom2:DataProductType" minOccurs="0"/>
            <xs:element name="calibrationLevel" type="caom2:CalibrationLevel" minOccurs="0"/>
            <xs:element name="provenance" type="caom2:Provenance" minOccurs="0"/>
            <xs:element name="metrics" type="caom2:Metrics" minOccurs="0"/>
            <xs:element name="artifacts" type="caom2:Artifacts"  minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:long" use="required"/>
        <xs:attribute name="lastModified" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="Provenance">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="version" type="xs:string" minOccurs="0"/>
            <xs:element name="project" type="xs:string" minOccurs="0"/>
            <xs:element name="producer" type="xs:string" minOccurs="0"/>
            <xs:element name="runID" type="xs:string" minOccurs="0"/>
            <xs:element name="reference" type="xs:anyURI" minOccurs="0"/>
            <xs:element name="lastExecuted" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The dataRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
            <xs:element name="inputs" type="caom2:PlaneInputList" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Metrics">
        <xs:sequence>
            <xs:element name="sourceNumberDensity" type="xs:double"  minOccurs="0"/>
            <xs:element name="background" type="xs:double" minOccurs="0"/>
            <xs:element name="backgroundStddev" type="xs:double" minOccurs="0"/>
            <xs:element name="fluxDensityLimit" type="xs:double" minOccurs="0"/>
            <xs:element name="magLimit" type="xs:double" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="EnergyTransition">
        <xs:sequence>
            <xs:element name="species" type="xs:string"/>
            <xs:element name="transition" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="PlaneInputList">
        <xs:sequence>
            <xs:element name="planeURI" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>
                        The planeURI must be constructed as follows:
                            caom:{collection}/{observationID}/{productID}
                        which is based on the observationURI syntax, e.g.:
                            {observationURI}/{productID}

                        TODO: formally specify the PlaneURI type
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    
    <!-- Artifact -->
    <commit_msg>s1447: added target.moving and TargetPosition<commit_after><?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:xlink="http://www.w3.org/1999/xlink"
           xmlns:caom2="vos://cadc.nrc.ca!vospace/CADC/xml/CAOM/v2.0"
           targetNamespace="vos://cadc.nrc.ca!vospace/CADC/xml/CAOM/v2.0"
           elementFormDefault="qualified"
           attributeFormDefault="qualified">

    <!-- Observation -->
    <xs:element name="Observation" type="caom2:ObsType" />

    <xs:complexType name="ObsType" abstract="true">
        <xs:sequence>
            <xs:element name="collection" type="xs:string"/>
            <xs:element name="observationID" type="xs:string"/>
            <xs:element name="metaRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The metaRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="sequenceNumber" type="xs:integer" minOccurs="0"/>
            <xs:element name="algorithm" type="caom2:Algorithm"/>
            <xs:element name="type" type="xs:string" minOccurs="0"/>
            <xs:element name="intent" type="caom2:ObservationIntentType" minOccurs="0"/>
            <xs:element name="proposal" type="caom2:Proposal" minOccurs="0"/>
            <xs:element name="target" type="caom2:Target" minOccurs="0"/>
            <xs:element name="targetPosition" type="caom2:TargetPosition" minOccurs="0"/>
            <xs:element name="telescope" type="caom2:Telescope" minOccurs="0"/>
            <xs:element name="instrument" type="caom2:Instrument" minOccurs="0"/>
            <xs:element name="environment" type="caom2:Environment" minOccurs="0"/>
            <xs:element name="planes" type="caom2:Planes" minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:long" use="required"/>
        <xs:attribute name="lastModified" type="xs:string"/>
    </xs:complexType>
    
    <xs:complexType name="SimpleObservation">
        <xs:complexContent>
            <xs:extension base="caom2:ObsType"/>
        </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="CompositeObservation">
        <xs:complexContent>
            <xs:extension base="caom2:ObsType">
                <xs:sequence>
                    <xs:element name="members" type="caom2:ObservationMemberList" minOccurs="0"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>
    
    <xs:complexType name="Algorithm">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Proposal">
        <xs:sequence>
            <xs:element name="id" type="xs:string"/>
            <xs:element name="pi" type="xs:string" minOccurs="0"/>
            <xs:element name="project" type="xs:string" minOccurs="0"/>
            <xs:element name="title" type="xs:string" minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Target">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="type" type="caom2:TargetType" minOccurs="0"/>
            <xs:element name="standard" type="xs:boolean"  minOccurs="0"/>
            <xs:element name="redshift" type="xs:double" minOccurs="0"/>
            <xs:element name="moving" type="xs:boolean"  minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="TargetPosition">
        <xs:sequence>
            <xs:element name="coordinates" type="caom2:Point" minOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Point">
        <xs:sequence>
            <xs:element name="cval1" type="xs:double" minOccurs="1"/>
            <xs:element name="cval2" type="xs:double" minOccurs="1"/>
        </xs:sequence>
    </xs:complexType>
    <!-- TODO: circle, box, polygon, vertex, etc -->
    
    <xs:complexType name="Telescope">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="geoLocationX" type="xs:double" minOccurs="0"/>
            <xs:element name="geoLocationY" type="xs:double" minOccurs="0"/>
            <xs:element name="geoLocationZ" type="xs:double" minOccurs="0"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Instrument">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Environment">
        <xs:sequence>
            <xs:element name="seeing" type="xs:double" minOccurs="0"/>
            <xs:element name="humidity" type="xs:double" minOccurs="0"/>
            <xs:element name="elevation" type="xs:double" minOccurs="0"/>
            <xs:element name="tau" type="xs:double" minOccurs="0"/>
            <xs:element name="wavelengthTau" type="xs:double" minOccurs="0"/>
            <xs:element name="ambientTemp" type="xs:double" minOccurs="0"/>
            <xs:element name="photometric" type="xs:boolean" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="ObservationMemberList">
        <xs:sequence>
            <xs:element name="observationURI" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>
                        The observationURI must be constructed as follows:
                            caom:{collection}/{observationID}
                            
                         TODO: formally specify the ObservationURI type
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    
    <!-- Plane -->
    
    <xs:complexType name="Planes">
        <xs:sequence>
            <xs:element name="plane" type="caom2:Plane" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
    </xs:complexType>
    
    <xs:complexType name="Plane">
        <xs:sequence>
            <xs:element name="productID" type="xs:string"/>
            <xs:element name="metaRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The metaRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="dataRelease" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The dataRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="dataProductType" type="caom2:DataProductType" minOccurs="0"/>
            <xs:element name="calibrationLevel" type="caom2:CalibrationLevel" minOccurs="0"/>
            <xs:element name="provenance" type="caom2:Provenance" minOccurs="0"/>
            <xs:element name="metrics" type="caom2:Metrics" minOccurs="0"/>
            <xs:element name="artifacts" type="caom2:Artifacts"  minOccurs="0"/>
        </xs:sequence>
        <xs:attribute name="id" type="xs:long" use="required"/>
        <xs:attribute name="lastModified" type="xs:string"/>
    </xs:complexType>

    <xs:complexType name="Provenance">
        <xs:sequence>
            <xs:element name="name" type="xs:string"/>
            <xs:element name="version" type="xs:string" minOccurs="0"/>
            <xs:element name="project" type="xs:string" minOccurs="0"/>
            <xs:element name="producer" type="xs:string" minOccurs="0"/>
            <xs:element name="runID" type="xs:string" minOccurs="0"/>
            <xs:element name="reference" type="xs:anyURI" minOccurs="0"/>
            <xs:element name="lastExecuted" type="xs:string" minOccurs="0">
                <xs:annotation>
                    <xs:documentation>
                        The dataRelease date is expected to be in IVOA date format: 
                        yyyy-MM-dd'T'HH:mm:ss.SSS
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
            <xs:element name="keywords" type="caom2:Keywords" minOccurs="0"/>
            <xs:element name="inputs" type="caom2:PlaneInputList" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Metrics">
        <xs:sequence>
            <xs:element name="sourceNumberDensity" type="xs:double"  minOccurs="0"/>
            <xs:element name="background" type="xs:double" minOccurs="0"/>
            <xs:element name="backgroundStddev" type="xs:double" minOccurs="0"/>
            <xs:element name="fluxDensityLimit" type="xs:double" minOccurs="0"/>
            <xs:element name="magLimit" type="xs:double" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="EnergyTransition">
        <xs:sequence>
            <xs:element name="species" type="xs:string"/>
            <xs:element name="transition" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>
    
    
    
    <xs:complexType name="PlaneInputList">
        <xs:sequence>
            <xs:element name="planeURI" type="xs:anyURI" minOccurs="0" maxOccurs="unbounded">
                <xs:annotation>
                    <xs:documentation>
                        The planeURI must be constructed as follows:
                            caom:{collection}/{observationID}/{productID}
                        which is based on the observationURI syntax, e.g.:
                            {observationURI}/{productID}

                        TODO: formally specify the PlaneURI type
                    </xs:documentation>
                </xs:annotation>
            </xs:element>
        </xs:sequence>
    </xs:complexType>
    
    <!-- Artifact -->
    
{'fraction_non_alphanumeric': 0.15425375331174565, 'fraction_numerical': 0.01005789422039054, 'mean_word_length': 2.2524333812031276, 'pattern_counts': {'":': 0, '<': 367, '<?xml version=': 2, '>': 367, 'https://': 0, 'lorem ipsum': 0, 'www.': 4, 'xml': 12}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1536643', 'n_tokens_mistral': 6184, 'n_tokens_neox': 5966, 'n_words': 1014}