<?xml version="1.0" encoding="UTF-8"?>
<!--
     Energy Market Information Exchange (EMIX) Version 1.0
     Committee Specification Draft 03
     23 June 2011
     Copyright (c) OASIS Open 2011. All Rights Reserved.
     Source: http://docs.oasis-open.org/emix/emix/v1.0/csd03/xsd/
-->
<!-- edited with XMLSpy v2011 rel. 2 (x64) (http://www.altova.com) by Toby Considine (TC9, Inc) -->
<!-- power-quality.xsd - Power Products for OASIS EMIX 1.0 WD23 (20110411)

Set includes:
    EMIX, EMIX-Requirements, EMIX-Warrants (emix)
    Power, Power-Contracts, Power-Quality (power)
    Resource (resource)

This set built on the WS-Calendar v1.0 PRD02 Schemas.
-->
<xs:schema xmlns:power="http://docs.oasis-open.org/ns/emix/2011/06/power" xmlns:emix="http://docs.oasis-open.org/ns/emix/2011/06" xmlns:scale="http://docs.oasis-open.org/ns/emix/2011/06/siscale" xmlns:xcal="urn:ietf:params:xml:ns:icalendar-2.0" xmlns:clm5ISO42173A="urn:un:unece:uncefact:codelist:standard:5:ISO42173A:2010-04-07" xmlns:gml="http://www.opengis.net/gml/3.2" xmlns:gmlsf="http://www.opengis.net/gmlsf/2.0" xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://docs.oasis-open.org/ns/emix/2011/06/power" elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:include schemaLocation="power.xsd"/>
	<xs:import namespace="http://docs.oasis-open.org/ns/emix/2011/06" schemaLocation="emix.xsd"/>
	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0" schemaLocation="http://docs.oasis-open.org/ws-calendar/ws-calendar-spec/v1.0/csprd03/xsd/iCalendar-wscal-extensions.xsd"/>
	<xs:import namespace="urn:ietf:params:xml:ns:icalendar-2.0" schemaLocation="http://docs.oasis-open.org/ws-calendar/ws-calendar-spec/v1.0/csprd03/xsd/iCalendar.xsd"/>
	<!-- 6.0 Power Quality Warrant -->
	<xs:element name="powerQualityWarrant" type="power:PowerQualityWarrantType" substitutionGroup="emix:qualityWarrant"/>
	<xs:complexType name="PowerQualityWarrantType" mixed="false">
		<xs:annotation>
			<xs:documentation>A Power Quality Warrant asserts or requires that the power be of a certain quality or better.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="emix:QualityWarrantType">
				<xs:sequence>
					<xs:element ref="emix:uid" minOccurs="1" maxOccurs="1"/>
					<xs:element ref="power:measurementProtocol" minOccurs="1" maxOccurs="1"/>
					<xs:element ref="power:qualityType" minOccurs="1" maxOccurs="1"/>
					<xs:element ref="emix:side" minOccurs="1" maxOccurs="1"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- 6.1 Quality Measurements -->
	<xs:element name="qualityMeasure" type="power:QualityMeasureType"/>
	<xs:complexType name="QualityMeasureType" mixed="false">
		<xs:annotation>
			<xs:documentation>Quality Measure is a collection of Power Quality Indicators. The Quality Measure is placed in a WS-Calendar Artifact so it can populate a schedule.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="xcal:ArtifactBaseType">
				<xs:sequence>
					<xs:element name="qualities" type="power:ArrayOfQualityIndicators"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- 6.2 Power Quality Indicators-->
	<xs:element name="basePowerQualityIndicator" type="power:BasePowerQualityIndicatorType" abstract="true">
		<xs:annotation>
			<xs:documentation>Abstract extension object for Power Qualities</xs:documentation>
		</xs:annotation>
	</xs:element>
	<xs:complexType name="ArrayOfQualityIndicators">
		<xs:annotation>
			<xs:documentation>Collection of Power Qualities</xs:documentation>
		</xs:annotation>
		<xs:sequence>
			<xs:element ref="power:basePowerQualityIndicator" minOccurs="0" maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:complexType>
	<xs:complexType name="BasePowerQualityIndicatorType" abstract="true">
		<xs:annotation>
			<xs:documentation>An identification of the standard or other protocol used to measure power quality. Sets definition for all other power attributes. Type of Abstract extension object  for Power Qualities</xs:documentation>
		</xs:annotation>
	</xs:complexType>
	<!-- 6.3 Defined Power Qualities -->
	<xs:element name="powerFrequency" type="power:PowerFrequencyType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="supplyVoltageVariations" type="power:SupplyVoltageVariationsType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="rapidVoltageChanges" type="power:RapidVoltageChangesType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="flickerSt" type="power:FlickerStType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="flickerLt" type="power:FlickerLtType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="supplyVoltageDips" type="power:SupplyVoltageDipsType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="shortInterruptions" type="power:ShortInterruptionsType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="longInterruptions" type="power:LongInterruptionsType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="temporaryOvervoltage" type="power:TemporaryOvervoltageType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="supplyVoltageImbalance" type="power:SupplyVoltageImbalanceType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="harmonicVoltage" type="power:HarmonicVoltageType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="mainsVoltage" type="power:MainsVoltageType" substitutionGroup="power:basePowerQualityIndicator"/>
	<xs:element name="mainsSignallingVoltage" type="power:MainsSignallingVoltageType" substitutionGroup="power:basePowerQualityIndicator"/>
	<!-- 6.4 Defines Power Quality Measuress -->
	<xs:complexType name="PowerFrequencyType" mixed="false">
		<xs:annotation>
			<xs:documentation>measured Power frequency, e.g. 50.4, 59.9, measured as per referenced measurement protocol. 0 for DC
					</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="frequency" type="xs:float"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="SupplyVoltageVariationsType" mixed="false">
		<xs:annotation>
			<xs:documentation>count of Supply Voltage Variations during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="RapidVoltageChangesType" mixed="false">
		<xs:annotation>
			<xs:documentation>count of Rapid Voltage Changes during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="FlickerLtType" mixed="false">
		<xs:annotation>
			<xs:documentation>count of Flicker Long Term events during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="FlickerStType" mixed="false">
		<xs:annotation>
			<xs:documentation>count of Flicker Short Term events during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="SupplyVoltageDipsType" mixed="false">
		<xs:annotation>
			<xs:documentation>Count of Supply Voltage Dips during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="ShortInterruptionsType" mixed="false">
		<xs:annotation>
			<xs:documentation>Count of Short Interruptions during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="LongInterruptionsType" mixed="false">
		<xs:annotation>
			<xs:documentation>Count of Long Interuptions during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="TemporaryOvervoltageType" mixed="false">
		<xs:annotation>
			<xs:documentation>Count of Temporary Overvoltage Events during the period, measured as per referenced measurement protocol
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="SupplyVoltageImbalanceType" mixed="false">
		<xs:annotation>
			<xs:documentation>count of Supply Voltage Imbalance events during the period,  measured as per referenced measurement protocol. Not meaningful for DC.
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="count" type="xs:int"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="HarmonicVoltageType" mixed="false">
		<xs:annotation>
			<xs:documentation>Harmonic Voltage during the period, measured as per referenced measurement protocol. For DC, distortion is with respect to a signal of 0 Hz, 	The period is usually much shorter than other power quality measures.</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="voltage" type="xs:float"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MainsVoltageType" mixed="false">
		<xs:annotation>
			<xs:documentation>Mains Voltage. Nominal value, e.g, 110, 130, 220, 208. See referenced measurement protocol for definition.
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="voltage" type="xs:float"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="MainsSignallingVoltageType" mixed="false">
		<xs:annotation>
			<xs:documentation>A number indicating Mains Signaling Voltage, relating generally to power line communications systems.
		</xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="power:BasePowerQualityIndicatorType">
				<xs:sequence>
					<xs:element name="voltage" type="xs:float"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<!-- 6.9 Quality Enumerations -->
	<xs:element name="qualityType" type="power:QualityTypeType"/>
	<xs:simpleType name="QualityTypeType">
		<xs:union memberTypes="power:QualityTypeEnumeratedType emix:EmixExtensionType"/>
	</xs:simpleType>
	<xs:simpleType name="QualityTypeEnumeratedType">
		<xs:annotation>
			<xs:documentation>A string indicating the type of Assertion being made</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:token">
			<xs:enumeration value="guaranteed"/>
			<xs:enumeration value="averaged"/>
			<xs:enumeration value="projected"/>
			<xs:enumeration value="measured"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:element name="measurementProtocol" type="power:MeasurementProtocolType"/>
	<xs:simpleType name="MeasurementProtocolType">
		<xs:union memberTypes="power:MeasurementProtocolEnumeratedType emix:EmixExtensionType"/>
	</xs:simpleType>
	<xs:simpleType name="MeasurementProtocolEnumeratedType">
		<xs:annotation>
			<xs:documentation>An identification of the standard or other protocol used to measure power quality. Sets definition for all other power attributes</xs:documentation>
		</xs:annotation>
		<xs:restriction base="xs:string">
			<xs:enumeration value="EN 50160"/>
			<xs:enumeration value="IEEE 1549-2009"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>
