<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://www.ivoa.net/xml/OpenSkyNode/v0.1" elementFormDefault="qualified" attributeFormDefault="unqualified" version="0.3" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:vr="http://www.ivoa.net/xml/VOResource/v0.10" xmlns:vs="http://www.ivoa.net/xml/VODataService/v0.5" xmlns:osn="http://www.ivoa.net/xml/OpenSkyNode/v0.1">
	<xs:annotation>
		<xs:documentation>
        Implementation of an XML Schema describing a SkyNode Service.
        Based on "http://www.ivoa.net/internal/IVOA/IvoaVOQL/SkyNodeInterface-0.7.4.pdf",
        </xs:documentation>
		<xs:documentation>
        Diff:
      </xs:documentation>
	</xs:annotation>
	<xs:import namespace="http://www.ivoa.net/xml/VOResource/v0.10"/>
	<xs:import namespace="http://www.ivoa.net/xml/VODataService/v0.5"/>
	<xs:complexType name="OpenSkyNode">
		<xs:annotation>
			<xs:documentation>
           Registry data for the  standard openskynode service. 
         </xs:documentation>
			<xs:documentation>
           The standard OpenSkyNode interface is defined to be WebService; 
           the specifics of this interface (e.g. the supported inputs)
           can be given using xsi:type="WebService" with the Interface 
           element.  
         </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="vs:TabularSkyService">
				<xs:sequence>
					<xs:element name="capability" type="osn:OSNCapability">
						<xs:annotation>
							<xs:documentation>
                        Specific meatadat for this OpenSkyNode
                     </xs:documentation>
							<xs:documentation>
                        It is not necessary to provide a value to the 
                        standardURL attribute as it defaults to the current
                        standard location.
                     </xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="OSNCapRestriction" abstract="true">
		<xs:annotation>
			<xs:documentation>
            an abstract capability that sets the standardURL to the OpenSkyNode
            standard definition
         </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:restriction base="vr:Capability">
				<xs:sequence/>
				<xs:attribute name="standardID" type="vr:IdentifierURI"/>
				<xs:attribute name="standardURL" type="xs:anyURI" default="http://www.ivoa.net/internal/IVOA/IvoaVOQL/SkyNodeInterface-0.7.4.pdf"/>
			</xs:restriction>
		</xs:complexContent>
	</xs:complexType>
	<xs:complexType name="OSNCapability">
		<xs:annotation>
			<xs:documentation>
            The capabilities of an OpenSkyNode implementation.  It includes required  parameters for OpenSkyQuery portal
            </xs:documentation>
		</xs:annotation>
		<xs:complexContent>
			<xs:extension base="osn:OSNCapRestriction">
				<xs:sequence>
					<xs:element name="Compliance" type="xs:string">
						<xs:annotation>
							<xs:documentation>
                       Indicates level of compliance: full, basic, partial for OSN. A full node
			must implement all the methods of the Spec including ExecutePlan.
			A Basic node only needs performQuery , tables, columns and availability.
                     </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="Latitude" type="xs:double">
						<xs:annotation>
							<xs:documentation>
                        The latitude Earth position of archive (GPS)
                            </xs:documentation>
						</xs:annotation>
					</xs:element>
										<xs:element name="Longitude" type="xs:double">
						<xs:annotation>
							<xs:documentation>
                        The longitude Earth position of archive (GPS)
                            </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="MaxRecords" type="xs:long" >
						<xs:annotation>
							<xs:documentation>
                        maximum records the service will return
                            </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="PrimaryTable" type="xs:string"  minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>
                        Table name which contains the main positions and key - used by the query builder on the portal.
                            </xs:documentation>
						</xs:annotation>
					</xs:element>
					<xs:element name="PrimaryKey" type="xs:string"   minOccurs="1" maxOccurs="1">
						<xs:annotation>
							<xs:documentation>
                       The primary key of the primary Table - used by the query builder on the portal. 
                            </xs:documentation>
						</xs:annotation>
					</xs:element>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>
</xs:schema>
