<?xml version="1.0" encoding="UTF-8"?>
<schema version="2.0.2" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:gsml="urn:cgi:xmlns:CGI:GeoSciML:2.0" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:sa="http://www.opengis.net/sampling/1.0" targetNamespace="urn:cgi:xmlns:CGI:GeoSciML:2.0" elementFormDefault="qualified" attributeFormDefault="unqualified"><!-- Schema auto-generated by FullMoon, applying rule suite xmi11ea -->
    <annotation>
        <documentation>The GeoSciML Borehole package contains model elements for representing Boreholes. This is primarily through re-use of standard components from the (external) Observations and Measurements package. 
        
        v2.0.1 - all links to elements in GMD namespace 'by reference'
        v2.0.2 - inserted XML declaration
        </documentation>
        <appinfo>
            <sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron">
                <sch:title>Schematron constraints for "Borehole"</sch:title>
                <sch:ns prefix="sch" uri="http://purl.oclc.org/dsdl/schematron"/>
                <sch:ns prefix="xlink" uri="http://www.w3.org/1999/xlink"/>
                <sch:ns prefix="gsml" uri="urn:cgi:xmlns:CGI:GeoSciML:2.0"/>
            	<sch:ns prefix="gml" uri="http://www.opengis.net/gml"/>
            	<sch:pattern name="Properties for MappedInterval">
            		<sch:rule context="gsml:MappedInterval">
            			<sch:assert test="gsml:shape/gml:Curve or (empty(gsml:shape/*) and @xlink:href)">shape must contain either Curve or nothing (and carry an xlink:href instead)</sch:assert>
            		</sch:rule>
            	</sch:pattern>
            </sch:schema>
        </appinfo>
    </annotation>
    <import namespace="http://www.opengis.net/gml" schemaLocation="http://schemas.opengis.net/gml/3.1.1/base/gml.xsd"/>
    <import namespace="http://www.opengis.net/sampling/1.0" schemaLocation="http://schemas.opengis.net/sampling/1.0.0/sampling.xsd"/>
    <include schemaLocation="geosciml.xsd"/>
    <element name="BoreholeCollar" substitutionGroup="gml:_Feature" type="gsml:BoreholeCollarType">
        <annotation>
            <documentation>A Borehole Collar is a feature corresponding to the start point of a borehole. 
These are often plotted on a map.  If a text descripiton of the location is available, which should be placed in the gml:description for that feature.
If no GM_Point is available, URN:CGI:unknown should be used
Implementers delivering 3-D collar locations should provide and elevation to improve interoperability.</documentation>
        </annotation>
    </element>
    <complexType name="BoreholeCollarType">
        <complexContent>
            <extension base="gml:AbstractFeatureType">
                <sequence>
                    <element name="location" type="gml:PointPropertyType">
                        <annotation>
                            <documentation>The location of the BoreholeCollar</documentation>
                        </annotation>
                    </element>
                    <element name="elevation" type="gml:DirectPositionType">
                        <annotation>
                            <documentation>Compromise approach to supply elevation explictly for location; this is to allow for software that cannot process 3-D GM_Point. Use null if elevation is unknown. Direct position shall have a dimension of 1, and CRS will be a "vertical" CRS (e.g. EPSG CRSs in the range 5600-5799). </documentation>
                        </annotation>
                    </element>
                    <element maxOccurs="unbounded" minOccurs="0" name="borehole" type="gsml:BoreholePropertyType">
                        <annotation>
                            <documentation>The hole that has this collar for its start point</documentation>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="BoreholeCollarPropertyType">
        <sequence minOccurs="0">
            <element ref="gsml:BoreholeCollar"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
    </complexType>
    <element name="MappedInterval" substitutionGroup="gsml:MappedFeature" type="gsml:MappedIntervalType">
        <annotation>
            <documentation>A special kind of Mapped Feature whose shape is 1-D (a curve)</documentation>
        </annotation>
    </element>
    <complexType name="MappedIntervalType">
        <annotation>
            <documentation>The following properties inherited from parent classes are overridden in Schematron assertions:

association: shape</documentation>
        </annotation>
        <complexContent>
            <extension base="gsml:MappedFeatureType"/>
        </complexContent>
    </complexType>
    <complexType name="MappedIntervalPropertyType">
        <sequence minOccurs="0">
            <element ref="gsml:MappedInterval"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
    </complexType>
    <element name="Borehole" substitutionGroup="sa:SamplingCurve" type="gsml:BoreholeType">
        <annotation>
            <documentation>A borehole is the generalized term for any narrow shaft drilled in the ground, either vertically or horizontally.</documentation>
        </annotation>
    </element>
    <complexType name="BoreholeType">
        <complexContent>
            <extension base="sa:SamplingCurveType">
                <sequence>
                    <element name="collarLocation" type="gsml:BoreholeCollarPropertyType">
                        <annotation>
                            <documentation>One end of the GM_Curve that defines the shape
Usually the point at a surface where drilling started. </documentation>
                        </annotation>
                    </element>
                    <element maxOccurs="1" minOccurs="0" name="indexData" type="gsml:BoreholeDetailsPropertyType">
                        <annotation>
                            <documentation>Specifies the Borehole details</documentation>
                        </annotation>
                    </element>
                    <element maxOccurs="unbounded" minOccurs="0" name="logElement" type="gsml:MappedIntervalPropertyType">
                        <annotation>
                            <documentation>Links to 1-D MappedFeature instances that are logged (interpreted) intervals within a borehole. This requirement is common in geoscience boreholes</documentation>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="BoreholePropertyType">
        <sequence minOccurs="0">
            <element ref="gsml:Borehole"/>
        </sequence>
        <attributeGroup ref="gml:AssociationAttributeGroup"/>
    </complexType>
    <element name="BoreholeDetails" type="gsml:BoreholeDetailsType">
        <annotation>
            <documentation>Borehole specific index (or metadata) information</documentation>
        </annotation>
    </element>
    <complexType name="BoreholeDetailsType">
        <sequence>
            <element maxOccurs="1" minOccurs="0" name="operator" type="gml:ReferenceType">
                <annotation>
                    <appinfo>
                        <gml:targetElement>CI_ResponsibleParty</gml:targetElement>
                    </appinfo>
                    <documentation>Organisation responsible for commissioning the borehole (as opposed to drilling the borehole)</documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="driller" type="gml:ReferenceType">
                <annotation>
                    <appinfo>
                        <gml:targetElement>CI_ResponsibleParty</gml:targetElement>
                    </appinfo>
                    <documentation>The organisation responsible for drilling the borehole (as opposed to commissioning the borehole)</documentation>
                </annotation>
            </element>
            <element name="dateOfDrilling" type="gml:CalDate">
                <annotation>
                    <documentation>The date on which drilling of the borehole commenced</documentation>
                </annotation>
            </element>
            <element name="drillingMethod" type="gsml:BoreholeDrillingMethodCodeType">
                <annotation>
                    <documentation>Indicates the drilling method used. Appropriate terms would include Rotary; Shell &amp; Auger; Downhole Air Hammer; Hand Auger etc</documentation>
                </annotation>
            </element>
            <element name="startPoint" type="gsml:BoreholeStartPointCodeType">
                <annotation>
                    <documentation>Indicates the position relative to ground surface where the borehole commenced. Appropriate terms would include Drilled from Ground Surface; Drilled Underground;  Drilled from Quarry Floor etc </documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="nominalDiameter" type="gml:MeasureType">
                <annotation>
                    <documentation>The starting diameter</documentation>
                </annotation>
            </element>
            <element name="inclinationType" type="gsml:BoreholeInclinationCodeType">
                <annotation>
                    <documentation>Indicates the inclination of the borehole. Appropriate terms would include vertical; inclined up; inclined down, horizontal</documentation>
                </annotation>
            </element>
            <element maxOccurs="unbounded" minOccurs="0" name="coredInterval" type="gml:BoundingShapeType">
                <annotation>
                    <documentation>Interval(s) within the borehole from which core was recovered
