<xsd:schema targetNamespace="http://docs.g-vo.org/schemata/DaCHS.xsd"
xmlns:tns="http://docs.g-vo.org/schemata/DaCHS.xsd"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:vr="http://www.ivoa.net/xml/VOResource/v1.0"
xmlns:vm="http://www.ivoa.net/xml/VOMetadata/v0.1"
elementFormDefault="unqualified"
attributeFormDefault="unqualified"
version="1.0">

  <xsd:import namespace="http://www.ivoa.net/xml/VOResource/v1.0"
  	schemaLocation="http://docs.g-vo.org/schemata/VOResource.xsd"/>

  <xsd:annotation>
    <xsd:appinfo>
      <vm:schemaName>TAPRegExt</vm:schemaName>
      <vm:schemaPrefix>xs</vm:schemaPrefix>
      <vm:targetPrefix>tr</vm:targetPrefix>
    </xsd:appinfo>

     <xsd:documentation>
       A schema for holding schema items slated to enter VOResource
       while they are prototyped in DaCHS.  Items here may
       disapprear when we believe all adopters of the previous
       versions should have migrated.  And they may change without
       prior notice.

       In short: This is the VO's Old West.
     </xsd:documentation>
  </xsd:annotation>

  <!-- 2021: DALIInterface as proposed for TAPRegExt -->

  <xsd:complexType name="DALIInterface">
    <xsd:annotation>
      <xsd:documentation>
        An interface for a complex, multi-endpoint interfaces as
        regulated by DALI.
      </xsd:documentation>
      <xsd:documentation>
        In addition to the standard vr:Interface elements, DALIInterfaces
        have endpoints, listed by name; that name doubles as a path segment
        to append to the interface's access URL, yielding the URI at
        which the endpoint is operated.
      </xsd:documentation>
    </xsd:annotation>
    
    <xsd:complexContent>
      <xsd:extension base="vr:Interface">
        <xsd:sequence>
          <xsd:element name="endpoint" type="tns:Endpoint"
              minOccurs="0" maxOccurs="unbounded">
            <xsd:annotation>
              <xsd:documentation>
                An endpoint accessible through this interface.
              </xsd:documentation>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:extension>
    </xsd:complexContent>
  </xsd:complexType>

  <xsd:complexType name="Endpoint">
    <xsd:annotation>
      <xsd:documentation>
        An endpoint of a complex interface.
      </xsd:documentation>
      <xsd:documentation>
        An endpoint is characterised and addrssed by its name;
        they can further be defined through RDF triples.  This is a
        generic extension mechanism for endpoint-specific metadata,
        primarily intended for custom, vendor-specific extensions.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:sequence>
      <xsd:element name="name" type="xsd:token"
          minOccurs="1" maxOccurs="1">
        <xsd:annotation>
          <xsd:documentation>
            The endpoint name, which is also the last component of the
            path of its URI.
          </xsd:documentation>
          <xsd:documentation>
            Names without dashes are reserved for IVOA use and are expected to
            work the same way on all services.  Well-known examples for
            such endpoint names include sync, async, and tables.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>

      <xsd:element name="meta" type="tns:MetaTriple"
          minOccurs="0" maxOccurs="unbounded">
        <xsd:annotation>
          <xsd:documentation>
            Auxiliary information on this endpoint.
          </xsd:documentation>
        </xsd:annotation>
      </xsd:element>
    </xsd:sequence>
  </xsd:complexType>

  <xsd:complexType name="MetaTriple">
    <xsd:annotation>
      <xsd:documentation>
        A container for an RDFa triple giving information related to
        an endpoint.
      </xsd:documentation>
    </xsd:annotation>
    <xsd:simpleContent>
      <xsd:extension base="xsd:token">
        <xsd:attribute name="about" type="xsd:anyURI" use="optional">
          <xsd:annotation>
            <xsd:documentation>
              The subject of the statement.
            </xsd:documentation>
            <xsd:documentation>
              If missing, the endpoint itself is assumed as the subject.
            </xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="property" type="xsd:anyURI" use="required">
          <xsd:annotation>
            <xsd:documentation>
              The property of the statement.
            </xsd:documentation>
            <xsd:documentation>
              This is a reference to an RDF resource.  IVOA standards may define
              semantics for scheme-less URI; non-IVOA properties must use
              full URIs with at least scheme and authority; in this
              version, no vocab attributes are supported.
            </xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="resource" type="xsd:anyURI" use="optional">
          <xsd:annotation>
            <xsd:documentation>
              The object of the statement.
            </xsd:documentation>
            <xsd:documentation>
              If missing, the text content of the element is used as the
              object.
            </xsd:documentation>
          </xsd:annotation>
        </xsd:attribute>
      </xsd:extension>
    </xsd:simpleContent>
  </xsd:complexType>

</xsd:schema>
