<?xml version="1.0" encoding="UTF-8"?>

<!--
::===========================================================================::
Bayesian Advisor Project :: Preference Elicitatioin Tool - Output XML Schema
Started July-2002 by Christina Knapp (ck38@csr.uky.edu)
Version 1: 7-16-02 - Path Version

This is the XML Schema for the output from the Preference Elicitation 
Tool.  It is sent to the visual GUI. For more information about XML Schema 
see http://www.w3.org/XML/Schema.
::===========================================================================::
-->

<xs:schema version="0.1"
   xmlns:xs="http://www.w3.org/2001/XMLSchema"
   targetNamespace="http://www.cs.uky.edu/bap/prefs/"
   xmlns="http://www.cs.uky.edu/bap/prefs/"
   elementFormDefault="qualified">



<!-- The <graph> element is valid inside <archetype> only.  It represents 
the graphs created by the user of POET detailing dependencies and utility.  
The name of the graph element is the root node of the tree. --> 
-->

<xs:element name="graph">
   <xs:complexType>
      <xs:sequence>
         <xs:element name="path" minOccurs="1" maxOccurs="unbounded">
            <xs:complexType>
               <xs:sequence>
                  <xs:element name="root" minOccurs="1" maxOccurs="1"> 
                     <xs:complexType/>
                        <xs:attribute name="name" type="xs:string" use="required"/>
                  </xs:element>
                  <xs:element name="node" minOccurs="0" maxOccurs="unbounded">
                     <xs:complexType/>
			<xs:attribute name="name" type="xs:string" use="required"/>
			<xs:attribute name="order" type="xs:nonNegativeInteger" use="optional"/>
	          </xs:element>
                  <xs:element name="leaf" minOccurs="1" maxOccurs="1">
                     <xs:complexType/>
		        <xs:attribute name="utility" use="required">
		           <xs:simpleType>
			      <xs:restriction base="xs:integer">
			         <xs:minInclusive value="0"/>
			         <xs:maxInclusive value="6"/>
			      </xs:restriction>
		           </xs:simpleType>
		        </xs:attribute>
	          </xs:element>
               </xs:sequence>
            </xs:complexType>
            <xs:attribute name="order" type="xs:nonNegativeInteger" use="optional"/>
         </xs:element>
      </xs:sequence>
   </xs:complexType>
   <xs:attribute name="order" type="xs:nonNegativeInteger" use="optional"/>
</xs:element>


<!-- The <archetype> element is the ROOT for all valid instance documents 
for POET output -->
<xs:element name="archetype">
   <xs:complexType>
      <xs:sequence>
         <xs:element ref="graph" minOccurs="1" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>
   <xs:attribute name="name" type="xs:string" use="required"/>
</xs:element>   


<!-- THE END -->
</xs:schema>
