<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
	    xmlns:vor="http://www.ivoa.net/xml/prop/VOResource"
            targetNamespace="http://www.ivoa.net/xml/prop/VOResource"
            elementFormDefault="qualified" attributeFormDefault="unqualified">
   <xsd:annotation>
      <xsd:documentation>
        Version 0.1
      </xsd:documentation>
      <xsd:documentation>
        Implementation of an XML Schema describing a resource to 
        be used in the Virtual Observatory Project.  Based on "Resource 
        and Service Metadata for the Virtual Observatory", Version 6, 
        February 2002 by Bob Hanisch et al.
      </xsd:documentation>
      <xsd:documentation>
        Diff 0.05-0.06:  The Topologi tool apparently doesn't like
	  annotations of global elements referenced locally.
	  Although, this does not appear to be in violation of the XML
	  Schema standard, they have been commented out for the time
	  being. 
        Diff 0.06-0.1:  Changed target namespace to 
          http://www.ivoa.net/xml/prop/VOResource.
      </xsd:documentation>
   </xsd:annotation>

   <!-- Define reusable and extendable datatypes     -->

   <xsd:complexType name="genericResource">
     <xsd:annotation>
       <xsd:documentation>
         This is a base type for defining specific kinds of resources
         (e.g. service, data collection, etc.).  See Resource for a
         generic definition of a resource.
       </xsd:documentation>
     </xsd:annotation>

     <xsd:sequence>
        <xsd:element ref="vor:Title"/>
        <xsd:element ref="vor:Identifier"/>
        <xsd:element ref="vor:Curation"/>
        <xsd:element ref="vor:Content" minOccurs="0"/>
        <xsd:element ref="vor:Coverage" minOccurs="0"/>
     </xsd:sequence>

     <xsd:attribute name="ref" type="xsd:anyURI">
       <xsd:annotation>
         <xsd:documentation>
           The resource indicated by this element is the one referred
           to by the given URI.  This attribute should be ignored unless
           the element's content is empty.  
         </xsd:documentation>
       </xsd:annotation>
     </xsd:attribute>

     <xsd:attribute name="managedBy" type="xsd:anyURI">
       <xsd:annotation>
         <xsd:documentation>
           The URI for another resource that is responsible for maintaining
           this resource.
         </xsd:documentation>
       </xsd:annotation>
     </xsd:attribute>
   </xsd:complexType>

   <xsd:complexType name="nameList">
      <xsd:sequence>
         <xsd:element name="item" type="xsd:string" minOccurs="1" 
                      maxOccurs="unbounded">
            <xsd:annotation>
               <xsd:documentation>
                  Member of an itemized list
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="dateType">
      <xsd:sequence>
         <xsd:element name="Begin" type="xsd:decimal" minOccurs="1" 
                      maxOccurs="unbounded">
            <xsd:annotation>
               <xsd:documentation>
                 Begin date in decimal years
               </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
         <xsd:element name="End" type="xsd:decimal" minOccurs="0" 
                      maxOccurs="unbounded">
            <xsd:annotation>
               <xsd:documentation>
                  End date in decimal years (optional)
            </xsd:documentation>
            </xsd:annotation>
         </xsd:element>
      </xsd:sequence>
   </xsd:complexType>

   <xsd:complexType name="genericInterface">
      <xsd:annotation>
         <xsd:documentation>
           This is a base type for defining specific kinds of service 
           descriptions.
         </xsd:documentation>
      </xsd:annotation>

      <xsd:attribute ref="vor:defaultTo"/>
   </xsd:complexType>

   <xsd:complexType name="genericCapability">
      <xsd:annotation>
         <xsd:documentation>
           This is a base type for defining specific kinds of service 
           capability descriptions, each with its own special mark-up schema.
         </xsd:documentation>
      </xsd:annotation>

      <xsd:sequence> 
         <xsd:element ref="vor:StandardURL" minOccurs="0" maxOccurs="1" />
      </xsd:sequence> 
      <xsd:attribute ref="vor:defaultTo"/>
   </xsd:complexType>

   <xsd:complexType name="standardCapability">
      <xsd:annotation>
         <xsd:documentation>
           This is a base type for defining standard interface
           capabilities.  A standard interface (from the perspective
           of this schema) is one that has been registeredk, and
           therefore has a Standard ID.
         </xsd:documentation>
      </xsd:annotation>

      <xsd:complexContent>
         <xsd:extension base="vor:genericCapability">
            <xsd:sequence>
               <xsd:element ref="vor:StandardID" minOccurs="0" maxOccurs="1" />
            </xsd:sequence>
         </xsd:extension>
      </xsd:complexContent>
   </xsd:complexType>

   <!-- End definition of reusable and extendable datatypes     -->

   <!-- reusable attributes -->

   <xsd:attribute name="defaultTo" type="xsd:anyURI">
     <xsd:annotation>
         <xsd:documentation>
           If provided, then any data not provided by the content of
           this element should default to the corresponding data found 
           in the resource description pointed to by the given URI.  
         </xsd:documentation>
         <xsd:documentation>
           The URI should, therefore, refer to a Resource Description.
           This URI is expected to be resolved by a VO registry.
         </xsd:documentation>
         <xsd:documentation>
           Example:  if a Curation element uses this attribute, the 
           default values for the curation data should be drawn from 
           the Curation element of the referred Resource description.
         </xsd:documentation>
     </xsd:annotation>
   </xsd:attribute>

   <!-- End of reusable attributes -->

   <!-- reusable elements -->

   <xsd:element name="VODescription">
      <xsd:annotation>
         <xsd:documentation>
           A description of one or more VO Resources
         </xsd:documentation>
         <xsd:documentation>
           This element is used as a general container for multiple resource
           descriptions and is intended to be used as a root element.
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref="vor:Resource" maxOccurs="unbounded"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name="Resource" type="vor:genericResource">
     <xsd:annotation>
       <xsd:documentation>
          Any entity that is curated by an organization and is
          identifiable by a URI 
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="Curation">
     <xsd:annotation>
       <xsd:documentation>
         Information regarding the general curation of the resource
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
       <xsd:sequence>
         <xsd:element ref="vor:Publisher" minOccurs="0"/>
         <xsd:element ref="vor:Creator" minOccurs="0"/>
         <xsd:element ref="vor:Contributor" minOccurs="0"/>
         <xsd:element ref="vor:ReferenceURL" minOccurs="0"/>
         <xsd:element ref="vor:Contact" minOccurs="0"/>
       </xsd:sequence>

       <xsd:attribute ref="vor:defaultTo">
         <xsd:annotation>
           <xsd:documentation>
             This will often be set to the URI given in the Resource's 
             "managedBy" attribute.
           </xsd:documentation>
         </xsd:annotation>
       </xsd:attribute>
     </xsd:complexType>
   </xsd:element>


   <xsd:element name="Content">
     <xsd:annotation>
       <xsd:documentation>
         Information regarding the general content within or managed
	 by the resource
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
       <xsd:sequence>
         <xsd:element ref="vor:Date" minOccurs="0"/>
         <xsd:element ref="vor:Version" minOccurs="0"/>
         <xsd:element ref="vor:Description" minOccurs="0"/>
         <xsd:element ref="vor:Subject" minOccurs="0"/>
         <xsd:element ref="vor:ContentLevel" minOccurs="0"/>
         <xsd:element ref="vor:Facility" minOccurs="0"/>
         <xsd:element ref="vor:Instrument" minOccurs="0"/>
         <xsd:element ref="vor:Format" minOccurs="0"/>
         <xsd:element ref="vor:Rights" minOccurs="0"/>
       </xsd:sequence>

       <xsd:attribute ref="vor:defaultTo">
         <xsd:annotation>
           <xsd:documentation>
             This will often be set to the URI given in the Resource's 
             "managedBy" attribute.
           </xsd:documentation>
         </xsd:annotation>
       </xsd:attribute>
     </xsd:complexType>
   </xsd:element>

   <xsd:element name="Title">
      <xsd:annotation>
         <xsd:documentation>Name Given to the Resource</xsd:documentation>
      </xsd:annotation>

      <xsd:complexType>
        <xsd:simpleContent>
          <xsd:extension base="xsd:string">
            <xsd:attribute ref="vor:defaultTo"/>
            <xsd:attribute name="shortName" type="xsd:string">
               <xsd:annotation>
                  <xsd:documentation>
                     A short name or abbreviation for this resource
                     that applications can use to refer to this
                     resource in a compact display.  One word or a few
                     letters is recommended.
                  </xsd:documentation>
               </xsd:annotation>
            </xsd:attribute>
          </xsd:extension>
        </xsd:simpleContent>
      </xsd:complexType>

   </xsd:element>

   <xsd:element name="Publisher" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           Entity responsible for making the resource available
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Creator">
      <xsd:annotation>
         <xsd:documentation>
           Block describing the entity primarily responsible for
           making the content of the resource
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref="vor:CreatorName" minOccurs="0"/>
            <xsd:element ref="vor:Logo" minOccurs="0"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name="CreatorName" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           Name of Entity primarily responsible for making the content 
           of the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Logo" type="xsd:anyURI">
      <xsd:annotation>
         <xsd:documentation>
           URL pointing to a graphical logo, which may be used to help 
           identify the information source
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Subject" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
           List of topics, object types, or other descriptive keywords 
           about the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Description" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           An account of the content of the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Contributor" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           Entity responsible for contributions to the content of 
           the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Date" type="xsd:date">
      <xsd:annotation>
         <xsd:documentation>
           Date associated with an event in the life cycle of the
           resource (YYYY-MM-DD)
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Version" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           Label associated with creation or availablilty
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Identifier" type="xsd:anyURI">
      <xsd:annotation>
         <xsd:documentation>
           Unambiguous reference to the resource within a given context
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="ReferenceURL" type="xsd:anyURI">
      <xsd:annotation>
         <xsd:documentation>
           URL pointing to further information about the resource.  In
           general, this should be a human-readable document.
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="ServiceURL" type="xsd:anyURI">
      <xsd:annotation>
         <xsd:documentation>
           URL pointing to further information about the service
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Contact">
      <xsd:annotation>
         <xsd:documentation>
           Block describing contact persons responsible for the resource
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref="vor:Name" minOccurs="0"/>
            <xsd:element ref="vor:Email" minOccurs="0"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name="Name" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           Name of contact persons responsible for the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Email" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
           E-mail address for contacting the persons responsible for 
           the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Type" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
           Nature or genre of the content of the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Coverage">
      <xsd:annotation>
         <xsd:documentation>
           Extent of the scope of the content of the resource
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref="vor:Spatial" minOccurs="0"/>
            <xsd:element ref="vor:Spectral" minOccurs="0"/>
            <xsd:element ref="vor:Temporal" minOccurs="0"/>
         </xsd:sequence>

         <xsd:attribute ref="vor:defaultTo"/>
      </xsd:complexType>
   </xsd:element>

   <xsd:element name="Spatial" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>Sky coverage of the resource</xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Spectral">
      <xsd:annotation>
         <xsd:documentation>
           Spectral coverage of the resource
         </xsd:documentation>
      </xsd:annotation>
      <xsd:complexType>
         <xsd:sequence>
            <xsd:element ref="vor:SpecDesc" minOccurs="0"/>
            <xsd:element ref="vor:Bandpass" minOccurs="0"/>
         </xsd:sequence>
      </xsd:complexType>
   </xsd:element>
   <xsd:element name="SpecDesc" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
            Specific Spectral Coverage Description
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="Bandpass" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
            Specific Bandpass Coverage Specification
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="Temporal" type="vor:dateType">
      <xsd:annotation>
         <xsd:documentation>
            Temporal coverage of the resource. Separate begin and end
            dates in decimal years (YYYY.DD)
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="ContentLevel" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
            Description of the content level, or intended audience
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="Facility" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
            Observatory or facility where the data was obtained
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="Instrument" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
            Instrument used to collect the data
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>
   <xsd:element name="Format" type="vor:nameList">
      <xsd:annotation>
         <xsd:documentation>
            Encoding format of data provided by the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Rights" type="xsd:string">
      <xsd:annotation>
         <xsd:documentation>
            Information about rights held in and over the resource
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="Organization" type="vor:genericResource" 
                substitutionGroup="vor:Resource">
     <xsd:annotation>
       <xsd:documentation>
          A group or person that manages data or services for VO applications
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="Project" type="vor:genericResource" 
                substitutionGroup="vor:Resource">
     <xsd:annotation>
       <xsd:documentation>
          An organization with a focused set of data and services that
          it maintains.
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="DataCollection" type="vor:genericResource" 
                substitutionGroup="vor:Resource">
     <xsd:annotation>
       <xsd:documentation>
          A logical grouping of data which, in general, is composed of 
          one or more accessible datasets.  
       </xsd:documentation>
       <xsd:documentation>
          (A dataset is a collection of digitally-encoded data with a
          that is normally accessible as a single unit, e.g. a file.)
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="Service" substitutionGroup="vor:Resource">
     <xsd:annotation>
       <xsd:documentation>
          A resource that provides an interface for executing some
          operation or retrieving data.
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
       <xsd:complexContent>
         <xsd:extension base="vor:genericResource">
           <xsd:sequence>
             <xsd:element ref="vor:Capability" minOccurs="0"/>
             <xsd:element ref="vor:Interface" minOccurs="0"/>
           </xsd:sequence>
         </xsd:extension>
       </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>

