<?xml version="1.0" encoding="UTF-8"?>
<!--  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"
		xmlns:jaxb="http://java.sun.com/xml/ns/jaxb" jaxb:version="1.0">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="TimeSeries" type="fews:TimeSeriesCollectionComplexType">
		<annotation>
			<documentation>Time series data represent data collected over a given period of time at a specific location</documentation>
		</annotation>
	</element>
	<complexType name="TimeSeriesCollectionComplexType">
		<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="series" type="fews:TimeSeriesComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Time series data represent data collected over a given
                        period of time at a specific location</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="TimeSeriesComplexType">
		<annotation>
			<documentation>Time series data represent data collected over a given
                period of time at a specific location</documentation>
		</annotation>
		<sequence>
			<element name="header" type="fews:HeaderComplexType">
				<annotation>
					<documentation>
                        The header is used to specify the link to the location
                        and the contents</documentation>
				</annotation>
			</element>
			<sequence minOccurs="0" maxOccurs="unbounded">
				<element name="properties" type="fews:PropertiesComplexType" minOccurs="0">
					<annotation>
						<documentation>Since 2014.01. Properties that are applicable to the events following</documentation>
					</annotation>
				</element>
				<element name="domainAxisValues" type="fews:DomainAxisValuesComplexType" minOccurs="0" maxOccurs="unbounded">
					<annotation>
						<documentation>Since 2015.01. Defines the domain axis values for the specified parameter</documentation>
					</annotation>
				</element>
				<element name="event" type="fews:EventComplexType" minOccurs="0" maxOccurs="unbounded">
					<annotation>
						<documentation>unlimited number of events with a constant timeStep.
							The date, time and value attributes are required, the
							quality flag is optional. When no events exists the event values are stored in a bin file.
							The binary file has the same name as the xml file only the extension is "bin" instead of "xml".
							The bin file contains only IEEE 32 bit reals. The length of the bin file is 4 times the number of events for all time series in the file.
							The byte order in the bin file is always Intel x86. The bin file is only allowed for equidistant time steps.
						</documentation>
					</annotation>
				</element>
			</sequence>
			<element name="comment" type="fews:commentString" minOccurs="0">
				<annotation>
					<documentation>use this field as a notebook to add comments, suggestions
                        description of data entered etc.</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<complexType name="HeaderComplexType">
		<annotation>
			<documentation>The header is used to specify the link to the location
                and the contents</documentation>
		</annotation>
		<sequence>
			<element name="type" type="fews:timeSeriesType">
				<annotation>
					<documentation>
                        Type of data, either accumulative or instantaneous.
                        For accumulative data the time/date of the event is
                        the moment at which the data was gathered.
                    </documentation>
				</annotation>
			</element>
			<element name="moduleInstanceId" type="fews:idStringType" minOccurs="0">
				<annotation>
					<documentation>Since 2015.02 pi version 1.17</documentation>
				</annotation>
			</element>
			<element name="locationId" type="fews:LocationIdSimpleType"/>
			<element name="parameterId" type="fews:ParameterSimpleType"/>
			<element name="domainParameterId" type="fews:ParameterSimpleType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Since 2015.01. Eg. when the parameter is wave variance density spectrum specify the the domain parameter frequency and direction.</documentation>
				</annotation>
			</element>
			<element name="qualifierId" type="fews:idString" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>
						Since version 1.4
						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>
			<sequence minOccurs="0">
				<element name="ensembleId" type="fews:idString" minOccurs="0">
					<annotation>
						<documentation>
							Since version 1.4
							An ensemble forecast consists of a number of simulations made by making small changes to the
							estimate of the current state used to initialize the simulation. These small changes are
							designed to reflect the uncertainty in the estimate. Every simulation has it's own ensembleMemberIndex
							When specified the ensembleMemberIndex is required
						</documentation>
					</annotation>
				</element>
				<choice>
					<element name="ensembleMemberIndex" type="nonNegativeInteger">
						<annotation>
							<documentation>
								Since version 1.4 An ensemble forecast consists of a number of simulations made by making small changes to the estimate of the current state used to initialize the simulation. These small changes are designed to reflect the uncertainty in the estimate. Every simulation has it's own ensembleMemberIndex. Ensemble id is not required when the ensembleMemberIndex is specified
							</documentation>
						</annotation>
					</element>
					<element name="ensembleMemberId" type="fews:idString">
						<annotation>
							<documentation>
								Since version 1.10 An ensemble forecast consists of a number of simulations made by making small changes to the estimate of the current state used to initialize the simulation. These small changes are designed to reflect the uncertainty in the estimate. Every simulation has it's own ensembleMemberId. Ensemble id is not required when the ensembleMemberId is specified
							</documentation>
						</annotation>
					</element>
				</choice>
			</sequence>
			<element name="timeStep" type="fews:TimeStepComplexType">
				<annotation>
					<documentation>The timeStep element provides three choices</documentation>
				</annotation>
			</element>
			<element name="startDate" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>date/time of the first event</documentation>
				</annotation>
			</element>
			<element name="endDate" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>date/time of the last event</documentation>
				</annotation>
			</element>
			<element name="forecastDate" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>
						Since version 1.5
						date/time of the forecast. By default the forecastDate equals the start time</documentation>
				</annotation>
			</element>
			<element name="approvedDate" type="fews:DateTimeComplexType" minOccurs="0">
				<annotation>
					<documentation>Since version 1.20. Returns the time that simulated forecast was made current. In case of no
                    longer current then the original approved time is returned.</documentation>
				</annotation>
			</element>
			<element name="missVal" type="double" default="NaN">
				<annotation>
					<documentation>Missing value definition for this TimeSeries. Defaults to NaN if left empty</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="lat" type="double" minOccurs="0">
				<annotation>
					<documentation>Latitude of station</documentation>
				</annotation>
			</element>
			<element name="lon" type="double" minOccurs="0">
				<annotation>
					<documentation>Longitude of station</documentation>
				</annotation>
			</element>
			<element name="x" type="double" minOccurs="0">
				<annotation>
					<documentation>X coordinate of station</documentation>
				</annotation>
			</element>
			<element name="y" type="double" minOccurs="0">
				<annotation>
					<documentation>Y coordinate of station</documentation>
				</annotation>
			</element>
			<element name="z" type="double" minOccurs="0">
				<annotation>
					<documentation>Z coordinate of station. From version 1.16 this optional element is only written when available. In 1.15 and earlier z=0.0 is used when z is not defined</documentation>
				</annotation>
			</element>
			<element name="units" type="string" minOccurs="0">
				<annotation>
					<documentation>Optional string that identifies the units used</documentation>
				</annotation>
			</element>
			<element name="domainAxis" type="fews:DomainAxisComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Since 2015.01. Used for spectra and other  1D or 2D variables. e.g. frequency and direction. Additional axis to the time axis</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="creationDate" type="date" minOccurs="0">
				<annotation>
					<documentation>Optional element that maybe used by third parties. The element is not used by FEWS. It is neither written nor read.</documentation>
				</annotation>
			</element>
			<element name="creationTime" type="time" minOccurs="0">
				<annotation>
					<documentation>Optional element that maybe used by third parties. The element is not used by FEWS. It is neither written nor read.</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="thresholds" type="fews:ThresholdComplexType" minOccurs="0"/>
			<group ref="fews:StatisticsGroup" minOccurs="0"/>
			<element name="product" type="fews:ProductComplexType" minOccurs="0">
				<annotation>
					<documentation>Since 2019.02. Show product and product info that has been added to the timeSeries.</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>

	<complexType name="ProductComplexType">
		<sequence>
			<element name="productDate" type="fews:DateTimeComplexType" minOccurs="0"/>
			<element name="category" type="fews:ProductCategoryComplexType" minOccurs="0"/>
			<element name="productInfo" type="fews:ProductInfoComplexType" minOccurs="0" maxOccurs="unbounded"/>
		</sequence>
		<attribute name="id" type="string" use="required">
			<annotation>
				<documentation>Since 2019.02. Id of the product</documentation>
			</annotation>
		</attribute>
		<attribute name="name" type="string" use="required">
			<annotation>
				<documentation>Since 2019.02. Name of the product</documentation>
			</annotation>
		</attribute>
	</complexType>


	<complexType name="ProductCategoryComplexType">
		<attribute name="id" type="string" use="required">
			<annotation>
				<documentation>Since 2019.02. Id of the product category</documentation>
			</annotation>
		</attribute>
		<attribute name="name" type="string" use="required">
			<annotation>
				<documentation>Since 2019.02. Name of the product category</documentation>
			</annotation>
		</attribute>
	</complexType>

	<complexType name="ProductInfoComplexType">
		<sequence>
			<element name="user" type="string">
				<annotation>
					<documentation>Since 2019.02. User that created the product</documentation>
				</annotation>
			</element>
			<element name="confidence" type="string" >
				<annotation>
					<documentation>Since 2019.02. Confidence level of the product</documentation>
				</annotation>
			</element>
			<element name="classification" type="string" >
				<annotation>
					<documentation>Since 2019.02. Classification of the product</documentation>
				</annotation>
			</element>
			<element name="comment" type="string" >
				<annotation>
					<documentation>Since 2019.02. Comment given on the product</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>
	<complexType name="ThresholdComplexType">
		<sequence>
			<element name="highLevelThreshold" type="fews:HighLevelThresholdsComplexType" maxOccurs="unbounded"/>
		</sequence>
	</complexType>
	<complexType name="DomainAxisComplexType">
		<attribute name="parameterId" type="string" use="required">
			<annotation>
				<documentation>Since 2015.01. Domain parameter id</documentation>
			</annotation>
		</attribute>
		<attribute name="units" type="string" use="optional">
			<annotation>
				<documentation>Since 2015.01. Unit for domain variable</documentation>
			</annotation>
		</attribute>
	</complexType>
	<complexType name="DomainAxisValuesComplexType">
		<simpleContent>
			<extension base="fews:ValueListSimpleType">
				<attribute name="parameterId" type="string" use="required">
					<annotation>
						<documentation>Since 2015.01. One of the domain axis parameter ids specified in the header</documentation>
					</annotation>
				</attribute>
			</extension>
		</simpleContent>
	</complexType>
	<simpleType name="ValueListSimpleType">
		<list itemType="double"/>
	</simpleType>
	<complexType name="HighLevelThresholdsComplexType">
		<attribute name="id" type="string" use="required"/>
		<attribute name="name" type="string" use="optional"/>
		<attribute name="label" type="string" use="optional">
			<annotation>
				<documentation>Since version 1.22</documentation>
			</annotation>
		</attribute>
		<attribute name="description" type="string" use="optional">
			<annotation>
				<documentation>Since version 1.27</documentation>
			</annotation>
		</attribute>
		<attribute name="comment" type="string" use="optional">
			<annotation>
				<documentation>Since version 1.27</documentation>
			</annotation>
		</attribute>
		<attribute name="value" type="float" use="required"/>
		<attribute name="groupId" type="string" use="optional"/>
		<attribute name="groupName" type="string" use="optional"/>
	</complexType>
	<complexType name="EventComplexType">
		<annotation>
			<documentation>unlimited number of events with a constant timeStep.
				Each TimeSeries should contain at least one element (records).
				The date, time and value attributes are required, the
				quality flag is optional.
			</documentation>
		</annotation>
		<simpleContent>
			<extension base="fews:ValueListSimpleType">
				<attribute name="date" type="fews:dateType" use="required">
					<annotation>
						<documentation>ISO 8601 (yyyy-mm-dd)</documentation>
					</annotation>
				</attribute>
				<attribute name="time" type="fews:timeType" use="required">
					<annotation>
						<documentation>ISO 8601 (hh:mm:ss.dsec e.g. 16:30:0.001)</documentation>
					</annotation>
				</attribute>
				<attribute name="startDate" type="fews:dateType" use="optional">
					<annotation>
						<documentation>Since version 1.23, ISO 8601 (yyyy-mm-dd)</documentation>
					</annotation>
				</attribute>
				<attribute name="startTime" type="fews:timeType" use="optional">
					<annotation>
						<documentation>Since version 1.23, ISO 8601 (yyyy-mm-dd)</documentation>
					</annotation>
				</attribute>
				<attribute name="endDate" type="fews:dateType" use="optional">
					<annotation>
						<documentation>Since version 1.23, ISO 8601 (yyyy-mm-dd)</documentation>
					</annotation>
				</attribute>
				<attribute name="endTime" type="fews:timeType" use="optional">
					<annotation>
						<documentation>Since version 1.23, ISO 8601 (yyyy-mm-dd)</documentation>
					</annotation>
				</attribute>
				<attribute name="value" type="double" use="optional">
					<annotation>
						<appinfo>
							<jaxb:property name="value2"/>
						</appinfo>
					</annotation>
				</attribute>
				<attribute name="valueSource" type="string" use="optional">
					<annotation>
						<documentation>Since version 1.31, Value source, only MAN (manual) is recognized</documentation>
					</annotation>
				</attribute>
				<attribute name="state" type="fews:stateString" use="optional">
					<annotation>
						<documentation>Since version 1.31, normal, dried, inundated and ice is recognized</documentation>
					</annotation>
				</attribute>
				<attribute name="minValue" type="double" use="optional"/>
				<attribute name="maxValue" type="double" use="optional"/>
				<attribute name="detection" type="fews:detectionString">
					<annotation>
						<documentation>Since version 1.29, will be set if the value is not inside the detection range.
						</documentation>
					</annotation>
				</attribute>
				<attribute name="flag" type="int" use="optional"/>
				<attribute name="flagSource" type="string" use="optional">
					<annotation>
						<documentation>Since version 1.11, validation rule, default codes are MAN (manual), MOD (modifier), SN (soft min), HN (hard min), SX (soft max), HX (hard max), ROR (rate of
							rise), ROF (rate of fall), SR (same reading), TS (time shift), OSC (oscillation), SVS (secondary validation series), SVF (secondary validation flags)
						</documentation>
					</annotation>
				</attribute>
				<attribute name="comment" type="string" use="optional">
					<annotation>
						<documentation>Since version 1.3</documentation>
					</annotation>
				</attribute>
				<attribute name="user" type="string" use="optional">
					<annotation>
						<documentation>Since version 1.10</documentation>
					</annotation>
				</attribute>
				<anyAttribute namespace="http://www.wldelft.nl/fews/fs" processContents="skip">
					<annotation>
						<documentation>Since version 1.19. Used for flag source column names and their custom flag source values. For example a flag source column named 'A' that has a custom flag source value 'OK' will result in an attribute:
							fs:A="OK"</documentation>
					</annotation>
				</anyAttribute>
			</extension>
		</simpleContent>
	</complexType>
	<simpleType name="stateString">
		<restriction base="string">
			<enumeration value="dried"/>
			<enumeration value="inundated"/>
			<enumeration value="ice"/>
		</restriction>
	</simpleType>
</schema>
