Schema document for namespace http://xml.opendap.org/ns/DAP/4.0#



Import http://www.w3.org/XML/1998/namespace

Formal declaration in XSD source form


	<xs:import
      	namespace="http://www.w3.org/XML/1998/namespace"
      	schemaLocation="xml.xsd"/>

Import http://www.w3.org/1999/xlink

Formal declaration in XSD source form

	<xs:import
      	namespace="http://www.w3.org/1999/xlink"
      	schemaLocation="xlink.xsd"/>

Import http://purl.org/dc/elements/1.1/

Formal declaration in XSD source form

	<xs:import
      	namespace="http://purl.org/dc/elements/1.1/"
      	schemaLocation="dc.xsd"/>

Element Dataset

About the Dataset document

In DAP2 and DAP4, a dataset is defined as a collection of variables, each of which is completely described by a tuple that consists of a name, type and value(s) along with a hierarchical collection of 'attributes' that themselves are made up of name-type-value(s) tuples. The variables are organized in a hierarchy.

The Dataset document is a text/xml representatin of those variables and their organiation within the dataset.

A note about XML element names:

Element names that start with capital letters correspond to parts of the DAP4 data model while those that start with lowercase letters are used for document structure and syntax.

About changes in going from DAP2 to DAP4

DAP 4.0 introduces SharedDimension, Group, Opaque, 64-bit integers and UnsignedByte. In addition: The syntax for Array has been changed so that it's easier for processing software to figure out the type of an array; Grids have been generalized so that there can be any number of 'Array' parts (and the Maps may be multi-dimensional); and the Attribute type OtherXML has been made its own element (it's no longer a type of 'Attribute').

Formal declaration in XSD source form


	<xs:element name="Dataset" type="DatasetT">
		
	</xs:element>

Complex type DatasetT

Dataset

This is the XML representation of a data source in DAP 4.

Note that the 'blob' element is only present when this is used as the prefix for the Data response.

Grammar: ( OtherXML*, Attribute*, Group+, blob? )

Element attributes:

name
The name of the data source; often a string used to uniquely reference the data source wrt a particular server
dapVersion
The protocol version that corresponds to this document.
xml:base
The URL the references the DAP4 service endoint used to access this dataset.

Formal declaration in XSD source form


	<xs:complexType name="DatasetT">
		

		<xs:sequence>
			<xs:group ref="Metadata"/>
			<xs:element
      			name="Group"
      			type="GroupT"
      			minOccurs="1"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="blob"
      			type="BlobT"
      			minOccurs="0"
      			maxOccurs="1"/>
		</xs:sequence>

		<xs:attribute
      		name="name"
      		type="xs:string"
      		use="required"/>
		<xs:attribute
      		name="dapVersion"
      		type="xs:string"
      		use="required"/>
		<xs:attribute ref="xml:base" use="required"/>
	</xs:complexType>

Model group Metadata

Notes

 These elements are used in several places to hold the 'semantic'
and/or 'use' metadata for the dataset, its groups and variables. ( OtherXML*,
Attribute* )

Formal declaration in XSD source form


	<xs:group name="Metadata">
		
		<xs:sequence>
			<xs:element
      			name="OtherXML"
      			type="OtherXmlT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="Attribute"
      			type="AttributeT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
		</xs:sequence>
	</xs:group>

Complex type AttributeT

Notes

 DAP uses attributes as a way to encode information that data
providers has bundled with data sources. This element is recursive. Each Attribute
element defines a lexical scope. name: The name of the attribute; must be unique
within the scope. type: The type of the attribute. Attributes are limited to simple
types, vectors of simple types and 'Containers' which are essentially structure
types. namespace: Use this to indicate that the given attribute means the same thing
as the matching item in the given namespace. This optional attribute is here to help
preserve information that a data server might know to be true that a client
application could not assume with certainty. ( value+ | ( OtherXML*, Attribute* ) )

