<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:annotation>
    <xs:documentation>
VOcabulary schema, version 1.0 (FVH 2007-09-01):
A VOcabulary mainly consists of a simple list of entries which form the basis of the
vocabulary.  The only restrictions are that the VOcabulary have a name and a version number.  Each entry in the vocabulary defines a token string which forms the actual basis
of the vocabulary and can include additional information like short descriptions of what
that token can mean within the context and what equivalences there are with the IVOA
Standard Vocabulary (SV).   The latter are needed in order to translate between vocabularies.
The publishers of the vocabulary are encouraged to use the syntax rules used by the SV, e.g. a form for the token strings which is compatible with the UCD plus XML-namespace format.
    </xs:documentation>
  </xs:annotation>
  <xs:complexType name="ReferenceComplexType">
    <xs:annotation>
      <xs:documentation>
A reference to another VOcabulary used in the present one.  This element is used to identify the namespace and its prefix, the latter used via "{prefix}:".  The string content of the element is ignored.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="name" type="xs:string" use="optional"/>
        <xs:attribute name="ref" type="xs:anyURI" use="required"/>
        <xs:attribute name="prefix" type="xs:string" use="required"/>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="LanguageStringComplexType">
    <xs:annotation>
      <xs:documentation>
A string which can be optionally identified with a language via an ISO country code.
      </xs:documentation>
    </xs:annotation>
    <xs:simpleContent>
      <xs:extension base="xs:string">
        <xs:attribute name="lang" type="xs:string" use="optional" />	
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
  <xs:complexType name="DefinitionComplexType">
    <xs:annotation>
      <xs:documentation>
A single definition, corresponding to one of possibly multiple uses of the vocabulary's token string, consisting of a short descriptive text, aliases, and/or a corresponding equivalent s in external vocabularies (e.g. SV+UCD1) used to perform translations.
      </xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Description" type="LanguageStringComplexType" minOccurs="0"			 maxOccurs="1">
        <xs:annotation>
          <xs:documentation>
An optional short description of this particular definition (can be labeled as being in a particular language via the "lang" attribute).
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Alias" type="LanguageStringComplexType" minOccurs="0"				 maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>
An optional free-format alias for the token string which are valid within the same context (may be more than one and can be labeled as being in a particular language via the "lang" attribute).
          </xs:documentation>
        </xs:annotation>
      </xs:element>
      <xs:element name="Equivalence" type="xs:string" minOccurs="0" maxOccurs="unbounded">
        <xs:annotation>
          <xs:documentation>
An optional taxonometric/ontological equivalent of the label, expressed as semi-colon-separated concatenations of external tokens (may be more than one).  The namespaces should be identified using prefixes, e.g. "ucd:" or "sv:".
          </xs:documentation>
        </xs:annotation>
      </xs:element>
    </xs:sequence>
  </xs:complexType>
  <xs:complexType name="EntryComplexType">
    <xs:annotation>
      <xs:documentation>Definition of a single vocabulary entry.</xs:documentation>
    </xs:annotation>
    <xs:sequence>
      <xs:element name="Definition" type="DefinitionComplexType" minOccurs="0"				 maxOccurs="unbounded"/>
    </xs:sequence>
    <xs:attribute name="token" type="xs:string" use="required">
    <xs:annotation>
      <xs:documentation>
The token string which is the actual basis of the vocabulary (not to be confused with XML NMTOKENs).
      </xs:documentation>
    </xs:annotation>
    </xs:attribute>	
  </xs:complexType>
  <xs:element name="VOcabulary">
    <xs:annotation>
      <xs:documentation>
Top-level element of a named and versioned IVOA vocabulary, consisting of a description and a sequence of entries.
      </xs:documentation>
    </xs:annotation>
  <xs:complexType>
    <xs:sequence>
      <xs:element name="Description" type="LanguageStringComplexType" minOccurs="0"			 maxOccurs="1">
        <xs:annotation>
          <xs:documentation>A short description of the vocabulary (optional).</xs:documentation>
        </xs:annotation>
      </xs:element>
       <xs:element name="Reference" type="ReferenceComplexType" minOccurs="0" 				maxOccurs="unbounded" />
        <xs:element name="Entry" type="EntryComplexType" minOccurs="1" 					maxOccurs="unbounded" />
        </xs:sequence>
        <xs:attribute name="id" type="xs:anyURI" use="required">
          <xs:annotation>
            <xs:documentation>
The unique identifier of the VOcabulary, e.g. an IVOA-registered IVORN with the prefix "ivo://".
          </xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="name" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation>The formal name of the vocabulary (required).</xs:documentation>
        </xs:annotation>
      </xs:attribute>
      <xs:attribute name="version" type="xs:string" use="required">
        <xs:annotation>
          <xs:documentation>The version number of the vocabulary (required).</xs:documentation>
        </xs:annotation>
      </xs:attribute>
    </xs:complexType>
  </xs:element>
</xs:schema>
