<?xml version="1.0" encoding="UTF-8"?>
<!-- edited with XMLSpy v2009 sp1 (http://www.altova.com) by ICT (Stichting Deltares) -->
<!--  Delft FEWS Published Interface (Copyright 2003 WL | Delft Hydraulics) -->
<schema xmlns:fews="http://www.wldelft.nl/fews/PI" xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.wldelft.nl/fews/PI" elementFormDefault="qualified" attributeFormDefault="unqualified" version="1.0">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="RatingCurves" type="fews:RatingCurvesComplexType">
		<annotation>
			<documentation>Time series data represent data collected over a given period of time at a specific location</documentation>
		</annotation>
	</element>
	<complexType name="RatingCurvesComplexType">
		<annotation>
			<documentation>Time series data represent data collected over a given period of time at a specific location</documentation>
		</annotation>
		<sequence>
			<group ref="fews:TimeZoneChoice" minOccurs="0"/>
			<element name="ratingCurve" type="fews:RatingCurveComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Rating curve applicable form start date to end date</documentation>
				</annotation>
			</element>
		</sequence>
		<attribute name="version" type="fews:versionString" use="optional" default="1.2">
			<annotation>
				<documentation>The version of the published interface schemas</documentation>
			</annotation>
		</attribute>
	</complexType>
	<complexType name="RatingCurveComplexType">
		<annotation>
			<documentation>Rating curve</documentation>
		</annotation>
		<sequence>
			<element name="header" type="fews:RatingCurveHeaderComplexType">
				<annotation>
					<documentation>
                        The header is used to specify the link to the location
                        and the contents</documentation>
				</annotation>
			</element>
			<choice>
				<element name="table" type="fews:RatingCurveTableComplexType" minOccurs="0">
					<annotation>
						<documentation>
                    </documentation>
					</annotation>
				</element>
				<element name="powerEquation" type="fews:PowerEquationComplexType" minOccurs="0" maxOccurs="unbounded">
					<annotation>
						<documentation>Since 2017.02  Power type equation Discharge = cr ( stage - a )^beta</documentation>
					</annotation>
				</element>
				<element name="season" type="fews:SeasonalRatingComplexType" minOccurs="0" maxOccurs="unbounded">
					<annotation>
						<documentation>Since 2019.02. A rating curve which is only available during a period (season) of the year</documentation>
					</annotation>
				</element>
			</choice>
		</sequence>
	</complexType>
	<complexType name="SeasonalRatingComplexType">
		<sequence>
			<element name="startMonthDay" type="gMonthDay">
				<annotation>
					<documentation>Start month and day of this season.</documentation>
				</annotation>
			</element>
			<element name="endMonthDay" type="gMonthDay">
				<annotation>
					<documentation>End month and day of this season.</documentation>
				</annotation>
			</element>
			<choice>
				<element name="powerEquation" type="fews:PowerEquationComplexType" maxOccurs="unbounded">
					<annotation>
						<documentation>Since 2017.02  Power type equation Discharge = cr ( stage - a )^beta</documentation>
					</annotation>
				</element>
				<element name="table" type="fews:RatingCurveTableComplexType"/>
			</choice>
		</sequence>
		<attribute name="name" type="fews:nameString" use="required">
			<annotation>
				<documentation>the name of the season</documentation>
			</annotation>
		</attribute>
	</complexType>
	<complexType name="RatingCurveHeaderComplexType">
		<annotation>
			<documentation>The header is used to specify the link to the location
                and the contents</documentation>
		</annotation>
		<sequence>
			<element name="locationId" type="fews:LocationIdSimpleType"/>
			<element name="qualifierId" type="fews:idString" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>
						Further clarification of the time series, when the parameter, location and time step are not enough to
						identify a time series.
						Multiple qualifiers are allowed, the order of the qualifiers is insignificant.
						A different order of the qualifier ids should not map to the an other time series.
					</documentation>
				</annotation>
			</element>
			<element name="startDate" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>Date this rating curve becomes active</documentation>
				</annotation>
			</element>
			<element name="endDate" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>Date this rating curve is replaced by a new one</documentation>
				</annotation>
			</element>
			<element name="longName" type="string" minOccurs="0">
				<annotation>
					<documentation>Optional long (descriptive) name</documentation>
				</annotation>
			</element>
			<element name="stationName" type="fews:nameString" minOccurs="0">
				<annotation>
					<documentation>Station name</documentation>
				</annotation>
			</element>
			<element name="stageUnit" type="string">
				<annotation>
					<documentation>String that identifies the stage unit used</documentation>
				</annotation>
			</element>
			<element name="dischargeUnit" type="string" minOccurs="0">
				<annotation>
					<documentation>String that identifies the stage units used</documentation>
				</annotation>
			</element>
			<element name="sourceOrganisation" type="string" minOccurs="0"/>
			<element name="sourceSystem" type="string" minOccurs="0"/>
			<element name="fileDescription" type="string" minOccurs="0">
				<annotation>
					<documentation>Description of (the content of)
                        this file</documentation>
				</annotation>
			</element>
			<element name="comment" type="fews:commentString" minOccurs="0">
				<annotation>
					<documentation>use this field as a notebook to add comments</documentation>
				</annotation>
			</element>
			<element name="creationDate" type="date" minOccurs="0">
				<annotation>
					<documentation>Date on which this rating curve was
                        created</documentation>
				</annotation>
			</element>
			<element name="creationTime" type="time" minOccurs="0">
				<annotation>
					<documentation>Time on which this rating curve was created</documentation>
				</annotation>
			</element>
			<element name="region" type="string" minOccurs="0">
				<annotation>
					<documentation>code/description of the region. Needed if the id's
                        can be the same in different regions.</documentation>
				</annotation>
			</element>
			<element name="properties" type="fews:PropertiesComplexType" minOccurs="0">
				<annotation>
					<documentation>Since 2023.01 Properties applicable to this rating curve</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<complexType name="RatingCurveTableComplexType">
		<sequence>
			<element name="interpolationMethod" type="fews:RatingCurveTableInterpolationMethod">
				<annotation>
					<documentation>
					</documentation>
				</annotation>
			</element>
			<element name="minStage" type="float">
				<annotation>
					<documentation>
						Minimum allowable stage to which Rating Curve may be extended at the lower end;
					</documentation>
				</annotation>
			</element>
			<element name="maxStage" type="float">
				<annotation>
					<documentation>
						Maximum allowable stage to which Rating Curve may be extended at the upper end;
					</documentation>
				</annotation>
			</element>
			<element name="row" type="fews:RatingCurveTableRowComplexType" minOccurs="2" maxOccurs="unbounded">
				<annotation>
					<documentation>
						stage/ discharge pair
					</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<complexType name="RatingCurveTableRowComplexType">
		<annotation>
			<documentation/>
		</annotation>
		<attribute name="stage" type="float" use="required">
			<annotation>
				<documentation>Stage value.</documentation>
			</annotation>
		</attribute>
		<attribute name="discharge" type="float" use="required">
			<annotation>
				<documentation>Discharge value.</documentation>
			</annotation>
		</attribute>
		<attribute name="logScaleStageOffset" type="float" use="optional">
			<annotation>
				<documentation>Offsets to shift the Rating Curve so that it is a straight line on	 a logarithmic plot. By default the offset for the previous row is used</documentation>
			</annotation>
		</attribute>
		<attribute name="flag" type="int" use="optional">
			<annotation>
				<documentation>Quality flag assigned to converted value.  3 = doubtful, 6 = unreliable</documentation>
			</annotation>
		</attribute>
	</complexType>
	<complexType name="PowerEquationComplexType">
		<annotation>
			<documentation>Power type equation.
				Discharge = cr ( stage - a )^beta + Q0
				Stage = ((discharge - Q0)/cr)^(1/beta) + alpha</documentation>
		</annotation>
		<attribute name="minStage" type="float" use="required">
			<annotation>
				<documentation>Minimum stage for which this equation is valid</documentation>
			</annotation>
		</attribute>
		<attribute name="maxStage" type="float" use="required">
			<annotation>
				<documentation>Maximum stage for which this equation is valid.</documentation>
			</annotation>
		</attribute>
		<attribute name="flag" type="int" use="optional">
			<annotation>
				<documentation>Quality flag assigned to results of this equation 3 = doubtful, 6 = unreliable</documentation>
			</annotation>
		</attribute>
		<attribute name="alpha" type="float" use="required">
			<annotation>
				<documentation>Stage corresponding to zero discharge</documentation>
			</annotation>
		</attribute>
		<attribute name="cr" type="float" use="required">
			<annotation>
				<documentation>Coefficient</documentation>
			</annotation>
		</attribute>
		<attribute name="beta" type="float" use="required">
			<annotation>
				<documentation>Coefficient</documentation>
			</annotation>
		</attribute>
		<attribute name="Q0" type="float" use="optional">
			<annotation>
				<documentation>Q0 in units specified with dischargeUnit. If no dischargeUnit is configured, in m3/s. The default value is 0</documentation>
			</annotation>
		</attribute>
	</complexType>
	<simpleType name="RatingCurveTableInterpolationMethod">
		<restriction base="string">
			<enumeration value="linear"/>
			<enumeration value="logarithmic"/>
		</restriction>
	</simpleType>
</schema>