Use GM_Envelope with 1-D CRS corresponding to borehole curve shape</documentation>
                </annotation>
            </element>
            <element maxOccurs="1" minOccurs="0" name="coreCustodian" type="gml:ReferenceType">
                <annotation>
                    <appinfo>
                        <gml:targetElement>CI_ResponsibleParty</gml:targetElement>
                    </appinfo>
                    <documentation>Organisation that is custodian of the core recovered from the borehole</documentation>
                </annotation>
            </element>
        </sequence>
    </complexType>
    <complexType name="BoreholeDetailsPropertyType">
        <sequence>
            <element ref="gsml:BoreholeDetails"/>
        </sequence>
    </complexType>
    <simpleType name="BoreholeInclinationCodeType">
        <union memberTypes="gsml:BoreholeInclinationCodeEnumerationType gsml:BoreholeInclinationCodeOtherType"/>
    </simpleType>
    <simpleType name="BoreholeInclinationCodeEnumerationType">
        <restriction base="string">
            <enumeration value="vertical"/>
            <enumeration value="horizontal"/>
            <enumeration value="inclined up"/>
            <enumeration value="inclined down"/>
        </restriction>
    </simpleType>
    <simpleType name="BoreholeInclinationCodeOtherType">
        <restriction base="string">
            <pattern value="other: \w{2,}"/>
        </restriction>
    </simpleType>
    <simpleType name="BoreholeStartPointCodeType">
        <union memberTypes="gsml:BoreholeStartPointCodeEnumerationType gsml:BoreholeStartPointCodeOtherType"/>
    </simpleType>
    <simpleType name="BoreholeStartPointCodeEnumerationType">
        <restriction base="string">
            <enumeration value="natural ground surface">
                <annotation>
                    <documentation>drilling started from a natural topographic surface</documentation>
                </annotation>
            </enumeration>
            <enumeration value="open pit floor or wall">
                <annotation>
                    <documentation>Drilling started from the wall of an open pit or quarry</documentation>
                </annotation>
            </enumeration>
            <enumeration value="underground">
                <annotation>
                    <documentation>Drilling started from an underground location, such as a driveway, chamber or open-stope</documentation>
                </annotation>
            </enumeration>
            <enumeration value="from pre-existing hole">
                <annotation>
                    <documentation>New drill hole spudded off the wall of an existing hole</documentation>
                </annotation>
            </enumeration>
        </restriction>
    </simpleType>
    <simpleType name="BoreholeStartPointCodeOtherType">
        <restriction base="string">
            <pattern value="other: \w{2,}"/>
        </restriction>
    </simpleType>
    <simpleType name="BoreholeDrillingMethodCodeType">
        <union memberTypes="gsml:BoreholeDrillingMethodCodeEnumerationType gsml:BoreholeDrillingMethodCodeOtherType"/>
    </simpleType>
    <simpleType name="BoreholeDrillingMethodCodeEnumerationType">
        <restriction base="string">
            <enumeration value="auger">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Auger_drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="hand auger"/>
            <enumeration value="air core">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Air_core_drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="cable tool">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Cable_tool_drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="diamond core">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Diamond_core_drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="direct push">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Direct_Push_Rigs</documentation>
                </annotation>
            </enumeration>
            <enumeration value="hydraulic rotary">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Hydraulic-rotary_drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="RAB">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Percussion_rotary_air_blast_drilling </documentation>
                </annotation>
            </enumeration>
            <enumeration value="RC">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Reverse_circulation</documentation>
                </annotation>
            </enumeration>
            <enumeration value="vibratory">
                <annotation>
                    <documentation>http://en.wikipedia.org/wiki/Drilling_rig#Sonic_%28Vibratory%29_Drilling</documentation>
                </annotation>
            </enumeration>
            <enumeration value="unknown"/>
        </restriction>
    </simpleType>
    <simpleType name="BoreholeDrillingMethodCodeOtherType">
        <restriction base="string">
            <pattern value="other: \w{2,}"/>
        </restriction>
    </simpleType>
</schema>