<?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">
	<include schemaLocation="pi_sharedtypes.xsd"/>
	<element name="Samples" type="fews:SamplesCollectionComplexType">
		<annotation>
			<documentation>Samples data represent data collected at a specific time at a specific location</documentation>
		</annotation>
	</element>
	<complexType name="SamplesCollectionComplexType">
		<annotation>
			<documentation>Samples data represent data collected at a specific time at a specific location</documentation>
		</annotation>
		<sequence>
			<group ref="fews:TimeZoneChoice" minOccurs="0"/>
			<element name="sample" type="fews:SamplesComplexType" minOccurs="0" maxOccurs="unbounded">
				<annotation>
					<documentation>Samples data represent data collected at a specific time at a specific location
					</documentation>
				</annotation>
			</element>
		</sequence>
		<attribute name="version" type="fews:versionString" use="optional" default="1.21">
			<annotation>
				<documentation>The version of the published interface schemas</documentation>
			</annotation>
		</attribute>
	</complexType>
	<complexType name="SamplesComplexType">
		<annotation>
			<documentation>Samples data represent data collected at a specific time at a specific location
			</documentation>
		</annotation>
		<sequence>
			<element name="header" type="fews:SampleHeaderComplexType">
				<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>Properties that are applicable to the sample following</documentation>
					</annotation>
				</element>
				<element name="table" type="fews:SampleTableComplexType" minOccurs="1">
					<annotation>
						<documentation>
						</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>
		<attribute name="id" type="fews:idStringType" use="required"/>
	</complexType>
	<complexType name="SampleHeaderComplexType">
		<annotation>
			<documentation>The sample header is used to specify the link the sample location and the contents
			</documentation>
		</annotation>
		<sequence>
			<element name="moduleInstanceId" type="fews:idStringType" minOccurs="0">
				<annotation>
					<documentation>Since 2019.02</documentation>
				</annotation>
			</element>
			<element name="locationId" type="fews:LocationIdSimpleType"/>
			<element name="sampleDate" type="fews:DateTimeComplexType">
				<annotation>
					<documentation>date of the sample</documentation>
				</annotation>
			</element>
			<element name="missVal" type="double" default="NaN" minOccurs="0">
				<annotation>
					<documentation>Missing value definition for this Sample. Defaults to NaN if left empty</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="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>
		</sequence>
	</complexType>
	<complexType name="SampleTableComplexType">
		<annotation>
			<documentation>A sample table can contain an unlimited number of sample rows.
			</documentation>
		</annotation>
		<sequence  maxOccurs="unbounded">
			<element name="properties" type="fews:PropertiesComplexType" minOccurs="0">
				<annotation>
					<documentation>Properties that are applicable to the value following</documentation>
				</annotation>
			</element>
			<element name="row" type="fews:SampleRowComplexType">
				<annotation>
					<documentation>unlimited number of sample rows. A table should contain at least 1 row.
						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.
					</documentation>
				</annotation>
			</element>
		</sequence>
	</complexType>

	<complexType name="SampleRowComplexType">
		<annotation>
			<documentation>
				For each row the parameter, value and qualifiers are required.
			</documentation>
		</annotation>
		<attribute name="parameterId" type="string" use="required"/>
		<attribute name="value" type="double" use="required"/>
		<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="unit" type="string" use="required"/>
		<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), SVS (secondary validation series), SVF (secondary validation flags)
				</documentation>
			</annotation>
		</attribute>
		<attribute name="comment" type="string" use="optional">
		</attribute>
		<attribute name="user" type="string" use="optional">
		</attribute>
		<anyAttribute namespace="http://www.wldelft.nl/fews/qualifierId" processContents="skip">
			<annotation>
				<documentation>Since version 1.21. Used for sample qualifiers.
					qualifierId:a="AC_1"
				</documentation>
			</annotation>
		</anyAttribute>

	</complexType>
	<simpleType name="ValueListSimpleType">
		<list itemType="double"/>
	</simpleType>
</schema>
