DAP4 Dataset Services Response: Difference between revisions

From OPeNDAP Documentation
⧼opendap2-jumptonavigation⧽
 
(154 intermediate revisions by 3 users not shown)
Line 7: Line 7:
== Background ==
== Background ==


DAP2, while successful within several arenas in the scientific community, failed to live up to some the basic tenants of the world wide web. On of theses weaknesses was it's lack of RESTful interfaces.
Legacy DAP2 servers provide a number of  dataset level responses (services). These include DAP2 services such as the DDS, DAS, and DDX, plus other services that have been added over time such as the RDF and ISO responses. There is no method defined by the DAP2 protocol for a user (or software agent) to discover which of these many services might be available for a particular dataset.  While THREDDS catalogs do provide a mechanism for determining which services are associated with which datasets, they don't actually provide a mechanism for discovering the details of the various service URLs. A THREDDS catalog might identify a DAP2 service, but the URL that can be assembled from the THREDDS catalog for that service is limited to just the base dataset URL. Typically dereferencing this URL will provide one of two things - either the underlying data file (for example a netcdf file) or an HTTP 403 error if direct access to the underlying files has been disabled in the server configuration.
 
== Problem addressed ==
 
Currently DAP servers provide a number of  dataset level responses (services). These include DAP services such as the DDS, DAS, and DDX, plus other services that have been added over time such as the RDF and ISO responses. There is currently no way for a user (or software agent) to discover which of these many services might be available for a particular dataset.  While THREDDS catalogs do provide a mechanism for determining which services are associated with which datasets, they don't actually provide a mechanism for discovering the details of the various service URLs. A THREDDS catalog might identify a DAP service, but the URL that can be assembled from the THREDDS catalog for that service is limited to just the base dataset URL. Typically dereferencing this URL will provide one of two things - either the underlying data file (for example a netcdf file) or an HTTP 403 error if direct access to the underlying files has been disabled in the server configuration.


'''Example:'''
'''Example:'''


This URL points to a dataset on a DAP server:
This URL points to a dataset on a DAP2 server:
<font size="2">
<font size="2">
  http://test.opendap.org:8080/opendap/data/nc/fnoc1.nc
  http://test.opendap.org:8080/opendap/data/nc/fnoc1.nc
</font>
</font>


Dereferencing the link will not connect you to a DAP service or DAP response. It will only return the underlying netcdf file. The only way to know that DAP services exist for this is by reading the URL path and recognizing that it is likely an instance of a DAP server based on the position of the 'opendap' string in the URL.  
Dereferencing the link will not connect you to a DAP2 service or DAP2 response. It will (likely) return the underlying netcdf file. The only way to know that DAP2 services exist for this is by reading the URL path and recognizing that it is probably an instance of a DAP2 server based on the composition of the URL. In fact, there is no guarantee that dereferencing this URL will even yield the underlying file, as that behavior is a configuration option for some server implementations. If that access is not allowed in the configuration, then dereferencing the URL will simply return an HTTP 403 (forbidden) error.
 
There is no guarantee that dereferencing this URL will even yield the underlying file, as that behavior is a configuration option for the server. If that access is not allowed in the configuration, then dereferencing the URL will simply return an HTTP 403 (forbidden) error.


== Proposed solution ==
== Dataset Services Response ==


We intend to provide a 'Services' or 'Capabilities' response for DAP4. By default, DAP dataset resource URLs should return an XML document describing the DAP services available for the dataset.  
The Dataset Services Response provides a 'Services' or 'Capabilities' response for DAP4. Dereferencing an unadorned DAP4 dataset resource URL will return a document describing the DAP services available for the dataset. This is a REQUIRED response and the only valid response for an 'unadorned' dataset resource URL. We will refer to this response as the 'Dataset Services Response' or 'DSR' in the 'DAP4 Web Services' specification and the remainder of this document.  


At minimum this document MUST provide for each service available for the dataset:
At minimum the DSR document MUST provide, for each service available for the dataset:


* A human readable title of the service (DDX, DDS, etc.)
* A human readable title of that service (e.g., The Dataset Metadata Response service for the dataset)
* One or more links that can be dereferenced to get the various representations of service response for the dataset in question.
* One or more links that can be dereferenced to get the various representations of the response for the dataset.
* An unambiguous, unique to the service, xlink:role identifier that serves as a way to clearly identify what each service on the list purports to do.
* An unambiguous, unique to the service type, resource role ID that serves as a way to clearly identify what each service does. (Note: ''Resource roles for all DAP4 services are defined, as well as for several other legacy DAP2 related services in the 'DAP4 Specification, Volume 2 Web Services'. Defining a resource role for a new service will be the responsibility of the service creator.'')
* A brief description of the service
* A brief description of the service
* A link to a complete, human readable, description of the service response and it's semantics


The response should also include:
The response should also include:
* A link to a complete, human readable, description of the service.
* A reference to an XSLT that a browser would use to render the description into HTML for a presentation view.
* A reference to an XSLT that a browser would use to render the description into HTML for a presentation view.
* Descriptions and syntax of server side functions available for the dataset
* Descriptions and syntax of server side functions available for the dataset