Formal declaration in XSD source form


	<xs:complexType name="AttributeT">
		

		<xs:choice>
			<xs:sequence>
				<xs:element
      				name="value"
      				type="xs:string"
      				maxOccurs="unbounded"/>
			</xs:sequence>
			<xs:sequence>
				<xs:group ref="Metadata"/>
			</xs:sequence>
		</xs:choice>

		<xs:attribute
      		name="name"
      		type="xs:string"
      		use="required"/>
		
		<xs:attribute
      		name="type"
      		type="AttributeTypeT"
      		use="required"/>
		<xs:attribute
      		name="namespace"
      		type="xs:string"
      		use="optional">
			
		</xs:attribute>
	</xs:complexType>

Simple type CardinalT

Notes

 Changes from DAP2 to DAP4: The Byte type is now signed and unsigned
bytes are now represented by the 'UByte' data type. The types Int64 and UInt64
represent signed and unsigned 64-bit integers. String uses UTF-8 in DAP4.
Enumerations are now in the mix.

Formal declaration in XSD source form


	<xs:simpleType name="CardinalT">
		
		<xs:restriction base="xs:string">
			<xs:enumeration value="Byte"/>
			<xs:enumeration value="UByte"/>
			<xs:enumeration value="Int16"/>
			<xs:enumeration value="UInt16"/>
			<xs:enumeration value="Int32"/>
			<xs:enumeration value="UInt32"/>
			<xs:enumeration value="Int64"/>
			<xs:enumeration value="UInt64"/>
			<xs:enumeration value="Float32"/>
			<xs:enumeration value="Float64"/>
			<xs:enumeration value="String"/>
			<xs:enumeration value="Url"/>
			<xs:enumeration value="Enum"/>
		</xs:restriction>
	</xs:simpleType>

Simple type OpaqueT

Notes

 This is essentially a BLOB type. Like a String, it is a type with
varying size and it can be used in Structures, Arrays and Sequences. It cannot,
howerver, be part of a Grid.

Formal declaration in XSD source form


	<xs:simpleType name="OpaqueT">
		

		<xs:restriction base="xs:string">
			<xs:enumeration value="Opaque"/>
		</xs:restriction>
	</xs:simpleType>

Simple type ContainerT

Notes

 The Container type is used to hold structure (or 'Container')
attributes. These correspond to the netCDF4/HDF5 compound type for attributes.

Formal declaration in XSD source form


	<xs:simpleType name="ContainerT">
		

		<xs:restriction base="xs:string">
			<xs:enumeration value="Container"/>
		</xs:restriction>
	</xs:simpleType>

Simple type AttributeTypeT

Notes

 Hack: Here Attribute types are apparently defined as scalars or
Containers. However, they are actually scalars, vectors or containers.

Formal declaration in XSD source form


	<xs:simpleType name="AttributeTypeT">
		

		<xs:union memberTypes="CardinalT ContainerT"/>
	</xs:simpleType>

Complex type OtherXmlT

Notes

 Use this to embed arbitrary XML in a DDX. This functions like an
Attribute and appears in the same places as an Attribute, but its contents are
ignored by DAP software. Other software might find the information useful. The XML
elements must satisfy the requirements for 'lax' processing under schema 1.0. In
practice, that means just about anything. Using ##other versus ##any means that the
enclosed XML MUST declare its namespace(s) and each element must be in a ns other
than dap4's. Of course, the namespace(s) used by the XML might be declared elsewhere
in the doc. name: A name to associate with this chunk of XML *: This element can
contain any other attributes that conform to the schema 1.0 definition of 'lax'
processing ( xs:any+ )

Formal declaration in XSD source form


	<xs:complexType name="OtherXmlT">
		
		<xs:sequence>
			<xs:any
      			namespace="##other"
      			minOccurs="1"
      			maxOccurs="unbounded"
      			processContents="lax"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string"/>
		<xs:anyAttribute
      		processContents="lax"
      		namespace="##other"/>
	</xs:complexType>

Complex type GroupT

Notes

 A Group is a lexical scoping tool used to replicate HDF5 and netCDF4