<!-- the Interface Family of elements -->

   <xsd:element name="Interface" type="vor:genericInterface">
     <xsd:annotation>
       <xsd:documentation>
          A description (or pointer) to a service interface.
       </xsd:documentation>
       <xsd:documentation>
          Normally, a member of the Interface substitutionGroup is
          used to provide this information.  Interface, by itself,
          allows no content, and thus can only be used to refer to
          another description via the defaultsTo attribute.
       </xsd:documentation>
       <xsd:documentation>
          Custom content can be provided by first creating a new type that
          extends genericInterface.  Next, use the Interface element
          and specify the new type via the xsi:type attribute.  
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="InterfaceURL" type="xsd:anyURI">
     <xsd:annotation>
       <xsd:documentation>
          A URL that points to a document that presents or describes
          a service interface.  
       </xsd:documentation>
       <xsd:documentation>
          For an Web browser-based service, this might be the URL for
          the form; for a Web Service, this might be the URL to the
          WSDL description.  It is not the base URL for the service
          itself (see BaseURL), nor it is a SOAP port URL.  
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="BaseURL" type="xsd:anyURI">
     <xsd:annotation>
       <xsd:documentation>
          The base portion of a URL used to invoke a service with the
          expectation that an additional string must be appended for
          the service to execute properly.  The syntax of the appended
          string is defined by the specific service.
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="StandardID" type="xsd:anyURI">
     <xsd:annotation>
       <xsd:documentation>
          An identifier for a registered standard.  The form of this
          identifier is expected to conform to the VO standard
          guidelines. 
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="StandardURL" type="xsd:anyURI">
     <xsd:annotation>
       <xsd:documentation>
          A URL that points to a human-readable document that describes the 
          standard upon which a resource is based.
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="HTTPResults" type="xsd:string">
     <xsd:annotation>
       <xsd:documentation>
         The MIME type of a document returned by an HTTP Get.
       </xsd:documentation>
     </xsd:annotation>
   </xsd:element>

   <xsd:element name="WebBrowser" substitutionGroup="vor:Interface">
     <xsd:annotation>
       <xsd:documentation>
          A Service that is accessible via a Web browser (e.g. as an
          HTML Form or embedded applet).
       </xsd:documentation>
       <xsd:documentation>
          Note that the URL for help with this form can be put into
          the Service/ReferenceURL.
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
        <xsd:complexContent>
           <xsd:extension base="vor:genericInterface">
              <xsd:sequence>
                 <xsd:element ref="vor:InterfaceURL" minOccurs="1" maxOccurs="1">