=== Service Access ===
A service is accessed by dereferencing one of the access URLs held in the <font size="2"><code>'''href'''</code></font> attribute of a <font size="2"><code>'''<dsr:link>'''</code></font> elements, which is typically constructed by adding some type of suffix to the dataset's referent (aka base) URL. The way in which the query string (aka constraint expression) is used is defined by each service, and there is no requirement for inter-service query string API conformity.
A more extensive discussion of the various services that might appear in a DatasetServices document can be found in [[DAP4:_Specification_Volume_2| DAP4 Volume 2, Web Services]].
'''Note:''' If a client understands how to modify/augment the dataset resource URL (as described in the  [[DAP4:_Specification_Volume_2| DAP4 Volume 2, Web Services]] ) such that it becomes a DAP response URL then it need never obtain the Dataset Services response.
===  Dataset Services Response Encoding  ===
c.f. [[DAP4:_Specification_Volume_2| DAP4 Volume 2, Web Services]]
''In this section the namespace prefix <font size="2"><code>'''dsr'''</code></font>  is associated with the namespace '''<font size="2"><code><nowiki>http://xml.opendap.org/ns/DAP/4.0/dataset-services#</nowiki></code></font>'''.''
==== dsr:DatasetServices element ====
The Dataset Services Response MUST contain a top level <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element. This <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element MUST contain:
* An <font size="2"><code>'''xml:base'''</code></font> attribute whose value is the resource URL that was dereferenced to request the DSR response.
* A list of DAP versions supported by server
*: These appear as one or more child <font size="2"><code>'''<dsr:DapVersion>'''</code></font> elements of the <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element.
* The implementation version of the server that produced the DSR.
*: This appears as a single <font size="2"><code>'''<dsr:ServerSoftwareVersion>'''</code></font> child element of the <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element.
* A list of all available DAP4 services for the dataset
*: This is represented as 3 or more <font size="2"><code>'''[[#Service_Element | <dsr:Service>]]'''</code></font> elements. (There are 3 required services for a DAP4 server.)
* A list of supported extensions
** Resource type extensions
** Media type extensions
** Server-side function extensions
The <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element SHOULD contain:
* A <font size="2"><code>'''title'''</code></font> attribute whose value is a human readable title for the dataset.
The <font size="2"><code>'''<dsr:DatasetServices>'''</code></font> element MAY contain:
* A <font size="2"><code>'''<dsr:Description>'''</code></font> element whose value is a human readable description of the dataset.
==== dsr:DapVersion Element ====
The <font size="2"><code>'''<dsr:DapVersion>'''</code></font> element contains a single DAP version value as a text string. The DAP version is represented as two integer values separated by a period, MM.mm where the first value (MM) is the major version of the DAP protocol, and the second value (mm) is the minor version. Multiple <font size="2"><code>'''<dsr:DapVersion>'''</code></font> elements are used to represent that server can support multiple versions of the DAP protocol, one instance for each supported version.
Example:
<font size="2">
<source lang="xml" >
<DapVersion>4.0</DapVersion>
<DapVersion>3.2</DapVersion>
<DapVersion>2.0</DapVersion>
</source>
</font>
==== dsr:ServerSoftwareVersion element ====
The <font size="2"><code>'''<dsr:ServerSoftwareVersion>'''</code></font> element has no attributes and may contain as little as a simple text string (e.g., "TDS 4.3.57" or "Hyrax 1.7.45"), or it may contain any well-formed XML content not in the <font size="2"><code>'''dsr'''</code></font> namespace that the server implementer sees fit to use to describe the software version of their server implementation.
==== dsr:Service element ====
Each DAP4 web service is described by a <font size="2"><code>'''<dsr:Service>'''</code></font> element with:
* An optional <font size="2"><code>'''title'''</code></font> attribute whose value is a simple human readable title for the service.
* An required <font size="2"><code>'''role'''</code></font> attribute whose value is a unique to the service type, resource role ID (a URI) that serves as a way to clearly identify what each service does. This is intended to allow people and software to unambiguously identify specific services, irrespective of their human readable title. The idea is that that the role attribute tells you what is going to happen when you dereference the URL held in the <font size="2"><code>'''<dsr:link>'''</code></font> element. Each service has a single role and all of the links (alternate representations) must fulfill the same role.
* An optional <font size="2"><code>'''<dsr:Description>'''</code></font> element .
* One or more <font size="2"><code>'''<dsr:link>'''</code></font> elements.
===== Regarding the <font size="3"><code>'''role'''</code></font> attribute =====
With regards to multiple representations of a service response and the <font size="2"><code>'''role'''</code></font>  attribute: While there may be many alternate representations of a response, not all will fufill the same <font size="2"><code>'''role'''</code></font>. Representations fulfilling the same <font size="2"><code>'''role'''</code></font> should be bundled together in their own '''Service''' with the appropriate <font size="2"><code>'''role'''</code></font> value. For example the DMR can be mapped to the ISO19115 metadata space, but IS0-19115 responses are clearly outside of the <font size="2"><code>'''role'''</code></font> of the regular DMR service, which returns a DAP4 metadata response. One could view it as the two roles described different domains.
==== dsr:Description element ====
Each <font size="2"><code>'''<dsr:Description>'''</code></font> element MUST contain:
* An optional <font size="2"><code>'''href'''</code></font> attribute whose value is a URL string that points to a human readable document describing the service.
* The required text content of the <font size="2"><code>'''dsr:Description'''</code></font> element MUST be a human readable description of the service.
==== dsr:link element ====
Each <font size="2"><code>'''<dsr:link>'''</code></font> element MUST contain:
* A required <font size="2"><code>'''type'''</code></font> attribute whose value is the media-type for the normative representation returned by that URL held in the <font size="2"><code>'''href'''</code></font> attribute.
* A required attribute called <font size="2"><code>'''href'''</code></font> whose value is a URL that when dereferenced will return the service response in the media type described by the value of the <font size="2"><code>'''type'''</code></font> attribute.
* An optional attribute called <font size="2"><code>'''description'''</code></font> whose value is a human readable string that provides a brief description of the <font size="2"><code>'''<dsr:link>'''</code></font> elements semantics.
* Zero or more <font size="2"><code>'''<dsr:alt>'''</code></font> elements, one for each and every alternate representation of the response that can be requested using [http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html#sec12.1 HTTP server-driven content negotiation] in conjunction with the <font size="2"><code>'''href'''</code></font> URL. Each <font size="2"><code>'''<dsr:alt>'''</code></font> element MUST contain:
** A required <font size="2"><code>'''type'''</code></font> attribute whose value is the MIME type that would be used in the [http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.1 HTTP '''Accept''' header] to request that representation from the server.
=== Extensions ===
Server extensions are simple descriptions of server behaviors that fall outside of the services descriptions provided so far. There are three types of extensions: <font size="2"><code>'''function'''</code></font>, <font size="2"><code>'''functionGroup'''</code></font>, and <font size="2"><code>'''extension'''</code></font>.
A linear regression, a re-gridding operation, and a coordinate re-projection are all examples of a <font size="2"><code>'''function'''</code></font>. A collection of functions that allows the user to perform geocentric manipulations of the data (such as re-gridding operations, reprojection operations) taken together could define a <font size="2"><code>'''functionGroup'''</code></font>.  An <font size="2"><code>'''extension'''</code></font> is a server behavior that does not operate directly on the data values, but may provide other types of services and functionality for the client.
It is beyond the scope of this specification to attempt to describe the syntax of usage of a  <font size="2"><code>'''function'''</code></font> in some general way. Rather we have chosen to provide a simple mechanism (the <font size="2"><code>'''role'''</code></font> attribute) to alert client software implementations that the server supports specific additional behaviors they can utilize, along with more descriptive elements through which humans can be alerted to the presence of server features and where to find out more about them.
==== dsr:function ====
A function extension always describes an operation that applies to the Data Response and the Dataset Metadata Response (because some functions might alter the syntacic structure of the data the change would be previewed by applying the function to the DMR). 
Each <font size="2"><code>'''<dsr:function>'''</code></font> MUST contain:
* A <font size="2"><code>'''name'''</code></font> attribute whose value is the name of the function as it would be used in a DR or DMR request.
* A <font size="2"><code>'''role'''</code></font> attribute whose value is a URI that universally defines the function.
* A <font size="2"><code>'''<dsr:Description>'''</code></font> element whose value is a human readable description of the function and a link to detailed documentation of the function and its usage.
A common example of a function would be the DAP2 (and DAP4)  geogrid function that allows users to be sub-sampled gridded data using georeferenced values.
==== dsr:functionGroup ====
A function group identifies that the server supports a group of functions. Rather than enumerating a large list of related functions, the functionGroup provides the user with the information that the server supports a collection of related functions.
Each <font size="2"><code>'''<dsr:functionGroup>'''</code></font> MUST contain:
* A <font size="2"><code>'''name'''</code></font> attribute whose value is the human readable name of the collection of functions.
* A <font size="2"><code>'''role'''</code></font> attribute whose value is a URI that universally defines the function group.
* A <font size="2"><code>'''<dsr:Description>'''</code></font> element whose value is a human readable description of the function group and a link to detailed documentation regarding the functions in the function group and their usage.
An example of a function group would be a server that implemented a functional syntax for all of the functions found in the [http://ferret.wrc.noaa.gov/Ferret/ Ferret] application.
==== dsr:extension ====
An extension is a mechanism for indicating that the server supports a certain behavior. This behavior MUST NOT be an operation/computation on the data (other wise it would be a <font size="2"><code>'''dsr:function'''</code></font>or a <font size="2"><code>'''dsr:functionGroup'''</code></font>), but rather some other behavior that the server can undertake.
Each <font size="2"><code>'''<dsr:extension>'''</code></font> MUST contain:
* A <font size="2"><code>'''name'''</code></font> attribute whose value is the human readable name of the extension.
* A <font size="2"><code>'''role'''</code></font> attribute whose value is a URI that universally defines the extension.
* A <font size="2"><code>'''<dsr:Description>'''</code></font> element whose value is a human readable description of the extension and a link to detailed documentation regarding the extension and it's behavior and  usage.
An example of an extension would be the DAP4 asynchronous response support. Some servers will support this functionality, and the functionality is not defined as an operation on the data itself, but in terms of the transaction procedures for accessing the data.
=== Example:  A Minimal DSR ===
This example contains only the required components of the DSR document from a minimal DAP4 server implementation.
<font size="2">
<source lang="xml" >
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DatasetServices xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">


=== [[DAP4_Web_Services v3| DAP4 Web Services]]  ===  
    <DapVersion>4.0</DapVersion>
   
    <ServerSoftwareVersion>Hyrax-2.7.9</ServerSoftwareVersion>
       
    <Service title="DAP4 Dataset Services" role="http://services.opendap.org/dap4/dataset-services">
        <link type="application/vnd.opendap.org.dataset-services+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
              <alt type="text/xml"/>
        </link>
        <link type="text/xml"  href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xml"/>
    </Service>


A DAP4 web service is described by:
    <Service title="DAP4 Dataset Metadata"  role="http://services.opendap.org/dap4/dataset-metadata">
* A simple human readable name called 'title'.
        <link type="application/vnd.org.opendap.dap4.dataset-metadata+xml"
* One or more access URLs and each with an associated media-type for the representation returned by that URL.
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr">
* A unique "namespace" like id that is used to define an xlink:role attribute. This is intended to allow people and software to unambiguously identify specific services, irrespective of their human readable title. The idea is that that the xlink:role tells you what is going to happen when you go to xlink:href.
              <alt type="text/xml"/>
* An optional description.
        </link>
        <link type="text/xml" href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr.xml"/>
    </Service>


A service is accessed by dereferencing its access URL, which is typically constructed by adding some type of suffix to  the dataset's referent (aka base) URL. The way in which the query string (aka constraint expression) is used is defined by each service, and there is no requirement for inter-service query string API conformity.
    <Service title="DAP4 Data" role="http://services.opendap.org/dap4/data">
        <link type="application/vnd.org.opendap.dap4.data" href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap" />
    </Service>


A more extensive discussion of the various services that might appear in a DatasetServices document can be found on the [[DAP4 Web Services v3]] page.
   
</DatasetServices>
</source>
</font>


[[User:Jimg|Jimg]] 22:49, 2 July 2012 (PDT) In this example, I think we should modify it so that the ''link'' element follows HTML's (and ATOM's) form (http://tools.ietf.org/html/rfc4287, http://www.atomenabled.org/developers/syndication/) where ''href'' is the attribute for the hyperlink reference, ''type'' is as it's shown here and ''rel'' can be used for stuff like ''enclosure'' to indicate something. I think ''xlink::role'' is right on the money for describing how the thing referenced by the link should be used. Note that if ''Service'' becomes ''entry'' and ''Description'' becomes ''title'' and we add ''id'' and ''updated'' to ''entry/Service'' we have a valid ATOM ''entry'' element. Then we can start thinking of these responses as both things that describe a resource and can be used as part of a data cast feed.
=== Example: A fully featured and annotated DSR document ===


It might look like:
This example contains all of the optional components for a hypothetical DAP4 server that also supports DAp2 requests, server side functions, and asynchronous transactions.


<font size="2">
<font size="2">
Line 62: Line 201:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="/opendap/xsl/serviceDescription.xsl"?>
<?xml-stylesheet type="text/xsl" href="/opendap/xsl/serviceDescription.xsl"?>
<DatasetServices  
<DatasetServices xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"  
    xmlns:xlink="http://www.w3.org/1999/xlink"  
                xml:base="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc">
    xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
 
    <Description>Our friend fnoc1.nc</Description>
 
    <!-- ##################################################################################### -->
    <!--      DAP versions this server supports                                              -->
    <!-- ..................................................................................... -->
    <DapVersion>4.0</DapVersion>
    <DapVersion>3.2</DapVersion>
    <DapVersion>2.0</DapVersion>
   
    <!-- ##################################################################################### -->
    <!--  The software version of the server that is providing the DAP4 Dataset Services      -->
    <!--  response.                                                                          -->
    <!-- The ServerSoftwareVersion element may contain text, or any XML element content as    -->
    <!-- long as the XML is not in the document namespace                                      -->
    <!-- ..................................................................................... -->
    <ServerSoftwareVersion>Hyrax-2.7.9</ServerSoftwareVersion>
   
      
      
     <entry title="Data Request Form" >
     <!-- ##################################################################################### -->
         <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html</id>
    <!--      Required DAP4 Services                                                          -->
         <updated>2003-12-13T18:30:02-05:00</updated>
    <!-- ..................................................................................... -->
         <link type="text/xml"  href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html"  
 
            xlink:role="http://services.opendap.org/dap4/data-request-form#">
    <Service title="DAP4 Dataset Services" role="http://services.opendap.org/dap4/dataset-services">
         <title>OPeNDAP HTML Data Request Form for data sub-setting and access.</title>
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Services_Description_Service">An index of the Services available for this data resource.</Description>
     </entry>
 
        <link description="Normative form of the DSR"
              type="application/vnd.opendap.org.dataset-services+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc">
              <alt type="text/html"/>
              <alt type="text/xml"/>
        </link>
       
        <link description="HTML representation of the DSR" 
              type="text/html"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.html"/>
             
        <link description="Normative DSR with generic Content-Type"
              type="text/xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.xml"/>
             
    </Service>
 
    <Service title="DAP4 Dataset Metadata"  role="http://services.opendap.org/dap4/dataset-metadata">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Service_-_The_metadata">The DAP4 metadata content for this data resource..</Description>
 
        <link description="Normative form of the DMR"
              type="application/vnd.org.opendap.dap4.dataset-metadata+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr">
              <alt type="text/html"/>
              <alt type="text/xml"/>
              <alt type="application/rdf+xml"/>
        </link>
       
        <link description="Data Request Form"
              type="text/html"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.html"/>
             
        <link description="Normative DMR with generic Content-Type"
              type="text/xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.xml"/>
             
        <link description="RDF representation of DMR"
              type="application/rdf+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.rdf"/>
    </Service>
 
    <Service title="DAP4 Data" role="http://services.opendap.org/dap4/data">
         <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Data_Service">DAP4 Data object for this data resource.</Description>
        <link description="The normative form of the DAP4 Data Response"
              type="application/vnd.org.opendap.dap4.data" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap" >
              <alt type="text/plain"/>
              <alt type="text/xml"/>
              <alt type="application/x-netcdf"/>
        </link>
       
        <link description="A comma separated values (CSV) representation of the DAP4 Data Response object."
              type="text/plain" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.ascii" />
        <link description="XML representation of the DAP4 Data Response object."
              type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.xml" />
         <link description="NetCDF-3 representation of the DAP4 Data Response object."
              type="application/x-netcdf" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.nc" />
    </Service>
 
    <!-- ##################################################################################### -->
    <!--  Optional DAP4 Related Services                                                      -->  
    <!-- ..................................................................................... -->
 
    <Service title="ISO-19115 Metadata Service" role="http://services.opendap.org/dap4/iso-19115">
        <link description="Dataset metadata as ISO-19115"
              type="text/xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.iso">
              <alt type="text/html"/>
        </link>
        <link description="ISO-19115 conformance score"
              type="text/html"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.rubric">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_Conformance_Score_Service">ISO-19115 conformance score for the DMR.</Description>
    </Service>
 
    <Service title="File Access" role="http://services.opendap.org/dap4/file">
         <link type="text/xml ## This value depends on the file being accessed."   
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.file">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Native_File_Access_Service">Access to dataset file.</Description>
    </Service>
 
 
 
    <!-- ##################################################################################### -->
    <!--      DAP2 Services                                                                  -->
    <!-- ..................................................................................... -->
    <Service title="DAP2 Data" role="http://services.opendap.org/dap2/dods">
        <link type="application/octet-stream"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dods">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Data_Service">DAP2 Data Object.</Description>
    </Service>
 
    <Service title="DDX" role="http://services.opendap.org/dap2/ddx">
        <link type="text/xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.ddx">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDX_Service">OPeNDAP Data Description and Attribute XML Document.</Description>
    </Service>
 
    <Service title="DDS" role="http://services.opendap.org/dap2/dds">
        <link type="text/plain"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dds">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDS_Service">OPeNDAP Data Description Structure.</Description>
    </Service>
 
    <Service title="DAS" role="http://services.opendap.org/dap2/das" >
        <link type="text/plain"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.das">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DAS_Service">OPeNDAP Dataset Attribute Structure.</Description>
    </Service>
 
 
    <Service title="INFO" role="http://services.opendap.org/dap2/info">
        <link type="text/html"  
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.info">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Info_Service">OPeNDAP Dataset Information Page.</Description>
    </Service>
 
    <Service title="Server Version" role="http://services.opendap.org/dap4/version">
        <link type="text/xml"
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.ver">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Server_Version_Service">An XML document containing information about the software version of the server..</Description>
    </Service>
 
 
    <!-- ##################################################################################### -->
    <!--      Server Side Functions                                                          -->
    <!-- ..................................................................................... -->
 
 
    <function name="geogrid" role="http://services.opendap.org/dap4/server-side-function/geogrid">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#geogrid">Allows a DAP Grid variable to be sub-sampled using georeferenced values.</Description>
    </function>
 
    <function name="grid" role="http://services.opendap.org/dap4/server-side-function/grid">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#grid">Allows a DAP Grid variable to be sub-sampled using the values of the coordinate axes.</Description>
    </function>
 
    <function name="linear_scale" role="http://services.opendap.org/dap4/server-side-function/linear-scale">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#linear_scale">Applies a linear scale transform to the named variable.</Description>
    </function>
 
    <function name="version" role="http://services.opendap.org/dap4/server-side-function/version">
         <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#version">Returns version information for each server side function.</Description>
    </function>
 
    <!-- ##################################################################################### -->
    <!--      Server Side Function Group                                                      -->
    <!-- ..................................................................................... -->
 
    <functionGroup name="ferret" role="http://pmel.noaa.gov/dap4extension/ferret" >
        <Description href="http://ferret.pmel.noaa.gov/Ferret/documentation">This server supports ferret functions.</Description>
     </functionGroup>


...
    <!-- ##################################################################################### -->
    <!--      Extensions                                                                      -->
    <!-- ..................................................................................... -->


    <extension name="async" role="http://opendap.org/extension/async">
        <Description href="http://docs.opendap.org/index.php/DAP4:_Asynchronous_Request-Response_Proposal_v3">The server supports asynchronous transactions.</Description>
    </extension>
   
   
</DatasetServices>
</DatasetServices>
</source>
</source>
</font>
</font>


A trivial change, but then we can reuse these in an ATOM feed.
== Rationale for the solution ==


One thing, the ''id'' element of ''entry'' is tricky although I think the URL works.
The solution provides DAP4 servers with an interface that allows for both server-driven and agent driven content negotiation as described in [[http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html  section 12 of the HTTP 1.1 specification]].  Providing the Dataset Services Response in XML allows many downstream applications to ingest the content and leaves open the option for server implementers to add XSLT references to the document so that clients like browsers can easily build a presentation view of the information. <!-- Using the Atom 1.0 appears to involve no additional overhead and will enable other uses for the response. -->


=== Example Response ===
== Discussion ==
<!-- It is possible to embed in the above a reference to a XSLT that will transform the above XML into HTML similar to the following (with the caveat that this image is actually of a similar, but not identical, XML response): -->
Here is one idea for the HTML version of the DSR; it could be generated by the server using XSLT on the XML or by the browser when the user explicitly requests the ''.xml'' variant of the response (by embedding a reference to the XSL transform in that response document):


[[File:ServiceDescriptionPrototype-01.png]]
<!--
<font size="2">
<font size="2">
<source lang="xml" >
<source lang="xml" >
Line 91: Line 416:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="/opendap/xsl/serviceDescription.xsl"?>
<?xml-stylesheet type="text/xsl" href="/opendap/xsl/serviceDescription.xsl"?>
<DatasetServices  
<DatasetServices xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
     xmlns:xlink="http://www.w3.org/1999/xlink"  
     xmlns:xlink="http://www.w3.org/1999/xlink"  
     xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
     xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
      
      
     <Service title="Data Request Form" >
     <Service title="DAP4 Dataset Services" xlink:role="http://services.opendap.org/dap4/dataset-services#">
        <link type="application/vnd.opendap.org.dataset-services+xml"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
        <link type="text/html"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html">
         <link type="text/xml"  
         <link type="text/xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xml">
            xlink:role="http://services.opendap.org/dap4/data-request-form#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Services_Description_Service">An XML document itemizing the Services available for this dataset.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_HTML_DATA_Request_Form_Service">OPeNDAP HTML Data Request Form for data sub-setting and access.</Description>
     </Service>
     </Service>


     <Service title="Dataset">
 
     <Service title="DAP4 Dataset Metadata" xlink:role="http://services.opendap.org/dap4/dataset-metadata#">
        <link type="application/vnd.org.opendap.dap4.dataset-metadata+xml"
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr">
        <link description="Data Request Form"
            type="text/html"
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr.html">
         <link type="text/xml"  
         <link type="text/xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr.xml">
            xlink:role="http://services.opendap.org/dap4/dataset#">
        <link type="application/json"
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp.json"
            xlink:role="http://services.opendap.org/dap4/dataset#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Service_-_The_metadata">DAP4 Dataset Description and Attribute XML Document.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Service_-_The_metadata">DAP4 Dataset Description and Attribute XML Document.</Description>
     </Service>
     </Service>


     <Service title="DAP4 Data">
     <Service title="DAP4 Data" xlink:role="http://services.opendap.org/dap4/data#">
         <link type="multipart/mixed"  
        <link type="application/vnd.org.opendap.dap4.data"
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap" >
             xlink:role="http://services.opendap.org/dap4/data#">
         <link type="text/plain"  
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap.ascii" >
        <link type="text/xml"  
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap.xml" >
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Data_Service">DAP4 Data object.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Data_Service">DAP4 Data object.</Description>
     </Service>
     </Service>


     <Service title="DAP2 Data">
     <Service title="DAP2 Data" xlink:role="http://services.opendap.org/dap2/dods#">
         <link type="application/octet-stream"  
         <link type="application/octet-stream"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dods"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dods">
            xlink:role="http://services.opendap.org/dap2/dods#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Data_Service">DAP2 Data Object.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Data_Service">DAP2 Data Object.</Description>
     </Service>
     </Service>


     <Service title="ASCII Data">
     <Service title="ASCII Data" xlink:role="http://services.opendap.org/dap4/ascii#">
         <link type="text/plain"  
         <link type="text/plain"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.asc"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.asc">
            xlink:role="http://services.opendap.org/dap4/ascii#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ASCII_Data_Service">The DAP4 Data response in ASCII form.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ASCII_Data_Service">The DAP4 Data response in ASCII form.</Description>
     </Service>
     </Service>


     <Service title="NetCDF-File">
     <Service title="NetCDF-File" xlink:role="http://services.opendap.org/dap4/netcdf-3#">
         <link type="application/x-netcdf"  
         <link type="application/x-netcdf"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.nc"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.nc">
            xlink:role="http://services.opendap.org/dap4/netcdf-3#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_NetCDF_File-out_Service">NetCDF file-out response.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_NetCDF_File-out_Service">NetCDF file-out response.</Description>
     </Service>
     </Service>


     <Service title="XML Data Response">
     <Service title="XML Data Response" xlink:role="http://services.opendap.org/dap4/xml-data#">
         <link type="text/xml"  
         <link type="text/xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdap"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdap">
            xlink:role="http://services.opendap.org/dap4/xml-data#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_XML_Data_Service">An XML document containing both the dataset's structural metadata along with data values.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_XML_Data_Service">An XML document containing both the dataset's structural metadata along with data values.</Description>
     </Service>
     </Service>


     <Service title="DDX">
     <Service title="DDX" xlink:role="http://services.opendap.org/dap2/ddx#">
         <link type="text/xml"  
         <link type="text/xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.ddx"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.ddx">
            xlink:role="http://services.opendap.org/dap2/ddx#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDX_Service">OPeNDAP Data Description and Attribute XML Document.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDX_Service">OPeNDAP Data Description and Attribute XML Document.</Description>
     </Service>
     </Service>


     <Service title="DDS">
     <Service title="DDS" xlink:role="http://services.opendap.org/dap2/dds#">
         <link type="text/plain"  
         <link type="text/plain"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dds"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dds">
            xlink:role="http://services.opendap.org/dap2/dds#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDS_Service">OPeNDAP Data Description Structure.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDS_Service">OPeNDAP Data Description Structure.</Description>
     </Service>
     </Service>


     <Service title="DAS"
     <Service title="DAS"
            xlink:role="http://services.opendap.org/dap2/das#" >
         <link type="text/plain"  
         <link type="text/plain"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.das"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.das">
            xlink:role="http://services.opendap.org/dap2/das#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DAS_Service">OPeNDAP Dataset Attribute Structure.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DAS_Service">OPeNDAP Dataset Attribute Structure.</Description>
     </Service>
     </Service>


     <Service title="RDF">
     <Service title="RDF" xlink:role="http://services.opendap.org/dap4/rdf#">
         <link type="application/rdf+xml"  
         <link type="application/rdf+xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.rdf"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.rdf">
            xlink:role="http://services.opendap.org/dap4/rdf#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_RDF_Service">An RDF representation of the Dataset response (DDX) document.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_RDF_Service">An RDF representation of the Dataset response (DDX) document.</Description>
     </Service>
     </Service>


     <Service title="INFO">
     <Service title="INFO" xlink:role="http://services.opendap.org/dap2/info#">
         <link type="text/html"  
         <link type="text/html"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.info"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.info">
            xlink:role="http://services.opendap.org/dap2/info#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Info_Service">OPeNDAP Dataset Information Page.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Info_Service">OPeNDAP Dataset Information Page.</Description>
     </Service>
     </Service>


     <Service title="Server Version">
     <Service title="Server Version" xlink:role="http://services.opendap.org/dap4/version#">
         <link type="text/xml"  
         <link type="text/xml"  
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.ver"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.ver">
            xlink:role="http://services.opendap.org/dap4/version#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Server_Version_Service">An XML document containing information about the software version of the server..</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Server_Version_Service">An XML document containing information about the software version of the server..</Description>
     </Service>
     </Service>


     <Service title="ISO-19115">
     <Service title="ISO-19115" xlink:role="http://services.opendap.org/dap4/iso-19115-metadata#">
         <link type="text/xml"  
         <link type="text/xml"  
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.iso"
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.iso">
            xlink:role="http://services.opendap.org/dap4/iso-19115-metadata#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_19115_Service">ISO 19115 Metadata Representation of the Dataset (DDX) response.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_19115_Service">ISO 19115 Metadata Representation of the Dataset (DDX) response.</Description>
     </Service>
     </Service>


     <Service title="ISO-19115-Score">
     <Service title="ISO-19115-Score" xlink:role="http://services.opendap.org/dap4/iso-19115-score#">
         <link type="text/html"  
         <link type="text/html"  
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.rubric"
             xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.rubric">
            xlink:role="http://services.opendap.org/dap4/iso-19115-score#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_Conformance_Score_Service">ISO 19115 Metadata Representation conformance score for this dataset.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_Conformance_Score_Service">ISO 19115 Metadata Representation conformance score for this dataset.</Description>
     </Service>
     </Service>


     <Service title="File Access"
     <Service title="File Access" xlink:role="http://services.opendap.org/dap4/file#">
         <link type="text/xml## This value depends on the file being accessed.
         <link type="text/xml ## This value depends on the file being accessed.
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.file"
              xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.file">
            xlink:role="http://services.opendap.org/dap4/file#">
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Native_File_Access_Service">Access to dataset file.</Description>
         <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Native_File_Access_Service">Access to dataset file.</Description>
    </Service>
    <Service title="Dataset Services Description">
        <link type="text/xml"
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml"
            xlink:role="http://services.opendap.org/dap4/dataset#">
        <link type="application/json"
            xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.json"
            xlink:role="http://services.opendap.org/dap4/dataset#">
        <Description xlink:href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Services_Description_Service">An XML document itemizing the Services available for this dataset.</Description>
     </Service>
     </Service>


Line 241: Line 552:
</source>
</source>
</font>
</font>
-->




== Appendix: Dataset Services Response XML schema (<font color="orange">Under Construction</font>)==
This schema works, but it rigidly enforces the order of the content. We may want to rewrite to be more lenient.
<font size="2">
<source lang="xml" >
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema
    targetNamespace="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xmlns:dsr="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">
   
    <xs:import  namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
    <!--
    -->
    <xs:element name="DatasetServices" type="DatasetServicesType"/>
    <xs:element name="DapVersion" type="DapVersionType"/>
    <xs:element name="ServerSoftwareVersion" type="AnyContentType"/>
    <xs:element name="Service" type="ServiceType"/>
    <xs:element name="Description" type="DescriptionType"/>
    <xs:element name="link" type="linkType"/>
    <xs:element name="alt" type="altType"/>
    <xs:element name="function" type="ExtensionType"/>
    <xs:element name="functionGroup" type="ExtensionType"/>
    <xs:element name="extension" type="ExtensionType"/>
    <!--
    -->
    <xs:complexType name="DatasetServicesType">
        <xs:annotation>
            <xs:documentation>DatasetServices root element type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="DapVersion" minOccurs="1" maxOccurs="unbounded"/>
            <xs:element ref="ServerSoftwareVersion" minOccurs="1" maxOccurs="1"/>
            <xs:element ref="Description" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="Service" minOccurs="3" maxOccurs="unbounded"/>
            <xs:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="functionGroup" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute ref="xml:base"  use="required"/>
    </xs:complexType>
    <!--
    -->
    <xs:complexType name="ServiceType">
        <xs:annotation>
            <xs:documentation>DatasetServices Service type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="Description" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="link" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="title" type="xs:string" use="optional"/>
        <xs:attribute name="role" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!--
       
    -->
    <xs:simpleType name="DapVersionType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\d{1,}.\d{1,}"></xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    <!--
       
    -->
    <xs:complexType name="DescriptionType">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="href" type="xs:anyURI"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <!--
       
    -->
    <xs:complexType name="altType">
        <xs:attribute name="type" type="xs:string"/>
    </xs:complexType>
    <!--
       
    -->
    <xs:complexType name="linkType">
        <xs:annotation>
            <xs:documentation>DatasetServices link type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="alt" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="href" type="xs:string" use="required"/>
        <xs:attribute name="type" type="xs:string" use="required"/>
        <xs:attribute name="description" type="xs:string" use="optional"/>       
    </xs:complexType>
    <!--
    -->
    <xs:complexType  name="AnyContentType" mixed="true">
        <xs:annotation>
            <xs:documentation>
                An element of this type may contain arbitrary XML or text content.
                The resulting content is may be 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.
                ( <xs:any/>+ )
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:any namespace="##any" minOccurs="0" processContents="lax"/>
        </xs:sequence>
        <xs:anyAttribute processContents="lax" namespace="##any"/>
    </xs:complexType> 
    <!--
    -->
    <xs:complexType name="ExtensionType">
        <xs:annotation>
            <xs:documentation>Server Extension Type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="Description" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="role" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!--
    -->
   
</xs:schema>
</source>
</font>
== fini ==
Contains cruft in comments...
<!--
I also put together a simple XSLT to make this a human friendly HTML. I added a reference to it in the XML document. When you point a browser at the resource URL (For example http://localhost:8080/opendap/data/nc/fnoc1.nc ) the Service Description response is returned as an XML file (above), the browser detects the xml-stylesheet reference, grabs the XSLT, uses it to convert the XML to HTML and renders it like this:
I also put together a simple XSLT to make this a human friendly HTML. I added a reference to it in the XML document. When you point a browser at the resource URL (For example http://localhost:8080/opendap/data/nc/fnoc1.nc ) the Service Description response is returned as an XML file (above), the browser detects the xml-stylesheet reference, grabs the XSLT, uses it to convert the XML to HTML and renders it like this:


Line 249: Line 709:
== Rationale for the solution ==
== Rationale for the solution ==


The solution provides DAP4 servers with RESTful interface that allows for both server-driven and agent driven content negotiation as described in [[http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html  section 12 of the HTTP 1.1 specification]].  Providing the DatasetServices response in XML allows many down stream applications to ingest the content and leaves open the option for server implementers to add XSLT references to the document so that clients like browsers can easily build a presentation view of the information.
The solution provides DAP4 servers with an interface that allows for both server-driven and agent driven content negotiation as described in [[http://www.w3.org/Protocols/rfc2616/rfc2616-sec12.html  section 12 of the HTTP 1.1 specification]].  Providing the DatasetServices response in XML allows many downstream applications to ingest the content and leaves open the option for server implementers to add XSLT references to the document so that clients like browsers can easily build a presentation view of the information.


== Discussion ==
== Discussion ==




=== Question 1 ===
=== Using Atom 1.0 ===
 
The proposed encoding for this information is to use [http://en.wikipedia.org/wiki/Atom_(standard) Atom 1.0]. The advantages of this encoding are several and the detractions are close to nil. Atom 1.0 provides the DAP with a widely-used standard for representing information that is very general in nature (that data are accessible using a set of web services, each of which provides a sightly different kind of response and can be accessed using a different URL). Furthermore, we can use this same response in other responses a server might like to provide such as a ''data cast'' provides to subscribers or an OpenSearch result. Using Atom is important in those contexts because a response that it not specific to DAP is a requirement. At the same time, because the Atom specification does not impose needless or complex additional requirements, the cost of using it is low. In fact the only information in Atom 1.0 that is not listed above is a the name and email of an ''author'' for the ''entry''. While this might be rationalization, including that information could help a number of users who send email to support lists asking about dataset ''X'' simply because they don't know where/who else to ask.
 
Using Atom, A DAP4 web service is described by:
* An 'entry' that serves to group a set of ''link'' elements that reference different services to a common set of information about the dataset. For the dataset, that information is:
** A simple human readable name called ''title''.
** An ''id'' that uniquely identifies the ''entry''.
** The last modified time for the dataset (''updated'').
** A person responsible for the dataset (''author'').
** An optional ''content'' element. (well, it's conditionally optional - see the [http://tools.ietf.org/html/rfc4287 Atom spec])
* For each service, a ''link'' element is used where the four attributes ''title'', '' rel'', ''type'', ''href'' are used as follows:
** ''title'' - A human-readable description of the service
** ''rel'' - See the [http://tools.ietf.org/html/rfc4287 Atom spec]
** ''type'' - A MIME-type that identifies the response as specific to OPeNDAP such as ''application/vnd.opendap.org.dap4.xdp+xml''
** ''href'' - The full URL used to get the response


Is it a reasonable thing to use MIME types as ethan suggested (application/vnd.opendap.org.dap4.data etc.)  when describing services in Dataset Services Response, and then, when the server provides a response over HTTP it sets the content header to the lowest common mime type?
For the Atom-based response, we propose to use MIME types as Ethan suggested (application/vnd.opendap.org.dap4.data etc.)  when describing services in the Dataset Services Response, and then, when the server provides those responses over HTTP it sets the content header to the [[DAP4_Web_Services_v3#Media_Types | lowest common mime type]].


For example in the Dataset Services response we might describe the Dataset Metadata service like this:
For example, in the Dataset Services response we might describe the Dataset Metadata service like this:
<font size="2">
<font size="2">
<source lang="xml" >
<source lang="xml" >
<Service title="Dataset">
...
    <link type="application/vnd.opendap.org.dap4.ddx+xml"  
    <link title="DAP4 Dataset Metadata XML Document."
           xlink:href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp"  
          rel="related"
          xlink:role="http://services.opendap.org/dap4/dataset#" />
          type="application/vnd.opendap.org.dap4.xdp+xml"  
</Service>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp"/>
...
</source>
</source>
</font>
</font>


Yet, when a DAP4 server responds to a client asking for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp the server would set the HTTP headers like so:
And when a DAP4 server responds to a client asking for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp the server would set the HTTP headers so that the Content-Type would be the  [[DAP4_Web_Services_v3#Media_Types | lowest common mime type]] (in this case ''text/xml'') . The server could put the more expressive type tag in the ''Content-Description'' header:
<font size="2">
<font size="2">
<source lang="txt" >
<source lang="txt" >
Line 275: Line 751:
Date: Mon, 23 May 2005 22:38:34 GMT
Date: Mon, 23 May 2005 22:38:34 GMT
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT
Content-Type: test/xml"
Content-Type: test/xml
Content-Description: application/vnd.opendap.org.dap4.ddx+xml; url=http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp
Content-Description: application/vnd.opendap.org.dap4.xdp+xml; url=http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp
Content-Encoding: gzip
Content-Encoding: gzip
XDAP: 4.0
X-DAP: 4.0
</source>
</source>
</font>
</font>


What do people think about that? I think doing it this way allows us to communicate semantic information about service URL's in a way that works in our own documents and in things like Atom, which a the same time it allows the servers to produce responses that will be consumable by a broader range of clients. My fear here is that this will break (or maybe just irritate) sophisticated clients. Or maybe not... That's what I am asking about this.
For normative information on Atom, see [http://tools.ietf.org/html/rfc5023 RFC 5023] and [http://tools.ietf.org/html/rfc4287 RFC 4287].
 
[[User:Ndp|ndp]] 13:22, 5 July 2012 (PDT)
 
==== Answers/Comments ====
 
= Atom - How might we express this response as an Atom 1.0 document. =
 
Here are two examples in which I attempted to take all of the semantics from the previous proprietary example and represent them in an Atom document.
 
Both of these documents validated using the [http://feed2.w3.org/ W3C Feed Validation Service].
 
All of the content components of each document are required with the exception of the atom:link/@title attribute, which is optional.
 
 
== Example: Validated Atom Document for a dataset, each service as an atom:entry ==


 
==== Example: Validated Atom Document with one atom:entry for a dataset, and an atom:link for each service ====
<font size="2">
<source lang="xml" >
 
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<feed xmlns="http://www.w3.org/2005/Atom">
        <title>Example Feed</title>
        <subtitle>A subtitle.</subtitle>
        <link href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml" title="DatasetServices: ECMWF_ERA-40_subset.ncml" rel="self" />
        <id>urn:uuid:60a76c80-d399-11d9-b91C-0003939e0af6</id>
        <updated>2003-12-13T18:30:02Z</updated>
       
           
 
    <entry xmlns="http://www.w3.org/2005/Atom">
        <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</id>
        <title>DAP Dataset Services Response.</title>
        <updated>2003-12-13T18:30:02Z</updated>
        <author>
            <name>Nathan Potter</name>
            <email>johndoe@devnull.com</email>
        </author>
       
        <content type="xhtml" xml:lang="en" xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
            <div xmlns="http://www.w3.org/1999/xhtml">DAP4 Dataset Metadata Service for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</div>
        </content>
 
        <link rel="self"
              title="Dataset Services"
              type="application/atom+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml"/>
    </entry>
 
    <entry>
        <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp</id>
        <title>DAP4 Dataset Description and metadata Attributes XML Document.</title>
        <updated>2003-12-13T18:30:02Z</updated>
        <author>
            <name>Nathan Potter</name>
            <email>johndoe@devnull.com</email>
        </author>
       
        <content type="xhtml" xml:lang="en" xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
            <div xmlns="http://www.w3.org/1999/xhtml">DAP4 Dataset Metadata Service for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</div>
        </content>
 
        <link rel="related"
              title="Dataset Metadata"
              type="application/vnd.opendap.org.dap4.ddx+xml"
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdp"/>
    </entry>
 
    <entry>
        <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap</id>
        <title>DAP4 Data object.</title>
        <updated>2003-12-13T18:30:02Z</updated>
        <author>
            <name>Nathan Potter</name>
            <email>johndoe@devnull.com</email>
        </author>
       
        <content type="xhtml" xml:lang="en" xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
            <div xmlns="http://www.w3.org/1999/xhtml">DAP4 Data Service for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</div>
        </content>
       
        <link rel="related"
              title="DAP4 Data"
              type="application/vnd.opendap.org.dap4.data"
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap"/>
    </entry>
 
    <entry>
   
        <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html</id>
        <title>OPeNDAP HTML Data Request Form for data sub-setting and access.</title>
        <updated>2003-12-13T18:30:02Z</updated>
       
        <author>
            <name>Nathan Potter</name>
            <email>johndoe@devnull.com</email>
        </author>
       
        <content type="xhtml" xml:lang="en" xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
            <div xmlns="http://www.w3.org/1999/xhtml">HTML Data Request Form http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</div>
        </content>
       
 
        <link rel="related"
              title="Data Request Form"
              type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.html"/>
             
    </entry>
 
        .
        .
        .
   
</feed>
 
</source>
</font>
 
== Example: Validated Atom Document with one atom:entry for a dataset, and an atom:link for each service ==


<font size="2">
<font size="2">
Line 411: Line 768:
<entry xmlns="http://www.w3.org/2005/Atom">
<entry xmlns="http://www.w3.org/2005/Atom">


     <title>DAP Dataset Services: ECMWF_ERA-40_subset.ncml</title>
     <title>DatasetServices: ECMWF_ERA-40_subset.ncml</title>


     <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</id>
     <id>http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</id>
Line 421: Line 778:
         <email>johndoe@devnull.com</email>
         <email>johndoe@devnull.com</email>
     </author>
     </author>
     <summary>DAP Dataset Services for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</summary>
     <content type="xhtml" xml:lang="en" xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
      
        <div xmlns="http://www.w3.org/1999/xhtml">DAP Dataset Services for http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml</div>
     </content>
 
     <link title="Dataset Services Description"
     <link title="Dataset Services Description"
           rel="self"
           rel="self"
Line 429: Line 788:
      
      
     <link title="DAP4 Dataset Metadata XML Document."
     <link title="DAP4 Dataset Metadata XML Document."
           rel="alternate"
           rel="related"
           type="application/vnd.opendap.org.dap4.ddx+xml"  
           type="application/vnd.opendap.org.dap4.dmr+xml"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xml"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr"/>
      
      
     <link title="DAP4 Data object."
     <link title="DAP4 Data object."
           rel="related"
           rel="enclosure"
           type="application/vnd.opendap.org.dap4.data"  
           type="application/vnd.opendap.org.dap4.data"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap"/>
Line 444: Line 803:


     <link title="DAP2 Data Object."
     <link title="DAP2 Data Object."
           rel="related"
           rel="enclosure"
           type="application/vnd.opendap.org.dap2.data"  
           type="application/vnd.opendap.org.dap2.data"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dods"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dods"/>
            
            
     <link title="DAP4 Data response in ASCII form."
     <link title="DAP4 Data response in ASCII form."
           rel="related"
           rel="enclosure"
           type="text/plain"  
           type="text/plain"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.asc"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.asc"/>
            
            
     <link title="NetCDF-3 file-out response."
     <link title="NetCDF-3 file-out response."
           rel="related"
           rel="enclosure"
           type="application/x-netcdf"  
           type="application/x-netcdf"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.nc"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.nc"/>
            
            
     <link title="XML Data Response"
     <link title="XML Data Response"
           rel="related"
           rel="enclosure"
           type="application/vnd.opendap.org.dap4.data+xml"  
           type="application/vnd.opendap.org.dap4.data+xml"  
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdap"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xdap"/>
Line 504: Line 863:
            
            
     <link title="Dataset file access"
     <link title="Dataset file access"
           rel="related"
           rel="enclosure"
           type="text/xml"   
           type="text/xml"   
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.file"/>
           href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.file"/>
Line 513: Line 872:
</source>
</source>
</font>
</font>
-->

Latest revision as of 17:20, 20 November 2013


<-- back to OPULS Development

Author: ndp

Background

Legacy DAP2 servers provide a number of dataset level responses (services). These include DAP2 services such as the DDS, DAS, and DDX, plus other services that have been added over time such as the RDF and ISO responses. There is no method defined by the DAP2 protocol for a user (or software agent) to discover which of these many services might be available for a particular dataset. While THREDDS catalogs do provide a mechanism for determining which services are associated with which datasets, they don't actually provide a mechanism for discovering the details of the various service URLs. A THREDDS catalog might identify a DAP2 service, but the URL that can be assembled from the THREDDS catalog for that service is limited to just the base dataset URL. Typically dereferencing this URL will provide one of two things - either the underlying data file (for example a netcdf file) or an HTTP 403 error if direct access to the underlying files has been disabled in the server configuration.

Example:

This URL points to a dataset on a DAP2 server:

http://test.opendap.org:8080/opendap/data/nc/fnoc1.nc

Dereferencing the link will not connect you to a DAP2 service or DAP2 response. It will (likely) return the underlying netcdf file. The only way to know that DAP2 services exist for this is by reading the URL path and recognizing that it is probably an instance of a DAP2 server based on the composition of the URL. In fact, there is no guarantee that dereferencing this URL will even yield the underlying file, as that behavior is a configuration option for some server implementations. If that access is not allowed in the configuration, then dereferencing the URL will simply return an HTTP 403 (forbidden) error.

Dataset Services Response

The Dataset Services Response provides a 'Services' or 'Capabilities' response for DAP4. Dereferencing an unadorned DAP4 dataset resource URL will return a document describing the DAP services available for the dataset. This is a REQUIRED response and the only valid response for an 'unadorned' dataset resource URL. We will refer to this response as the 'Dataset Services Response' or 'DSR' in the 'DAP4 Web Services' specification and the remainder of this document.

At minimum the DSR document MUST provide, for each service available for the dataset:

  • A human readable title of that service (e.g., The Dataset Metadata Response service for the dataset)
  • One or more links that can be dereferenced to get the various representations of the response for the dataset.
  • An unambiguous, unique to the service type, resource role ID that serves as a way to clearly identify what each service does. (Note: Resource roles for all DAP4 services are defined, as well as for several other legacy DAP2 related services in the 'DAP4 Specification, Volume 2 Web Services'. Defining a resource role for a new service will be the responsibility of the service creator.)
  • A brief description of the service

The response should also include:

  • A link to a complete, human readable, description of the service.
  • A reference to an XSLT that a browser would use to render the description into HTML for a presentation view.
  • Descriptions and syntax of server side functions available for the dataset

Service Access

A service is accessed by dereferencing one of the access URLs held in the href attribute of a <dsr:link> elements, which is typically constructed by adding some type of suffix to the dataset's referent (aka base) URL. The way in which the query string (aka constraint expression) is used is defined by each service, and there is no requirement for inter-service query string API conformity.

A more extensive discussion of the various services that might appear in a DatasetServices document can be found in DAP4 Volume 2, Web Services.

Note: If a client understands how to modify/augment the dataset resource URL (as described in the DAP4 Volume 2, Web Services ) such that it becomes a DAP response URL then it need never obtain the Dataset Services response.

Dataset Services Response Encoding

c.f. DAP4 Volume 2, Web Services

In this section the namespace prefix dsr is associated with the namespace http://xml.opendap.org/ns/DAP/4.0/dataset-services#.

dsr:DatasetServices element

The Dataset Services Response MUST contain a top level <dsr:DatasetServices> element. This <dsr:DatasetServices> element MUST contain:

  • An xml:base attribute whose value is the resource URL that was dereferenced to request the DSR response.
  • A list of DAP versions supported by server
    These appear as one or more child <dsr:DapVersion> elements of the <dsr:DatasetServices> element.
  • The implementation version of the server that produced the DSR.
    This appears as a single <dsr:ServerSoftwareVersion> child element of the <dsr:DatasetServices> element.
  • A list of all available DAP4 services for the dataset
    This is represented as 3 or more <dsr:Service> elements. (There are 3 required services for a DAP4 server.)
  • A list of supported extensions
    • Resource type extensions
    • Media type extensions
    • Server-side function extensions

The <dsr:DatasetServices> element SHOULD contain:

  • A title attribute whose value is a human readable title for the dataset.

The <dsr:DatasetServices> element MAY contain:

  • A <dsr:Description> element whose value is a human readable description of the dataset.

dsr:DapVersion Element

The <dsr:DapVersion> element contains a single DAP version value as a text string. The DAP version is represented as two integer values separated by a period, MM.mm where the first value (MM) is the major version of the DAP protocol, and the second value (mm) is the minor version. Multiple <dsr:DapVersion> elements are used to represent that server can support multiple versions of the DAP protocol, one instance for each supported version.

Example:

<DapVersion>4.0</DapVersion>
<DapVersion>3.2</DapVersion>
<DapVersion>2.0</DapVersion>

dsr:ServerSoftwareVersion element

The <dsr:ServerSoftwareVersion> element has no attributes and may contain as little as a simple text string (e.g., "TDS 4.3.57" or "Hyrax 1.7.45"), or it may contain any well-formed XML content not in the dsr namespace that the server implementer sees fit to use to describe the software version of their server implementation.

dsr:Service element

Each DAP4 web service is described by a <dsr:Service> element with:

  • An optional title attribute whose value is a simple human readable title for the service.
  • An required role attribute whose value is a unique to the service type, resource role ID (a URI) that serves as a way to clearly identify what each service does. This is intended to allow people and software to unambiguously identify specific services, irrespective of their human readable title. The idea is that that the role attribute tells you what is going to happen when you dereference the URL held in the <dsr:link> element. Each service has a single role and all of the links (alternate representations) must fulfill the same role.
  • An optional <dsr:Description> element .
  • One or more <dsr:link> elements.
Regarding the role attribute

With regards to multiple representations of a service response and the role attribute: While there may be many alternate representations of a response, not all will fufill the same role. Representations fulfilling the same role should be bundled together in their own Service with the appropriate role value. For example the DMR can be mapped to the ISO19115 metadata space, but IS0-19115 responses are clearly outside of the role of the regular DMR service, which returns a DAP4 metadata response. One could view it as the two roles described different domains.

dsr:Description element

Each <dsr:Description> element MUST contain:

  • An optional href attribute whose value is a URL string that points to a human readable document describing the service.
  • The required text content of the dsr:Description element MUST be a human readable description of the service.

dsr:link element

Each <dsr:link> element MUST contain:

  • A required type attribute whose value is the media-type for the normative representation returned by that URL held in the href attribute.
  • A required attribute called href whose value is a URL that when dereferenced will return the service response in the media type described by the value of the type attribute.
  • An optional attribute called description whose value is a human readable string that provides a brief description of the <dsr:link> elements semantics.
  • Zero or more <dsr:alt> elements, one for each and every alternate representation of the response that can be requested using HTTP server-driven content negotiation in conjunction with the href URL. Each <dsr:alt> element MUST contain:
    • A required type attribute whose value is the MIME type that would be used in the HTTP Accept header to request that representation from the server.

Extensions

Server extensions are simple descriptions of server behaviors that fall outside of the services descriptions provided so far. There are three types of extensions: function, functionGroup, and extension.

A linear regression, a re-gridding operation, and a coordinate re-projection are all examples of a function. A collection of functions that allows the user to perform geocentric manipulations of the data (such as re-gridding operations, reprojection operations) taken together could define a functionGroup. An extension is a server behavior that does not operate directly on the data values, but may provide other types of services and functionality for the client.

It is beyond the scope of this specification to attempt to describe the syntax of usage of a function in some general way. Rather we have chosen to provide a simple mechanism (the role attribute) to alert client software implementations that the server supports specific additional behaviors they can utilize, along with more descriptive elements through which humans can be alerted to the presence of server features and where to find out more about them.

dsr:function

A function extension always describes an operation that applies to the Data Response and the Dataset Metadata Response (because some functions might alter the syntacic structure of the data the change would be previewed by applying the function to the DMR).

Each <dsr:function> MUST contain:

  • A name attribute whose value is the name of the function as it would be used in a DR or DMR request.
  • A role attribute whose value is a URI that universally defines the function.
  • A <dsr:Description> element whose value is a human readable description of the function and a link to detailed documentation of the function and its usage.

A common example of a function would be the DAP2 (and DAP4) geogrid function that allows users to be sub-sampled gridded data using georeferenced values.

dsr:functionGroup

A function group identifies that the server supports a group of functions. Rather than enumerating a large list of related functions, the functionGroup provides the user with the information that the server supports a collection of related functions.

Each <dsr:functionGroup> MUST contain:

  • A name attribute whose value is the human readable name of the collection of functions.
  • A role attribute whose value is a URI that universally defines the function group.
  • A <dsr:Description> element whose value is a human readable description of the function group and a link to detailed documentation regarding the functions in the function group and their usage.

An example of a function group would be a server that implemented a functional syntax for all of the functions found in the Ferret application.

dsr:extension

An extension is a mechanism for indicating that the server supports a certain behavior. This behavior MUST NOT be an operation/computation on the data (other wise it would be a dsr:functionor a dsr:functionGroup), but rather some other behavior that the server can undertake.

Each <dsr:extension> MUST contain:

  • A name attribute whose value is the human readable name of the extension.
  • A role attribute whose value is a URI that universally defines the extension.
  • A <dsr:Description> element whose value is a human readable description of the extension and a link to detailed documentation regarding the extension and it's behavior and usage.

An example of an extension would be the DAP4 asynchronous response support. Some servers will support this functionality, and the functionality is not defined as an operation on the data itself, but in terms of the transaction procedures for accessing the data.

Example: A Minimal DSR

This example contains only the required components of the DSR document from a minimal DAP4 server implementation.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<DatasetServices xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xml:base="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">

    <DapVersion>4.0</DapVersion>
    
    <ServerSoftwareVersion>Hyrax-2.7.9</ServerSoftwareVersion>
        
    <Service title="DAP4 Dataset Services" role="http://services.opendap.org/dap4/dataset-services">
        <link type="application/vnd.opendap.org.dataset-services+xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml">
              <alt type="text/xml"/>
        </link>
        <link type="text/xml"  href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.xml"/>
    </Service>

    <Service title="DAP4 Dataset Metadata"  role="http://services.opendap.org/dap4/dataset-metadata">
        <link type="application/vnd.org.opendap.dap4.dataset-metadata+xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr">
              <alt type="text/xml"/>
        </link>
        <link type="text/xml" href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dmr.xml"/>
    </Service>

    <Service title="DAP4 Data" role="http://services.opendap.org/dap4/data">
        <link type="application/vnd.org.opendap.dap4.data" href="http://test.opendap.org:8090/opendap/hyrax/ECMWF_ERA-40_subset.ncml.dap" />
    </Service>

    
</DatasetServices>

Example: A fully featured and annotated DSR document

This example contains all of the optional components for a hypothetical DAP4 server that also supports DAp2 requests, server side functions, and asynchronous transactions.

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="/opendap/xsl/serviceDescription.xsl"?>
<DatasetServices xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#" 
                 xml:base="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc">

    <Description>Our friend fnoc1.nc</Description>

    <!-- ##################################################################################### -->
    <!--       DAP versions this server supports                                               --> 
    <!-- ..................................................................................... -->
    <DapVersion>4.0</DapVersion>
    <DapVersion>3.2</DapVersion>
    <DapVersion>2.0</DapVersion>
    
    <!-- ##################################################################################### -->
    <!--  The software version of the server that is providing the DAP4 Dataset Services       -->
    <!--   response.                                                                           --> 
    <!-- The ServerSoftwareVersion element may contain text, or any XML element content as     -->
    <!-- long as the XML is not in the document namespace                                      -->
    <!-- ..................................................................................... -->
    <ServerSoftwareVersion>Hyrax-2.7.9</ServerSoftwareVersion>
    
    
    <!-- ##################################################################################### -->
    <!--       Required DAP4 Services                                                          --> 
    <!-- ..................................................................................... -->

    <Service title="DAP4 Dataset Services" role="http://services.opendap.org/dap4/dataset-services">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Services_Description_Service">An index of the Services available for this data resource.</Description>

        <link description="Normative form of the DSR" 
              type="application/vnd.opendap.org.dataset-services+xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc">
              <alt type="text/html"/>
              <alt type="text/xml"/>
        </link>
        
        <link description="HTML representation of the DSR"  
              type="text/html" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.html"/>
              
        <link description="Normative DSR with generic Content-Type" 
              type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.xml"/>
              
    </Service>

    <Service title="DAP4 Dataset Metadata"  role="http://services.opendap.org/dap4/dataset-metadata">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Dataset_Service_-_The_metadata">The DAP4 metadata content for this data resource..</Description>

        <link description="Normative form of the DMR" 
              type="application/vnd.org.opendap.dap4.dataset-metadata+xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr">
              <alt type="text/html"/>
              <alt type="text/xml"/>
              <alt type="application/rdf+xml"/>
        </link>
        
        <link description="Data Request Form" 
              type="text/html" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.html"/>
              
        <link description="Normative DMR with generic Content-Type" 
              type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.xml"/>
              
        <link description="RDF representation of DMR" 
              type="application/rdf+xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.rdf"/>
    </Service>

    <Service title="DAP4 Data" role="http://services.opendap.org/dap4/data">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Data_Service">DAP4 Data object for this data resource.</Description>
        <link description="The normative form of the DAP4 Data Response"
              type="application/vnd.org.opendap.dap4.data"  
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap" >
              <alt type="text/plain"/>
              <alt type="text/xml"/>
              <alt type="application/x-netcdf"/>
        </link>
        
        <link description="A comma separated values (CSV) representation of the DAP4 Data Response object."
              type="text/plain"  
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.ascii" />
        <link description="XML representation of the DAP4 Data Response object."
              type="text/xml"   
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.xml" />
        <link description="NetCDF-3 representation of the DAP4 Data Response object."
              type="application/x-netcdf"   
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dap.nc" />
    </Service>

    <!-- ##################################################################################### -->
    <!--   Optional DAP4 Related Services                                                      --> 
    <!-- ..................................................................................... -->

    <Service title="ISO-19115 Metadata Service" role="http://services.opendap.org/dap4/iso-19115">
        <link description="Dataset metadata as ISO-19115" 
              type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.iso">
              <alt type="text/html"/>
        </link>
        <link description="ISO-19115 conformance score" 
              type="text/html" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dmr.rubric">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_ISO_Conformance_Score_Service">ISO-19115 conformance score for the DMR.</Description>
    </Service>

    <Service title="File Access" role="http://services.opendap.org/dap4/file">
        <link type="text/xml ## This value depends on the file being accessed."  
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.file">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Native_File_Access_Service">Access to dataset file.</Description>
    </Service>



    <!-- ##################################################################################### -->
    <!--       DAP2 Services                                                                   --> 
    <!-- ..................................................................................... -->
    <Service title="DAP2 Data" role="http://services.opendap.org/dap2/dods">
        <link type="application/octet-stream" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dods">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Data_Service">DAP2 Data Object.</Description>
    </Service>

    <Service title="DDX" role="http://services.opendap.org/dap2/ddx">
        <link type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.ddx">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDX_Service">OPeNDAP Data Description and Attribute XML Document.</Description>
    </Service>

    <Service title="DDS" role="http://services.opendap.org/dap2/dds">
        <link type="text/plain" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.dds">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DDS_Service">OPeNDAP Data Description Structure.</Description>
    </Service>

    <Service title="DAS" role="http://services.opendap.org/dap2/das" >
        <link type="text/plain" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.das">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_DAS_Service">OPeNDAP Dataset Attribute Structure.</Description>
    </Service>


    <Service title="INFO" role="http://services.opendap.org/dap2/info">
        <link type="text/html" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.info">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP2:_Info_Service">OPeNDAP Dataset Information Page.</Description>
    </Service>

    <Service title="Server Version" role="http://services.opendap.org/dap4/version">
        <link type="text/xml" 
              href="http://test.opendap.org:8090/opendap/hyrax/data/fnoc1.nc.ver">
        <Description href="http://docs.opendap.org/index.php/DAP4_Web_Services#DAP4:_Server_Version_Service">An XML document containing information about the software version of the server..</Description>
    </Service>


    <!-- ##################################################################################### -->
    <!--       Server Side Functions                                                           --> 
    <!-- ..................................................................................... -->


    <function name="geogrid" role="http://services.opendap.org/dap4/server-side-function/geogrid">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#geogrid">Allows a DAP Grid variable to be sub-sampled using georeferenced values.</Description>
    </function>

    <function name="grid" role="http://services.opendap.org/dap4/server-side-function/grid">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#grid">Allows a DAP Grid variable to be sub-sampled using the values of the coordinate axes.</Description>
    </function>

    <function name="linear_scale" role="http://services.opendap.org/dap4/server-side-function/linear-scale">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#linear_scale">Applies a linear scale transform to the named variable.</Description>
    </function>

    <function name="version" role="http://services.opendap.org/dap4/server-side-function/version">
        <Description  href="http://docs.opendap.org/index.php/Server_Side_Processing_Functions#version">Returns version information for each server side function.</Description>
    </function>
   
    <!-- ##################################################################################### -->
    <!--       Server Side Function Group                                                      --> 
    <!-- ..................................................................................... -->

 
    <functionGroup name="ferret" role="http://pmel.noaa.gov/dap4extension/ferret" >
        <Description href="http://ferret.pmel.noaa.gov/Ferret/documentation">This server supports ferret functions.</Description>
    </functionGroup>

    <!-- ##################################################################################### -->
    <!--       Extensions                                                                      --> 
    <!-- ..................................................................................... -->

    <extension name="async" role="http://opendap.org/extension/async">
        <Description href="http://docs.opendap.org/index.php/DAP4:_Asynchronous_Request-Response_Proposal_v3">The server supports asynchronous transactions.</Description>
    </extension>
    
    
</DatasetServices>

Rationale for the solution

The solution provides DAP4 servers with an interface that allows for both server-driven and agent driven content negotiation as described in [section 12 of the HTTP 1.1 specification]. Providing the Dataset Services Response in XML allows many downstream applications to ingest the content and leaves open the option for server implementers to add XSLT references to the document so that clients like browsers can easily build a presentation view of the information.

Discussion

Here is one idea for the HTML version of the DSR; it could be generated by the server using XSLT on the XML or by the browser when the user explicitly requests the .xml variant of the response (by embedding a reference to the XSL transform in that response document):

ServiceDescriptionPrototype-01.png



Appendix: Dataset Services Response XML schema (Under Construction)

This schema works, but it rigidly enforces the order of the content. We may want to rewrite to be more lenient.

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema 
    targetNamespace="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:xml="http://www.w3.org/XML/1998/namespace"
    xmlns:dsr="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    xmlns="http://xml.opendap.org/ns/DAP/4.0/dataset-services#"
    elementFormDefault="qualified" 
    attributeFormDefault="unqualified">
    
    <xs:import  namespace="http://www.w3.org/XML/1998/namespace" schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
    <!--
	
    -->
    <xs:element name="DatasetServices" type="DatasetServicesType"/>
    <xs:element name="DapVersion" type="DapVersionType"/>
    <xs:element name="ServerSoftwareVersion" type="AnyContentType"/>
    <xs:element name="Service" type="ServiceType"/>
    <xs:element name="Description" type="DescriptionType"/>
    <xs:element name="link" type="linkType"/>
    <xs:element name="alt" type="altType"/>
    <xs:element name="function" type="ExtensionType"/>
    <xs:element name="functionGroup" type="ExtensionType"/>
    <xs:element name="extension" type="ExtensionType"/>
    <!--
	
    -->
    <xs:complexType name="DatasetServicesType"> 
        <xs:annotation>
            <xs:documentation>DatasetServices root element type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="DapVersion" minOccurs="1" maxOccurs="unbounded"/>
            <xs:element ref="ServerSoftwareVersion" minOccurs="1" maxOccurs="1"/>
            <xs:element ref="Description" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="Service" minOccurs="3" maxOccurs="unbounded"/>
            <xs:element ref="function" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="functionGroup" minOccurs="0" maxOccurs="unbounded"/>
            <xs:element ref="extension" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute ref="xml:base"  use="required"/>
    </xs:complexType>
    <!--
	
     -->
    <xs:complexType name="ServiceType"> 
        <xs:annotation>
            <xs:documentation>DatasetServices Service type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="Description" minOccurs="0" maxOccurs="1"/>
            <xs:element ref="link" minOccurs="1" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="title" type="xs:string" use="optional"/>
        <xs:attribute name="role" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!--
        
    --> 
    <xs:simpleType name="DapVersionType">
        <xs:restriction base="xs:string">
            <xs:pattern value="\d{1,}.\d{1,}"></xs:pattern>
        </xs:restriction>
    </xs:simpleType>
    <!--
        
    -->
    <xs:complexType name="DescriptionType">
        <xs:simpleContent>
            <xs:extension base="xs:string">
                <xs:attribute name="href" type="xs:anyURI"/>
            </xs:extension>
        </xs:simpleContent>
    </xs:complexType>
    <!--
        
    -->
    <xs:complexType name="altType">
        <xs:attribute name="type" type="xs:string"/>
    </xs:complexType>
    <!--	
        
    -->
    <xs:complexType name="linkType"> 
        <xs:annotation>
            <xs:documentation>DatasetServices link type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="alt" minOccurs="0" maxOccurs="unbounded"/>
        </xs:sequence>
        <xs:attribute name="href" type="xs:string" use="required"/>
        <xs:attribute name="type" type="xs:string" use="required"/>
        <xs:attribute name="description" type="xs:string" use="optional"/>         
    </xs:complexType>
    <!--
	
    -->
    <xs:complexType  name="AnyContentType" mixed="true">
        <xs:annotation>
            <xs:documentation>
                An element of this type may contain arbitrary XML or text content.
                The resulting content is may be 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.
                ( <xs:any/>+ ) 
            </xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:any namespace="##any" minOccurs="0" processContents="lax"/>
        </xs:sequence>
        <xs:anyAttribute processContents="lax" namespace="##any"/>
    </xs:complexType>   
    <!--
	
    -->
    <xs:complexType name="ExtensionType"> 
        <xs:annotation>
            <xs:documentation>Server Extension Type</xs:documentation>
        </xs:annotation>
        <xs:sequence>
            <xs:element ref="Description" minOccurs="1" maxOccurs="1"/>
        </xs:sequence>
        <xs:attribute name="name" type="xs:string" use="required"/>
        <xs:attribute name="role" type="xs:anyURI" use="required"/>
    </xs:complexType>
    <!--
	
     -->
    
</xs:schema>

fini

Contains cruft in comments...