Groups. Each Group defines a lexical scope. Each dataset has at least one Group; if
only one is present, it may be anonymous. In this case, by convention, it's name
attribute should be 'anonymous', the default value. name: The name of the Group (
OtherXML*, Attribute*, Dimension*, ScalarType+ )

Formal declaration in XSD source form


	<xs:complexType name="GroupT">
		
		<xs:sequence>
			<xs:group ref="Metadata"/>
			<xs:element
      			name="Group"
      			type="GroupT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="Dimension"
      			type="DimensionT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="Enumeration"
      			type="EnumerationT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:group
      			ref="AllVariableTypes"
      			minOccurs="1"
      			maxOccurs="unbounded"/>
		</xs:sequence>
		<xs:attribute
      		name="name"
      		type="xs:string"
      		default="root"/>
	</xs:complexType>

Complex type DimensionT

Notes

 This defines a dimension (a name and size) that may be shared between
Grids and/or Arrays. name: The name of the dimension size: The size of the dimension

Formal declaration in XSD source form


	<xs:complexType name="DimensionT">
		
		<xs:attribute
      		name="name"
      		type="xs:string"
      		use="required"/>
		<xs:attribute
      		name="size"
      		type="xs:integer"
      		use="required"/>
	</xs:complexType>

Complex type EnumerationElementT

Notes

 One name-value pair for an enumeration. Values must be integers and
the values must be strings.

Formal declaration in XSD source form


	<xs:complexType name="EnumerationElementT">
		
		<xs:attribute
      		name="name"
      		type="xs:string"
      		use="required"/>
		<xs:attribute
      		name="value"
      		type="xs:string"
      		use="required"/>
	</xs:complexType>

Complex type EnumerationT

Notes

 This defines an enumeration. name: The name of the dimension type:
The size of the dimension

Formal declaration in XSD source form


	<xs:complexType name="EnumerationT">
		

		<xs:choice>
			<xs:element
      			name="elt"
      			type="EnumerationElementT"
      			minOccurs="1"
      			maxOccurs="unbounded"/>
		</xs:choice>

		<xs:attribute
      		name="name"
      		type="xs:string"
      		use="required"/>
	</xs:complexType>

Model group CardinalTypes

Notes

 DAP cardinal data types

Formal declaration in XSD source form


	<xs:group name="CardinalTypes">
		
		<xs:choice>
			<xs:element name="Byte" type="BaseType"/>
			<xs:element name="UByte" type="BaseType"/>
			<xs:element name="Int16" type="BaseType"/>
			<xs:element name="UInt16" type="BaseType"/>
			<xs:element name="Int32" type="BaseType"/>
			<xs:element name="UInt32" type="BaseType"/>
			<xs:element name="Int64" type="BaseType"/>
			<xs:element name="UInt64" type="BaseType"/>
			<xs:element name="Float32" type="BaseType"/>
			<xs:element name="Float64" type="BaseType"/>
			<xs:element name="String" type="BaseType"/>
			<xs:element name="Url" type="BaseType"/>
			<xs:element name="Enum" type="EnumT"/>
			<xs:element name="Opaque" type="OpaqueT"/>
		</xs:choice>
	</xs:group>

Model group ArrayVariableTypes

Formal declaration in XSD source form


	<xs:group name="ArrayVariableTypes">
		<xs:choice>
			<xs:group ref="CardinalTypes"/>

			<xs:element name="Structure" type="StructureT"/>
		</xs:choice>
	</xs:group>

Model group AllVariableTypes

Formal declaration in XSD source form


	<xs:group name="AllVariableTypes">
		<xs:choice>
			<xs:group ref="ArrayVariableTypes"/>

			<xs:element
      			name="Array"
      			type="ArrayT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="Grid"
      			type="GridT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
			<xs:element
      			name="Sequence"
      			type="SequenceT"
      			minOccurs="0"
      			maxOccurs="unbounded"/>
		</xs:choice>
	</xs:group>

Complex type BaseType

Notes

 Each variable in DAP4 is represented as a name and a collection of
metadata (Attributes, ...). The type of the variable is given in the element name
(e.g., <Byte name="x"/>) name: The name of the variable ( OtherXML*, Attribute*)