<!--
                    <xsd:annotation>
                      <xsd:documentation>the form's URL</xsd:documentation>
                    </xsd:annotation>
  -->
                 </xsd:element>
              </xsd:sequence>
           </xsd:extension>
        </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>

   <xsd:element name="WebService" substitutionGroup="vor:Interface">
     <xsd:annotation>
       <xsd:documentation>
          A service describable by a WSDL document.
       </xsd:documentation>
       <xsd:documentation>
          Note that the URL for help with this service can be put into
          the Service/ReferenceURL element.
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
        <xsd:complexContent>
           <xsd:extension base="vor:genericInterface">
              <xsd:sequence>
                 <xsd:element ref="vor:InterfaceURL" minOccurs="1" maxOccurs="1">
<!--
                    <xsd:annotation>
                      <xsd:documentation>
                         the URL to the WSDL document
                      </xsd:documentation>
                    </xsd:annotation>
  -->
                 </xsd:element>
              </xsd:sequence>
           </xsd:extension>
        </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>

   <xsd:element name="GLUService" substitutionGroup="vor:Interface">
     <xsd:annotation>
       <xsd:documentation>
          A service describable by a GLU Record
       </xsd:documentation>
     </xsd:annotation>

     <xsd:complexType>
        <xsd:complexContent>
           <xsd:extension base="vor:genericInterface">
              <xsd:sequence>
                 <xsd:element ref="vor:InterfaceURL" 
			      minOccurs="1" maxOccurs="1">
