<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.ivoa.net/xml/prop/VODataService/v0.1" 
           xmlns:xs="http://www.w3.org/2001/XMLSchema" 
           xmlns:vr="http://www.ivoa.net/xml/prop/VOResource/v0.8.1" 
           xmlns:vs="http://www.ivoa.net/xml/prop/VODataService/v0.1" 
           xmlns:vm="http://www.ivoa.net/xml/prop/VOMetadata"
           elementFormDefault="qualified" attributeFormDefault="unqualified">

   <xs:annotation>
     <xs:appinfo>
       <vm:SchemaName>VODataService</vm:SchemaName>
       <vm:schemaPrefix>xs</vm:schemaPrefix>
       <vm:targetPrefix>vs</vm:targetPrefix>
       <vm:version>0.1</vm:version>
     </xs:appinfo>
     <xs:documentation>
        Version 0.8
      </xs:documentation>
      <xs:documentation>
        An extension to the core resource metadata (VOResource) for 
	describing data collections and services.
      </xs:documentation>
   </xs:annotation>

   <xs:import namespace="http://www.ivoa.net/xml/prop/VOResource/v0.8.1"
         schemaLocation="http://www.ivoa.net/internal/IVOA/IVOARegWp03/VOResource-v0.8.1.xsd"/>

   <xs:element name="DataCollection" type="vs:DataCollectionType" 
               substitutionGroup="vr:ManagedResource">
      <xs:annotation>
         <xs:documentation>
	   A logical grouping of data which, in general, is composed of one 
	   or more accessible datasets.
	 </xs:documentation>
         <xs:documentation>
	   (A dataset is a collection of digitally-encoded data with a that 
	   is normally accessible as a single unit, e.g. a file.)
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="DataCollectionType">
      <xs:complexContent>
         <xs:extension base="vr:ManagedResourceType">
            <xs:sequence>
	      <xs:element ref="vs:Coverage" minOccurs="0"/>
	      <xs:element ref="vs:Resolution" minOccurs="0"/>
	      <xs:element ref="vs:Access" minOccurs="0"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:element name="Coverage" type="vs:CoverageType">
      <xs:annotation>
         <xs:documentation>
	   Extent of the content of the resource over space, time, and 
	   frequency.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="CoverageType">
      <xs:sequence>
         <xs:element ref="vs:Spatial" minOccurs="0"/>
         <xs:element ref="vs:Spectral" minOccurs="0"/>
         <xs:element ref="vs:Temporal" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Spatial" type="xs:anyType">
      <xs:annotation>
         <xs:documentation>the spatial coverage of a resource</xs:documentation>
         <xs:documentation>Note: type not yet defined</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Temporal" type="xs:anyType">
      <xs:annotation>
         <xs:documentation>the temporal coverage of a resource</xs:documentation>
         <xs:documentation>Note: type not yet defined</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Spectral" type="xs:anyType">
      <xs:annotation>
         <xs:documentation>the spectral coverage of a resource</xs:documentation>
         <xs:documentation>Note: type not yet defined</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Resolution" type="xs:anyType">
      <xs:annotation>
         <xs:documentation>the resolution of the resource contents</xs:documentation>
         <xs:documentation>Note: type not yet defined</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Access" type="vs:AccessType">
      <xs:annotation>
         <xs:documentation>
	   a description about how a data collection may be accessed
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="AccessType">
      <xs:sequence>
        <xs:element ref="vs:Format" minOccurs="0" maxOccurs="unbounded"/>
	<xs:element ref="vs:Rights" minOccurs="0"/>
	<xs:element ref="vr:ServiceRef" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Format" type="xs:string">
      <xs:annotation>
         <xs:documentation>
	   The physical or digital manifestation of the information supported
	   by a resource.
	 </xs:documentation>
         <xs:documentation>
	   MIME types should be used for network-retrievable, digital data.
	   Non-MIME type values are used for media that cannot be retrieved
	   over the network--e.g. CDROM, poster, slides, video cassette, 
	   etc.  
	 </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Rights" type="vs:RightsType">
      <xs:annotation>
       	 <xs:appinfo>
       	   <vm:dcterm>Rights</vm:dcterm>
       	 </xs:appinfo>           
         <xs:documentation>
	   Information about rights held in and over the resource.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:simpleType name="RightsType">
         <xs:restriction base="xs:string">
	    <xs:enumeration value="public">
	       <xs:annotation>
	          <xs:documentation>
		     unrestricted, public access is allowed
	          </xs:documentation>
	       </xs:annotation>
	    </xs:enumeration>
	    <xs:enumeration value="public">
	       <xs:annotation>
	          <xs:documentation>
		     unrestricted, public access is allowed without 
		     authentication.
	          </xs:documentation>
	       </xs:annotation>
	    </xs:enumeration>
	    <xs:enumeration value="secure">
	       <xs:annotation>
	          <xs:documentation>
		     authenticated, public access is allowed.
	          </xs:documentation>
	       </xs:annotation>
	    </xs:enumeration>
	    <xs:enumeration value="proprietary">
	       <xs:annotation>
	          <xs:documentation>
		     only proprietary access is allowed with authentication.
	          </xs:documentation>
	       </xs:annotation>
	    </xs:enumeration>
         </xs:restriction>
   </xs:simpleType>

   <xs:element name="Service" type="vs:ServiceType">
      <xs:annotation>
         <xs:documentation>
	   A resource that provides an interface for executing some operation 
	   or retrieving data.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="ServiceType">
      <xs:complexContent>
         <xs:extension base="vr:ManagedResourceType">
            <xs:sequence>
              <xs:element ref="vs:Capability" minOccurs="0"/>
              <xs:element ref="vs:Interface"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

   <xs:element name="Interface" type="vs:InterfaceType">
     <xs:annotation>
       <xs:documentation>
          A description (or pointer) to a service interface.
       </xs:documentation>
       <xs:documentation>
          Normally, a member of the Interface substitutionGroup is
          used to provide this information.  A raw Interface element 
	  should only be used when there is no applicable 
	  substitutionGroup member.
       </xs:documentation>
     </xs:annotation>
   </xs:element>
   <xs:complexType name="InterfaceType">
      <xs:annotation>
         <xs:documentation>
           This is a base type for defining specific kinds of service 
           descriptions.
         </xs:documentation>
      </xs:annotation>
      <xs:sequence>
         <xs:element ref="vr:Description" minOccurs="0">
       	    <xs:annotation>
       	       <xs:documentation>
	         Specifically, a textual description of the interface.
       	       </xs:documentation>
       	       <xs:documentation>
	         This is typically only used when a structured description
		 is not available or supported for this particular type of
		 interface.  
       	       </xs:documentation>
       	    </xs:annotation>
         </xs:element>	
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Capability" type="vs:CapabilityType">
      <xs:annotation>
         <xs:documentation>
	   a specific description of the context and capabilities of a service.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="CapabilityType">
      <xs:annotation>
         <xs:documentation>
           This is a base type for defining specific kinds of service 
           capability descriptions, each with its own special mark-up schema.
         </xs:documentation>
      </xs:annotation>

      <xs:sequence> 
         <xs:element ref="vs:StandardURL" minOccurs="0" maxOccurs="1" />
         <xs:element ref="vs:StandardID" minOccurs="0" maxOccurs="1" />
      </xs:sequence> 
   </xs:complexType>

   <xs:element name="StandardID" type="vr:IdentifierType">
     <xs:annotation>
       <xs:documentation>
          An identifier for a registered standard.  
       </xs:documentation>
     </xs:annotation>
   </xs:element>

   <xs:element name="StandardURL" type="xs:anyURI">
     <xs:annotation>
       <xs:documentation>
          A URL that points to a human-readable document that describes the 
          standard upon which a resource is based.
       </xs:documentation>
       <xs:documentation>
          This is different from the Service's ReferenceURL, which should 
	  describe the specific implementation of the standard service.
       </xs:documentation>
     </xs:annotation>
   </xs:element>

   <xs:element name="SkyService" type="vs:SkyServiceType" 
               substitutionGroup="vs:Service">
      <xs:annotation>
         <xs:documentation>
	   A service for accessing astronomical data
	 </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="SkyServiceType">
      <xs:complexContent>
         <xs:extension base="vs:ServiceType">
            <xs:sequence>
	       <xs:element ref="vs:Coverage"/>
	       <xs:element ref="vs:Resolution" minOccurs="0"/>
            </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

</xs:schema>
