<?xml version="1.0" encoding="iso-8859-1"?>
<!-- File: okstra_basis.xsd -->
<schema targetNamespace="http://schema.okstra.de/1015/okstra" xmlns="http://www.w3.org/2001/XMLSchema" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml" xmlns:okstra="http://schema.okstra.de/1015/okstra" elementFormDefault="qualified" version="1.015">
    <annotation>
        <appinfo source="urn:okstra:okstra-basis:v1.015">okstra_basis.xsd v1.015</appinfo>
        <documentation xml:lang="de">
            GML-Anwendungsschema fuer OKSTRA(R) 1.015, Basis-Schema
        </documentation>
    </annotation>
    <!--  Type-Definitionen und externe Schemata einbeziehen  -->
    <include schemaLocation="okstra_typen.xsd"/>
    <include schemaLocation="okstra_schluesseltabellen.xsd"/>
	<include schemaLocation="okstra_konz_typen.xsd"/>
    <!--  verwendete externe Schemata direkt importieren  -->
    <import namespace="http://www.opengis.net/gml" schemaLocation="./gml/gmlProfileOKSTRA.xsd"/>
    <import namespace="http://www.w3.org/1999/xlink" schemaLocation="./xlink/xlinks.xsd"/>
    <!-- -->
    <!-- ===================================================== -->
    <!-- = globale abstract elements fuer die OKSTRA-Klassen = -->
    <!-- ===================================================== -->
    <!-- -->
    <!-- definiere Basis-Elemente fuer OKSTRA-Elemente -->
    <element name="_OKSTRAObjekt" type="okstra:AbstractOKSTRAObjektType" abstract="true" substitutionGroup="gml:_Feature"/>
    <element name="_OKSTRAHistObjekt" type="okstra:AbstractOKSTRAHistObjektType" abstract="true" substitutionGroup="okstra:_OKSTRAObjekt"/>
    <element name="_Punktobjekt" type="okstra:PunktobjektType" abstract="true" substitutionGroup="okstra:_OKSTRAObjekt"/>
    <element name="_Streckenobjekt" type="okstra:StreckenobjektType" abstract="true" substitutionGroup="okstra:_OKSTRAObjekt"/>
    <element name="_Bereichsobjekt" type="okstra:BereichsobjektType" abstract="true" substitutionGroup="okstra:_OKSTRAObjekt"/>
    <element name="_PunktobjektHist" type="okstra:PunktobjektHistType" abstract="true" substitutionGroup="okstra:_Punktobjekt"/>
    <element name="_StreckenobjektHist" type="okstra:StreckenobjektHistType" abstract="true" substitutionGroup="okstra:_Streckenobjekt"/>
    <element name="_BereichsobjektHist" type="okstra:BereichsobjektHistType" abstract="true" substitutionGroup="okstra:_Bereichsobjekt"/>
    <!-- -->
    <!-- ============================================ -->
    <!-- = zentrale Zeiger- und Mengen-Definitionen = -->
    <!-- ============================================ -->
    <!-- -->
    <!-- Root-Element fuer OKSTRA-FeatureCollection -->
    <element name="OKSTRAObjektmenge" type="okstra:OKSTRAObjektmengeType" substitutionGroup="gml:_FeatureCollection"/>
    <!-- definiere OKSTRAObjektmengeType -->
    <complexType name="OKSTRAPropertyType">
        <complexContent>
            <extension base="gml:FeaturePropertyType">
                <sequence/>
                <attribute name="Objektklasse" type="string" use="optional"/>
            </extension>
        </complexContent>
    </complexType>
    <element name="okstraObjekt" type="okstra:OKSTRAPropertyType" substitutionGroup="gml:featureMember"/>
    <complexType name="OKSTRAObjektmengeType">
        <complexContent>
            <extension base="gml:AbstractFeatureCollectionType"/> 
        </complexContent>
    </complexType>
    <!-- Meta-Daten fuer OKSTRA-Daten -->
    <element name="OKSTRAMetaDaten" type="okstra:OKSTRAMetaDatenType" substitutionGroup="gml:_MetaData"/>
    <complexType name="OKSTRAMetaDatenType" mixed="true">
        <complexContent>
            <extension base="gml:AbstractMetaDataType">
                <sequence>
                    <element name="description" type="string" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="implementation_level" type="string" minOccurs="0"/>
                    <element name="name" type="string" minOccurs="0"/>
                    <element name="time_stamp" type="dateTime" minOccurs="0"/>
                    <element name="author" type="string" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="organization" type="string" minOccurs="0" maxOccurs="unbounded"/>
                    <element name="preprocessor_version" type="string" minOccurs="0"/>
                    <element name="originating_system" type="string" minOccurs="0"/>
                    <element name="authorization" type="string" minOccurs="0"/>
                    <element name="schema_identifiers" type="string" maxOccurs="unbounded"/>
                    <element name="relRep" type="okstra:RelRepType" minOccurs="0"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <simpleType name="RelRepType">
        <restriction base="string">
            <enumeration value="einseitig"/>
            <enumeration value="beidseitig"/>
        </restriction>
    </simpleType>
    <!-- Referenzierungs-Typ fuer OKSTRA-Objekte -->
    <complexType name="ObjectRefType">
        <simpleContent>
            <extension base="string">
                <attributeGroup ref="gml:AssociationAttributeGroup"/>
                <attribute name="Objektklasse" type="string" use="optional"/>
            </extension>
        </simpleContent>
    </complexType>
    <!-- complexType fuer OKSTRA-Schluesseltabellen -->
    <complexType name="KeyValuePropertyType">
        <attributeGroup ref="xlink:simpleLink"/>
        <attribute name="Objektklasse" type="string" use="optional"/>
        <attribute name="Kennung" type="string" use="optional"/>
    </complexType>
    <!-- -->
    <!-- ====================================================== -->
    <!-- = abstrakte OKSTRA-Typen, jeweils als                = -->
    <!-- = historisierende und nicht historisierende Variante = -->
    <!-- ====================================================== -->
    <!-- -->
    <complexType name="AbstractOKSTRAObjektType" abstract="true">
        <complexContent>
            <extension base="gml:AbstractFeatureType"/>
        </complexContent>
    </complexType>
    <group name="HistGroup">
        <sequence>
            <element name="gueltig_von" type="okstra:Datum" minOccurs="0"/>
            <element name="gueltig_bis" type="okstra:Datum" minOccurs="0"/>
            <element name="erzeugt_von_Ereignis" type="okstra:ObjectRefType" minOccurs="0">
                <annotation>
                    <appinfo>
                        <okstra:Zielobjekttyp>Ereignis</okstra:Zielobjekttyp>
                        <okstra:inverseRelation>erzeugt_historisches_Objekt</okstra:inverseRelation>
                    </appinfo>
                </annotation>
            </element>
            <element name="geloescht_von_Ereignis" type="okstra:ObjectRefType" minOccurs="0">
                <annotation>
                    <appinfo>
                        <okstra:Zielobjekttyp>Ereignis</okstra:Zielobjekttyp>
                        <okstra:inverseRelation>loescht_historisches_Objekt</okstra:inverseRelation>
                    </appinfo>
                </annotation>
            </element>
            <element name="hat_Vorgaenger_hist_Objekt" type="okstra:ObjectRefType" minOccurs="0">
                <annotation>
                    <appinfo>
                        <okstra:Zielobjekttyp>historisches_Objekt</okstra:Zielobjekttyp>
                        <okstra:inverseRelation>hat_Nachfolger_hist_Objekt</okstra:inverseRelation>
                    </appinfo>
                </annotation>
            </element>
            <element name="hat_Nachfolger_hist_Objekt" type="okstra:ObjectRefType" minOccurs="0">
                <annotation>
                    <appinfo>
                        <okstra:Zielobjekttyp>historisches_Objekt</okstra:Zielobjekttyp>
                        <okstra:inverseRelation>hat_Vorgaenger_hist_Objekt</okstra:inverseRelation>
                    </appinfo>
                </annotation>
            </element>
        </sequence>
    </group>
    <complexType name="AbstractOKSTRAHistObjektType" abstract="true">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
                    <group ref="okstra:HistGroup"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- -->
    <!-- ==================================================== -->
    <!-- = globale complexTypes fuer die Netzbezugs-Klassen = -->
    <!-- ==================================================== -->
    <!-- -->
    <complexType name="PunktobjektType">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
                    <element name="bei_Strassenpunkt"
           			    type="okstra:StrassenpunktPropertyType" minOccurs="0"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="StreckenobjektType">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
					<element name="hat_Strecke"
						type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>verallgemeinerte_Strecke</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_Streckenobjekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="BereichsobjektType">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
                    <element name="hat_Netzbereich"
                        type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Netzbereich</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_Bereichsobjekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="PunktobjektHistType">
        <complexContent>
            <extension base="okstra:PunktobjektType">
                <sequence>
                    <group ref="okstra:HistGroup"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="StreckenobjektHistType">
        <complexContent>
            <extension base="okstra:StreckenobjektType">
                <sequence>
                    <group ref="okstra:HistGroup"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <complexType name="BereichsobjektHistType">
        <complexContent>
            <extension base="okstra:BereichsobjektType">
                <sequence>
                    <group ref="okstra:HistGroup"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- -->
    <!-- ============================================ -->
    <!-- = Elemente für Annotations                 = -->
    <!-- ============================================ -->
    <!-- -->
    <element name="Zielobjekttyp" type="string"/>
    <element name="inverseRelation" type="string"/>
    <!-- -->
    <!-- ====================================================== -->
    <!-- = voruebergehende Abbildung von Herkunft/Genauigkeit = -->
    <!-- = von Koordinaten ueber GML-Metadaten                = -->
    <!-- ====================================================== -->
    <!-- -->
    <!-- Meta-Daten, temporaer verwendet fuer -->
    <!-- Herkunft und Genauigkeit von Punktkoordinaten -->
    <element name="KoordinatenMetadaten" type="okstra:KoordinatenMetadatenType" substitutionGroup="gml:_MetaData"/>
    <complexType name="KoordinatenMetadatenType" mixed="true">
        <complexContent>
            <extension base="gml:AbstractMetaDataType">
                <sequence>
                    <element name="Herkunft" type="okstra:KoordinatenherkunftPropertyType" minOccurs="0"/>
                    <element name="Herkunft_Land" type="okstra:Koordinatenherkunft_LandPropertyType" minOccurs="0"/>                    
                    <element name="Genauigkeit" type="okstra:Meter" minOccurs="0"/>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <!-- -->
    <!-- ========================================== -->
    <!-- = Bestandteile des Geometrieschemas, die = --> 
    <!-- = auch anderweitig verwendet werden      = -->
    <!-- ========================================== -->
    <!-- -->
    <element name="Punktgeometrie" type="okstra:PunktgeometrieType" substitutionGroup="okstra:_OKSTRAObjekt" />
    <complexType name="PunktgeometrieType">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
                    <!-- Eigenschaften OKSTRA_Objekt -->
                    <element name="OKSTRA_ID" 
                        type="okstra:GUID" minOccurs="0"/>
                    <element name="zu_Beschriftung" 
                        type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Beschriftung</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_OKSTRA_Objekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                    <element name="zu_Kommunikationsobjekt" 
                        type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Kommunikationsobjekt</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_OKSTRA_Objekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                    <!-- Darstellung punktfoermiger Geometrie/Topologie -->
                    <choice minOccurs="0">
                        <element name="dargestellt_von_Punkt" type="gml:PointPropertyType" maxOccurs="unbounded"/>
                        <element name="dargestellt_von_Knoten" type="gml:DirectedNodePropertyType" maxOccurs="unbounded"/>
                    </choice>
                    <!-- Eigenschaften Punktgeometrie -->
                    <element name="Bezugsposition_zu_Beschriftung" 
                        type="okstra:ObjectRefType" minOccurs="0">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Beschriftung</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>hat_Bezugsposition</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
    <element name="Liniengeometrie" type="okstra:LiniengeometrieType" substitutionGroup="okstra:_OKSTRAObjekt" />    
    <complexType name="LiniengeometrieType">
        <complexContent>
            <extension base="okstra:AbstractOKSTRAObjektType">
                <sequence>
                    <!-- Eigenschaften OKSTRA_Objekt -->
                    <element name="OKSTRA_ID" 
                        type="okstra:GUID" minOccurs="0"/>
                    <element name="zu_Beschriftung" 
                        type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Beschriftung</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_OKSTRA_Objekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                    <element name="zu_Kommunikationsobjekt" 
                        type="okstra:ObjectRefType" minOccurs="0" maxOccurs="unbounded">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>Kommunikationsobjekt</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>zu_OKSTRA_Objekt</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                    <!-- Darstellung linienfoermiger Geometrie/Topologie -->
                    <choice minOccurs="0">
                        <element name="dargestellt_von_Linie" type="gml:CurvePropertyType" maxOccurs="unbounded"/>
                        <element name="dargestellt_von_Kante" type="gml:DirectedEdgePropertyType" maxOccurs="unbounded"/>
                    </choice>
                    <!-- Eigenschaften Liniengeometrie -->
                    <element name="zu_AOA_Teilgeometrie_aendern" 
                        type="okstra:ObjectRefType" minOccurs="0">
                        <annotation>
                            <appinfo>
                                <okstra:Zielobjekttyp>AOA_Teilgeometrie_aendern</okstra:Zielobjekttyp>
                                <okstra:inverseRelation>Gesamtgeometrie_neu</okstra:inverseRelation>
                            </appinfo>
                        </annotation>
                    </element>
                </sequence>
            </extension>
        </complexContent>
    </complexType>
</schema>