The attribute 'id' represents the locally (as in within the dataset) unique
identifier of the variable. This is usually period separated concatanation of the
values of the name attributes of the enclosing variables, starting with the outermost
and ending with the name of the variable instance.


Is it the case that we want dap:id to be used when clients are selecting data? If so then I think the server would have to be able to accept these id's as part of the projection/selection Or - is it the case that we want to continue to use the "name" as the data selector - even though the use of name is indeterminate w.r.t many datasets and we KNOW that the current dap implementations return the first variable associated with a matching 'name' value. It may be that we want to change server behavior to accept only full variable names.

Formal declaration in XSD source form


	<xs:complexType name="BaseType">
	    
		<xs:sequence>
			<xs:group ref="Metadata"/>
		</xs:sequence>
		<xs:attribute name="name" type="xs:string"/>
	    <xs:attribute
      	    name="id"
      	    type="xs:string"
      	    form="qualified"/>
	</xs:complexType>

Complex type ArrayDimensionT

Notes

 name: The name of the dimension size: The size of the dimension ref:
A reference to a Dimension definition Note: either name and size must be present or
only ref must be present

Formal declaration in XSD source form


	<xs:complexType name="ArrayDimensionT">
		

		<xs:attribute name="name" type="xs:string"/>
		<xs:attribute name="size" type="xs:integer"/>
		<xs:attribute name="ref" type="xs:string"/>
	</xs:complexType>

Complex type EnumT

Notes

 

Formal declaration in XSD source form


	<xs:complexType name="EnumT">
		

		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:attribute
      				name="type"
      				type="xs:string"
      				use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type dimensionsT

Notes

 

Formal declaration in XSD source form


	<xs:complexType name="dimensionsT">
		
		<xs:choice>
			<xs:element
      			name="dim"
      			type="ArrayDimensionT"
      			minOccurs="1"
      			maxOccurs="unbounded"/>
		</xs:choice>
	</xs:complexType>

Complex type arrayTypeT

Notes

 

Formal declaration in XSD source form


	<xs:complexType name="arrayTypeT">
		
		<xs:choice>
			<xs:group
      			ref="ArrayVariableTypes"
      			minOccurs="1"
      			maxOccurs="1"/>
		</xs:choice>
	</xs:complexType>

Complex type ArrayT

Notes

 name: The name of the variable. NB: DAP4 allows for arrays of every
type except: Grid or Sequence. Since the 'Array' element may list N dimensions
(using the 'dim' child elements), the syntax does not allow 'Array' elements to be
children of 'Array'. Like Grids, Array dimensions may use name and size or a
reference to a Dimension. The scope in which the Dimension can be located is limited
to an enclosing Group (but it is not limited to the immediate parent Group). (
OtherXML*, Attribute*, type, dimensions)

Formal declaration in XSD source form


	<xs:complexType name="ArrayT">
		
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					
					<xs:element
      					name="type"
      					type="arrayTypeT"
      					minOccurs="1"
      					maxOccurs="1"/>
					<xs:element
      					name="dimensions"
      					type="dimensionsT"
      					minOccurs="1"
      					maxOccurs="1"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type GridT

Notes

 A Grid is a type that relates one or more Maps (aka coordinate
variables) to the dimensions of one or more Array variables. It is often the case
that Maps correspond to independent variables like Latitude or sample number and
Arrays represent dependent variables. Note that Map elements either specify a name
and size or reference a Dimension. The scope in which the Dimension can be located
is limited to an enclosing Group (but it is not limited to the immediate parent
Group). name: The name of the variable ( OtherXML*, Attribute*, Array+, Map+)

Formal declaration in XSD source form


	<xs:complexType name="GridT">
		
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					
					<xs:element
      					name="Array"
      					type="ArrayT"
      					minOccurs="1"
      					maxOccurs="unbounded"/>
					<xs:element
      					name="Map"
      					type="MapT"
      					minOccurs="1"
      					maxOccurs="unbounded"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type MapT

