<?xml version="1.0" encoding="UTF-8"?>
<!--Defines registry entries for a VOSpace 
   
-->
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
   xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
   targetNamespace="http://www.ivoa.net/schema/VOSpaceResource/v1.0rc4"
   elementFormDefault="unqualified" attributeFormDefault="unqualified"
   version="1.0rc4"
   xmlns:vsp="http://www.ivoa.net/schema/VOSpaceResource/v1.0rc4"
   xmlns:vs="http://www.ivoa.net/xml/VODataService/v1.0">
   <xsd:import namespace="http://www.ivoa.net/xml/VOResource/v1.0"
      schemaLocation="VOResource-v1.0.xsd">
   </xsd:import>
   <xsd:import namespace="http://www.ivoa.net/xml/VODataService/v1.0"
      schemaLocation="VODataService-v1.0.xsd">
   </xsd:import>
   <xsd:complexType name="VOSpaceCapability">
      <xsd:annotation>
         <xsd:documentation>
            Indicates that a service has vospace capability
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vr:Capability">
            <xsd:sequence>
               <xsd:annotation>
                  <xsd:documentation>
                     This lists additional metadata about the space -
                     might want to put stuff about data storage - or
                     should that be in a special API for the Space?

                     possible static metadata * authorization policy *
                     max data transfer size

                     dynamic metadata - e.g. available storage should be
                     in control API.
                  </xsd:documentation>
               </xsd:annotation>
               <xsd:element name="accessPolicy" type="xsd:anyURI">
               </xsd:element>
               <xsd:element name="protocols" type="vsp:AcceptorProvider"
                  maxOccurs="1" minOccurs="1">
               </xsd:element>
               <xsd:element name="views" type="vsp:AcceptorProvider"
                  maxOccurs="1" minOccurs="1">
               </xsd:element>
               <xsd:element name="nodeTypes" type="vsp:NodeTypes"
                  maxOccurs="unbounded" minOccurs="1">
                  <xsd:annotation>
                     <xsd:documentation>
                        specific enumeration of the nodetypes supported
                        by this VOSpace
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>

               <xsd:element name="features" type="xsd:string"
                  maxOccurs="unbounded" minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        enumeration of other features supported by the
                        VOspace - not specifically covered by the
                        nodetypes - e.g.
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
   <xsd:complexType name="PropertyDescriptionType">
      <xsd:annotation>
         <xsd:documentation>
            A property description. Note that this is very similar to
            the
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vs:BaseParam">
            <xsd:sequence>
               <xsd:element name="description" type="xsd:string"></xsd:element>
            </xsd:sequence>
            <xsd:attribute name="key" type="xsd:string">
               <xsd:annotation>
                  <xsd:documentation>
                     a unique identifier
                  </xsd:documentation>
               </xsd:annotation>
            </xsd:attribute>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>




   <xsd:complexType name="VOSpaceView">
      <xsd:annotation>
         <xsd:documentation>describes a view</xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vsp:BaseKey">
            <xsd:sequence>
               <xsd:element name="standardUrl" type="xsd:anyURI"
                  maxOccurs="1" minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        a reference to a published standard
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
               <xsd:element name="param"
                  type="vsp:PropertyDescriptionType" minOccurs="0"
                  maxOccurs="unbounded" nillable="true">
                  <xsd:annotation>
                     <xsd:documentation>
                        A list of parameters for the view.
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
   <xsd:complexType name="VOSpaceProtocol">
      <xsd:annotation>
         <xsd:documentation>
            describes a VOSpace transfer protocol
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vsp:BaseKey">
            <xsd:sequence>
               <xsd:element name="standardUrl" type="xsd:anyURI"
                  maxOccurs="1" minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        a reference to a published standard
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
               <xsd:element name="urlScheme" type="xsd:string"
                  maxOccurs="1" minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        the URL scheme for the protocol
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
               <xsd:element name="param"
                  type="vsp:PropertyDescriptionType" minOccurs="0"
                  maxOccurs="unbounded" nillable="true">
                  <xsd:annotation>
                     <xsd:documentation>
                        A list of parameters for the view.
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>

            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>


   <xsd:element name="PropertyDescriptionList">
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element name="propertyDescription"
               type="vsp:PropertyDescriptionType" maxOccurs="unbounded"
               minOccurs="1">
            </xsd:element>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:attributeGroup name="identifier">
      <xsd:attribute name="id" type="xsd:NCName" use="required">
         <xsd:annotation>
            <xsd:documentation>
               The property identifier. The id is intended to be used as
               a fragment identifier to be added to the URL for the
               container of the property description to uniquely
               identify the property amongst the possible list of
               properties.
            </xsd:documentation>
         </xsd:annotation>
      </xsd:attribute>

   </xsd:attributeGroup>

   <xsd:complexType name="AcceptorProvider">
      <xsd:sequence>
         <xsd:element name="accepts" type="vsp:ArrayOfUri"></xsd:element>
         <xsd:element name="provides" type="vsp:ArrayOfUri"></xsd:element>
      </xsd:sequence>
   </xsd:complexType>


   <xsd:complexType name="ArrayOfUri">
      <xsd:sequence>
         <xsd:element name="uri" maxOccurs="unbounded" minOccurs="0"
            type="xsd:anyURI">
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:simpleType name="NodeTypes">
      <xsd:annotation>
         <xsd:documentation>
            enumeration of possible node types
         </xsd:documentation>
      </xsd:annotation>
      <xsd:restriction base="xsd:string">
         <xsd:enumeration value="DataNode"></xsd:enumeration>
      </xsd:restriction>
   </xsd:simpleType>


   <xsd:complexType name="ResourceEnumList">
      <xsd:annotation>
         <xsd:documentation>
            A type to allow dynamc listing of key values in the registry
            - this saves putting closed lists into schema in many cases.
            The intention is that the enumeration value would be of the
            form

            ivo://authority/resource#key

            where the fragment part refers to the particular key

         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vr:Resource">
            <xsd:sequence>
               <xsd:element name="key" type="vsp:BaseKey"
                  maxOccurs="unbounded" minOccurs="1">
               </xsd:element>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

   <xsd:complexType name="BaseKey">
      <xsd:annotation>
         <xsd:documentation>            The basic enumeration key, which has an identifier and            description only - This type can be extended if the key has            other metadata associated with it.            The intention is that the enumeration value would be of the            form            ivo://authority/resource#key            where the fragment part refers to the particular key         </xsd:documentation>
      </xsd:annotation>
      <xsd:sequence>
         <xsd:element name="description" type="xsd:token"></xsd:element>
      </xsd:sequence>
      <xsd:attributeGroup ref="vsp:identifier"></xsd:attributeGroup>
   </xsd:complexType>

   <xsd:complexType name="VOSpaceProperty">
      <xsd:annotation>
         <xsd:documentation>describes a</xsd:documentation>
      </xsd:annotation>
      <xsd:complexContent>
         <xsd:extension base="vsp:BaseKey">
            <xsd:sequence>
               <xsd:element name="name" type="xsd:string"
                  minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        the name of the column
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>

               <xsd:element name="unit" type="xsd:string"
                  minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        the unit associated with all values in the
                        column
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>

               <xsd:element name="ucd" type="xsd:string"
                  minOccurs="0">
                  <xsd:annotation>
                     <xsd:documentation>
                        the name of a unified content descriptor. See
                        ....
                     </xsd:documentation>
                  </xsd:annotation>
               </xsd:element>
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>
</xsd:schema>

