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

   <xs:annotation>
     <xs:appinfo>
       <vm:SchemaName>VOResource-v0.9</vm:SchemaName>
       <vm:schemaPrefix>xs</vm:schemaPrefix>
       <vm:targetPrefix>vr</vm:targetPrefix>
       <vm:version>0.8.1</vm:version>
     </xs:appinfo>
      <xs:documentation>
        Implementation of an XML Schema describing a resource to 
        be used in the Virtual Observatory Project.  Based on "Resource 
        Metadata for the Virtual Observatory", Version 0.8, 
        February 2002 by Bob Hanisch et al.
      </xs:documentation>
      <xs: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.
        Diff 0.8-0.1:  Updated for RM v0.8; jumped version # to match RM.
        Diff 0.8.1-0.8:  A proposed structuring of the RM model for v0.9
      </xs:documentation>
   </xs:annotation>

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

   <xs:element name="Resource" type="vr:ResourceType">
      <xs:annotation>
         <xs:documentation>
           Any entity that is describable and identifiable by a IVOA Identifier.
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="ResourceType">
      <xs:sequence>
         <xs:element ref="vr:Identifier"/>
         <xs:element ref="vr:Title"/>
         <xs:element ref="vr:ShortName" minOccurs="0"/>
         <xs:element ref="vr:Description" minOccurs="0"/>
         <xs:element ref="vr:ReferenceURL" minOccurs="0"/>
         <xs:element ref="vr:Type" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Identifier" type="vr:IdentifierType">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Identifier</vm:dcterm>
         </xs:appinfo>           
         <xs:documentation>
           Unambiguous reference to the resource conforming to the IVOA
           standard for identifiers
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="IdentifierType">
      <xs:sequence>
         <xs:element ref="vr:AuthorityID" />
         <xs:element ref="vr:ResourceKey" minOccurs="0" nillable="true"/>
      </xs:sequence>
   </xs:complexType>

  <xs:element name="AuthorityID" type="xs:string">
    <xs:annotation>
      <xs:documentation>the identifier of a namespace under the control of
         a single naming authority</xs:documentation>
    </xs:annotation>
  </xs:element>

  <xs:element name="ResourceKey" type="xs:string">
    <xs:annotation>
      <xs:documentation>a name for a resource that is unique within an 
         authority's namespace</xs:documentation>
    </xs:annotation>
  </xs:element>

   <xs:element name="Title" type="xs:string">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Title</vm:dcterm>
         </xs:appinfo>           
         <xs:documentation>the full name of a resource</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="ShortName" type="xs:string">
      <xs:annotation>
         <xs:documentation>
           a short name or abbreviation for this resource that applications 
           may use to refer to this resource in a compact display.   
         </xs:documentation>
         <xs:documentation>
           One word or a few letters is recommended.
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Description" type="xs:string">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Description</vm:dcterm>
         </xs:appinfo>           
         <xs:documentation>
           An account of the nature of the resource
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="ReferenceURL" type="xs:anyURI">
      <xs:annotation>
         <xs:documentation>
            URL pointing to a human-readable document describing this 
            resource.   
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Type" type="vr:catagoryType">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Type</vm:dcterm>
         </xs:appinfo>
         <xs:documentation>
           Nature or genre of the content of the resource
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:simpleType name="catagoryType">
     <xs:restriction base="xs:string">
         <xs:enumeration value="Archive">
           <xs:annotation>
             <xs:documentation>
               Collection of pointed observations
             </xs:documentation>
           </xs:annotation>
         </xs:enumeration>
         <xs:enumeration value="Bibliography"/>
         <xs:enumeration value="Catalog"/>
         <xs:enumeration value="Journal"/>
         <xs:enumeration value="Library"/>
         <xs:enumeration value="Simulation"/>
         <xs:enumeration value="Survey"/>
         <xs:enumeration value="Education"/>
         <xs:enumeration value="Outreach"/>
         <xs:enumeration value="EPOResource"/>
         <xs:enumeration value="Animation"/>
         <xs:enumeration value="Artwork"/>
         <xs:enumeration value="Background"/>
         <xs:enumeration value="BasicData"/>
         <xs:enumeration value="Historical"/>
         <xs:enumeration value="Photographic"/>
         <xs:enumeration value="Press"/>
         <xs:enumeration value="Organisation"/>
         <xs:enumeration value="Project"/>
         <xs:enumeration value="Person"/>
       </xs:restriction>
   </xs:simpleType>

   <xs:element name="ManagedResource" type="vr:ManagedResourceType" 
               substitutionGroup="vr:Resource">
      <xs:annotation>
         <xs:documentation>
           a resource that managed or curated by an organisation
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="ManagedResourceType">
     <xs:complexContent>
       <xs:extension base="vr:ResourceType">
         <xs:sequence>
           <xs:element ref="vr:Curation"/>
           <xs:element ref="vr:Subject" minOccurs="0"/>
         </xs:sequence>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>

   <xs:element name="Curation" type="vr:CurationType">
     <xs:annotation>
       <xs:documentation>
         Information regarding the general curation of the resource
       </xs:documentation>
     </xs:annotation>
   </xs:element>
   <xs:complexType name="CurationType">
     <xs:sequence>
       <xs:element ref="vr:Manager"/>
       <xs:element ref="vr:Contact"/>
       <xs:element ref="vr:Date" minOccurs="0"/>
       <xs:element ref="vr:Creator" minOccurs="0"/>
       <xs:element ref="vr:Contributor" minOccurs="0"/>
       <xs:element ref="vr:Version" minOccurs="0"/>
     </xs:sequence>
   </xs:complexType>

   <xs:element name="Manager" type="vr:ResourceReferenceType">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Publisher</vm:dcterm>
         </xs:appinfo>
         <xs:documentation>
           Entity (e.g. person or organisation) responsible for making the 
           resource available
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:complexType name="ResourceReferenceType">
      <xs:sequence>
         <xs:element ref="vr:Identifier" minOccurs="0"/>
         <xs:element ref="vr:Title" />
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Contact" type="vr:ContactType">
      <xs:annotation>
         <xs:documentation>
	   Information that can be used for contacting someone with
	   regard to this resource.
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="ContactType">
      <xs:sequence>
         <xs:element ref="vr:Name"/>
	 <xs:element ref="vr:Identifier" minOccurs="0"/>
         <xs:element ref="vr:Address" minOccurs="0"/>
         <xs:element ref="vr:Phone" minOccurs="0"/>
         <xs:element ref="vr:Email" minOccurs="0"/>
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Name" type="xs:string">
      <xs:annotation>
         <xs:documentation>the name of someone or something</xs:documentation>
         <xs:documentation>
	   This name may or may not refer to a resource; thus it is more
	   generic than "Title".
	 </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Address" type="xs:string">
      <xs:annotation>
         <xs:documentation>
	   the postal address of an entity (e.g. person or organization)
	 </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Phone" type="xs:string">
      <xs:annotation>
         <xs:documentation>
	   the telephone number of an entity (e.g. person or organization)
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Email" type="xs:string">
      <xs:annotation>
         <xs:documentation>an email address</xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Date" type="xs:date">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Date</vm:dcterm>
         </xs:appinfo>
         <xs:documentation>
	   Date associated with an event in the life cycle of the
	   resource.  
	 </xs:documentation>
         <xs:documentation>
	   This will typically be associated with the creation or availability 
	   (i.e., most recent release or version) of the resource.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Contributor" type="vr:NameReferenceType">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Contributor</vm:dcterm>
         </xs:appinfo>
         <xs:documentation>
            Entity responsible for contributions to the content of the resource
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="NameReferenceType">
      <xs:sequence>
         <xs:element ref="vr:Identifier" minOccurs="0"/>
         <xs:element ref="vr:Name" />
      </xs:sequence>
   </xs:complexType>

   <xs:element name="Creator" type="vr:CreatorType">
      <xs:annotation>
         <xs:appinfo>
           <vm:dcterm>Creator</vm:dcterm>
         </xs:appinfo>
         <xs:documentation>
	   The entity (e.g. person or organisation) primarily responsible for
	   creating the content or constitution of the resource
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:complexType name="CreatorType">
      <xs:complexContent>
         <xs:extension base="vr:NameReferenceType">
 	    <xs:sequence>
	       <xs:element ref="vr:Logo" minOccurs="0"/>
 	    </xs:sequence>
         </xs:extension>
      </xs:complexContent>
   </xs:complexType>

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

   <xs:element name="Version" type="xs:string">
      <xs:annotation>
         <xs:documentation>
	   Label associated with creation or availablilty of a version of 
	   a resource.
	 </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Subject" type="vr:SubjectType">
     <xs:annotation>
       <xs:documentation>
         Information regarding the general content within or managed
         by the resource
       </xs:documentation>
     </xs:annotation>
   </xs:element>
   <xs:complexType name="SubjectType">
      <xs:sequence>
      	 <xs:element ref="vr:Topic" minOccurs="0" maxOccurs="unbounded"/>
      	 <xs:element ref="vr:ContentLevel" minOccurs="0" maxOccurs="unbounded"/>
      	 <xs:element ref="vr:Facility" minOccurs="0" maxOccurs="unbounded"/>
      	 <xs:element ref="vr:Instrument" minOccurs="0" maxOccurs="unbounded"/>
      </xs:sequence>
   </xs:complexType>  

   <xs:element name="Topic" type="xs:string">
      <xs:annotation>
       	 <xs:appinfo>
       	   <vm:dcterm>Subject</vm:dcterm>
       	 </xs:appinfo>           
         <xs:documentation>
	   List of topics, object types, or other descriptive keywords 
	   about the resource.  
         </xs:documentation>
         <xs:documentation>
	   Terms for Subject should be drawn from the IAU Astronomy Thesaurus 
	   (http://msowww.anu.edu.au/library/thesaurus/).
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="ContentLevel" type="vr:ContentLevelType">
      <xs:annotation>
       	 <xs:appinfo>
       	   <vm:dcterm>Subject</vm:dcterm>
       	   <vm:dcterm>Subject.ContentLevel</vm:dcterm>
       	 </xs:appinfo>           
         <xs:documentation>
            Description of the content level or intended audience
         </xs:documentation>
      </xs:annotation>
   </xs:element>
   <xs:simpleType name="ContentLevelType">
       <xs:restriction base="xs:string">
         <xs:enumeration value="General">
           <xs:annotation>
             <xs:documentation>
               Resource provides information appropriate for all users
             </xs:documentation>
           </xs:annotation>
         </xs:enumeration>
         <xs:enumeration value="Elementary Education"/>
         <xs:enumeration value="Middle School Education"/>
         <xs:enumeration value="Secondary Education"/>
         <xs:enumeration value="Community College"/>
         <xs:enumeration value="University"/>
         <xs:enumeration value="Research"/>
         <xs:enumeration value="Amateur"/>
         <xs:enumeration value="Informal Education"/>
       </xs:restriction>
   </xs:simpleType>

   <xs:element name="Facility" type="vr:ResourceReferenceType">
      <xs:annotation>
       	 <xs:appinfo>
       	   <vm:dcterm>Subject</vm:dcterm>
       	   <vm:dcterm>Subject.Facility</vm:dcterm>
       	 </xs:appinfo>           
         <xs:documentation>
            the observatory or facility used to collect the data 
	    contained or managed by this resource.  
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="Instrument" type="vr:ResourceReferenceType">
      <xs:annotation>
       	 <xs:appinfo>
       	   <vm:dcterm>Subject</vm:dcterm>
       	   <vm:dcterm>Subject.Instrument</vm:dcterm>
       	 </xs:appinfo>           
         <xs:documentation>
            the Instrument used to collect the data contain or 
	    managed by a resource.  
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="OrgRef" type="vr:ResourceReferenceType">
      <xs:annotation>
         <xs:documentation>
	   A reference to an organization by its title and identifier
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="ProjectRef" type="vr:ResourceReferenceType">
      <xs:annotation>
         <xs:documentation>
	   A reference to an Project by its title and identifier
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="DataCollRef" type="vr:ResourceReferenceType">
      <xs:annotation>
         <xs:documentation>
	   A reference to a data collection by its title and identifier
         </xs:documentation>
      </xs:annotation>
   </xs:element>

   <xs:element name="ServiceRef" type="vr:ResourceReferenceType">
      <xs:annotation>
         <xs:documentation>
	   A reference to a service by its title and identifier
         </xs:documentation>
      </xs:annotation>
   </xs:element>

</xs:schema>