Notes

 name: Name for this Map. Maps are associated with Array dimentions by
name, so this is a required attribute. type: The type of a Map is limited to the
Cardinal types. NB: Note the limitation on the type of a Map, which excludes Maps
that are Opaques, Structures, Sequences or Grids. ( OtherXML*, Attribute*,
dimensions )

Formal declaration in XSD source form


	<xs:complexType name="MapT">
		
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					<xs:element
      					name="dimensions"
      					type="dimensionsT"
      					minOccurs="1"
      					maxOccurs="1"/>
				</xs:sequence>

				<xs:attribute
      				name="type"
      				type="CardinalT"
      				use="required"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type allTypeT

Notes

 

Formal declaration in XSD source form


	<xs:complexType name="allTypeT">
		
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:group
      				ref="AllVariableTypes"
      				minOccurs="1"
      				maxOccurs="unbounded"/>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type StructureT

Notes

 A Structure; a simple aggregation of variables. Unlike a Group, it's
possible to from an Array of Structures. name: The name of the variable ( OtherXML*,
Attribute*, ( Byte | ... | Grid )+ )

Formal declaration in XSD source form


	<xs:complexType name="StructureT">
		

		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					<xs:element
      					name="type"
      					type="allTypeT"
      					minOccurs="1"
      					maxOccurs="1"/>
				</xs:sequence>

			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type SequenceT

Notes

 A Sequence is a type that holds tabular data where each row of the
table represents a relation, as in a relational database. Sequences can nest, but
Arrays of Sequences are not supported. name: The name of the variable ( OtherXML*,
Attribute*, ( Byte | ... | Grid )+ )

Formal declaration in XSD source form


	<xs:complexType name="SequenceT">
		
		<xs:complexContent>
			<xs:extension base="BaseType">
				<xs:sequence>
					<xs:element
      					name="type"
      					type="allTypeT"
      					minOccurs="1"
      					maxOccurs="1"/>
				</xs:sequence>
			</xs:extension>
		</xs:complexContent>
	</xs:complexType>

Complex type BlobT

The 'Blob' element is used to point to an associated data document. When DAP is used to access metadata only for a data source, no 'blob' element will be present. However, when a request for data is made, the Dataset element holds a description of the data values and the blob points to a place where those values will be found. In DAP4 the Blob element refers to binary (application/octet-stream) part within a multi-part MIME document or it refers to a separate document, possibly not imediately available. The latter case is included to support asynchronous responses (i.e., responses that cannot be returned quickly). See http://www.w3.org/TR/xlink11/.

The dc:date child element

If present, the element indicates the time or time range when the information will be available. This is only sensible (i.e., valid) when the response is asynchronous (i.e., xlink:role="http://xml.opendap.org/dap/DAP4#asynchronous"). Dublin core defines both a date and a date range. In the case of a date, this element indicates when the information will likely be available; when its value is a range, it denotes the when it will likely be present and when it wil go away.

Examples of the element:

  • <dc:date>1994-11-05T13:15:30Z</dc:date>
  • <dc:date>1994-11-05T13:15:30Z/1994-11-06T00:00:00Z</dc:date>

Element attributes:

xlink:href:
Refers to the multi-part MIME document part that holds the data values, encoded using XDR or to a separate document. In the first case, the IRI must begin with 'cid:' (see the owsManifest schema for an example of this use; http://schemas.opengis.net/ows/2.0/owsManifest.xsd). In the latter case, the IRI must refer to a remote resourse, and will likely start 'http:'.
xlink:type:
Always 'simple'.
xlink:role:
If present the only values DAP4 supports are 'asynchronousResponse' and 'synchronousResponse'.

Formal declaration in XSD source form


	<xs:complexType name="BlobT">
		
		<xs:all>
			<xs:element ref="dc:date" minOccurs="0"/>
		</xs:all>

		<xs:attribute
      		ref="xlink:type"
      		use="optional"
      		default="simple"/>
		<xs:attribute ref="xlink:href" use="required"/>
		<xs:attribute ref="xlink:role" use="optional"/>
	</xs:complexType>