<!--
                    <xsd:annotation>
                      <xsd:documentation>
                         the URL that retrieves the GLU Record for
                         this service.  
                      </xsd:documentation>
                    </xsd:annotation>
  -->
                 </xsd:element>
              </xsd:sequence>
           </xsd:extension>
        </xsd:complexContent>
     </xsd:complexType>
   </xsd:element>

<!-- the Capability Family of elements -->

   <xsd:element name="Capability" type="vor:genericCapability">
      <xsd:annotation>
         <xsd:documentation>
            a specific description of the context and capabilities of
            a service.  
         </xsd:documentation>
         <xsd:documentation>
            By itself, this element can only point to an external
            document.  Custom content can be provided by first
            creating a new type that extends genericCapability.  Next, 
            use the Capability element and specify the new type via the
            xsi:type attribute. 
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

   <xsd:element name="StdCapability" type="vor:standardCapability"
                substitutionGroup="vor:Capability" >
      <xsd:annotation>
         <xsd:documentation>
            a specific description of the context and capabilities of
            a standard (registered) service.  
         </xsd:documentation>
         <xsd:documentation>
            By itself, this element can only point to an external
            document.  Custom content can be provided by first
            creating a new type that extends genericCapability.  Next, 
            use the Capability element and specify the new type via the
            xsi:type attribute. 
         </xsd:documentation>
      </xsd:annotation>
   </xsd:element>

</xsd:schema>


