<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://www.w3.org/2001/XMLSchema"
	targetNamespace="http://xml.vitalab.tuwien.ac.at/ns/taaf/CapabilitiesMetaModel"
	xmlns:tns="http://xml.vitalab.tuwien.ac.at/ns/taaf/CapabilitiesMetaModel"
	elementFormDefault="qualified"
	version="0.1">
	
	<element name="Profile">
	<complexType>
			<sequence>
				<element name="WSDLlocation" type="anyURI" minOccurs="1" maxOccurs="1"/>
				<element name="Component" type="tns:Component" minOccurs="0" maxOccurs="unbounded"/>
				<element name="ServiceCategory" type="string" minOccurs="0" maxOccurs="unbounded"/>				
			</sequence>
			<attribute name="ProfileId" type="anyURI" use="required"/>
	</complexType>
	</element>		
		
	<complexType name="Component">
		<sequence>			
			<element name="Capability" type="tns:Capability" minOccurs="0" maxOccurs="unbounded"/>
			<element name="SelectableCapability" type="tns:SelectableCapability" minOccurs="0" maxOccurs="unbounded"/>
			<element name="SupportedConfigurations" type="tns:Combination" minOccurs="0" maxOccurs="1"/>
			<element name="SupportedTransitions" type="tns:Transition" minOccurs="0" maxOccurs="unbounded"/>
			<element name="WSDLoperationScope" type="anyURI" minOccurs="0" maxOccurs="unbounded"/>
		</sequence>		
		<attribute name="ComponentId" type="anyURI" use="required"/>
	</complexType>			
			
	<complexType name="Capability">
		<sequence>			
			<element name="CapabilityId" type="anyURI" minOccurs="1" maxOccurs="1"/>
			<element name="Property" type="tns:Property" minOccurs="0" maxOccurs="unbounded"/>
			<element name="SubCapability" type="tns:Capability" minOccurs="0" maxOccurs="unbounded"/>			
		</sequence>		
	</complexType>
	
	<complexType name="Property">
		<sequence>			
		</sequence>		
		<attribute name="PropertyId" type="anyURI" use="required"/>
	</complexType>
	
	<element name="DefaultProperty" type="tns:DefaultProperty"/>	
	<complexType name="DefaultProperty">
		<complexContent>
			<extension base="tns:Property">
				<sequence>
					<element name="value" type="tns:SimpleProperty" minOccurs="1" maxOccurs="1"></element>
				</sequence>			
			</extension>			
		</complexContent>		
	</complexType>
	
	<complexType name="SimpleProperty">		
				<choice>
					<element name="intValue" type="int" maxOccurs="unbounded" minOccurs="1"/>
					<element name="boolValue" type="boolean" maxOccurs="unbounded" minOccurs="1"/>
					<element name="decValue" type="decimal" maxOccurs="unbounded" minOccurs="1"/>
					<element name="timestampValue" type="dateTime" maxOccurs="unbounded" minOccurs="1"/>
					<element name="strValue" type="string"  maxOccurs="unbounded" minOccurs="1"/>
				</choice>							
	</complexType>
		
	<complexType name="ResourceSize">
		<complexContent>
			<extension base="tns:Property">
				<sequence>
					<element name="value" type="int" maxOccurs="1" minOccurs="1"/>
					<element name="unit" type="tns:tUnit"  maxOccurs="1" minOccurs="1"/>
				</sequence>				
			</extension>			
		</complexContent>		
	</complexType>
	
	<complexType name="SelectableCapability">
		<complexContent>
			<extension base="tns:Capability">
				<sequence>
					<element name="Alternative" type="tns:Capability" minOccurs="1" maxOccurs="unbounded"/>					
				</sequence>
				<attribute name="RequiredSelection" type="boolean" use="required"/>
				<attribute name="DefaultSelection" type="anyURI" use="optional"/>
			</extension>
		</complexContent>
	</complexType>
	
	<complexType name="Combination">
		<sequence>
			<choice minOccurs="0" maxOccurs="unbounded">
				<element name="Selection" type="anyURI" /><!-- the given strategy or strategy set -->
				<element name="All" type="tns:Combination" /><!-- select any combination of entries from the given strategy SETs! -->
				<element name="OneOf" type="tns:Combination" /><!-- select any entry from the given combinations of strategies -->
				<element name="NoneOf" type="tns:Combination" /><!--  may not select any entry from the given combinations of strategies -->
			</choice>
		</sequence>
	</complexType>

	<complexType name="Transition">		
			<sequence>
				<element name="StartCombination" type="tns:Combination" minOccurs="1" maxOccurs="unbounded"/>
				<element name="EndCombination" type="tns:Combination" minOccurs="1" maxOccurs="unbounded"/>
			</sequence>
			<attribute name="isPositive" type="boolean" use="required" />
	</complexType>

	<simpleType name="tUnit">
		<restriction base="string">
			<enumeration value="Byte"/>
			<enumeration value="kB"/>
			<enumeration value="mB"/>
			<enumeration value="gB"/>
			<enumeration value="tB"/>						
		</restriction>
	</simpleType>
	
	<simpleType name="t0to1">
		<restriction base="decimal">
			<minInclusive value="0"/>
			<maxInclusive value="1"/>
		</restriction>
	</simpleType>
</schema>
