DAP2 and DAP4 Protocol Services

Resources For This Session:

Client Server Architecture

  • We all routinely use the Client Server Architecture when we use a web browser.

  • Key Elements:
    • Client Program (Web Browser)
    • Server Program (Web Page Server)
    • Protocol (HTTP)
    • Message Requests and Replies (HTML)

TDS as Client-Server

The Thredds Data Server is a Server in a client-server architecture. It differs from a web browser in supporting a number of protocols and associated message formats.

  • Operational Flow:

    1. The client sends a request for a file using the DAP protocol URL format.

    2. The TDS DAP handler opens the corresponding file.
      • The type of the file is determined and the corresponding IOSP is accessed.
      • The IOSP translates the native file format to CDM.
    3. The DAP handler converts from CDM to the DAP format, both metadata and data.

    4. The converted CDM is sent to the client using the DAP protocol.

    5. The client processes the returned data, where "processes" is client dependent.
      • For ToolsUI: The DAP format is translated back to CDM for display
  • What are OPenDAP and DAP

    • DAP version 2 (aka DAP2) is a widely supported protocol and standard data format for accessing remote data

    • The DAP2 protocol was expressly designed to serve as intermediate format for accessing a wide variety of data sources

    • The new DAP version 4 protocol (DAP4) provides a richer data model and a more powerful constraint language than DAP2.

    • The DAP2 and DAP4 specifications can be obtained from the OPenDAP website.

    Specifying a DAP Data Source

    • A DAP data source is specified as a URL to be sent to the TDS server. e.g.:
      dods://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
    • The URL needs to provide clues to the client and the server about what protocol to use.
    • The URL is effectively divided into 5 parts.
      1. dods: – This tells the client which protocol to use. Only recognized by netcdf-Java clients.
      2. //remotetest.unidata.ucar.edu – The TDS server.
      3. /thredds – The TDS servlet name.
      4. /dodsC – This tells the TDS server which protocol to use.
      5. /testdata/testData.nc – The dataset to return.
    • For DAP4, dods: => dap4:, and dodsC => dap4
    • For non netCDF-Java clients (i.e. web browser, use http: instead of dods: or dap4:)

    Examine A Dataset in Three Ways

    1. Drop this URL into ToolsUI
      http://remotetest.unidata.ucar.edu/thredds/fileServer/testdata/testData.nc
      This uses the "fileServer" protocol to return the underlying dataset.

    2. Now drop this URL into ToolsUI
      dods://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc
      This uses DAP2 to access the dataset. Underneath, ToolsUI is accessing all three parts: .dds, .das, and .dods.

    3. Notice that ToolsUI displays the same info either way. This is because the conversion from CDM to DAP2 to CDM does not lose any information. This is not true of other datasets. Compare:
      http://remotetest.unidata.ucar.edu/thredds/fileServer/testdods/in_grp.nc
      dods://remotetest.unidata.ucar.edu/thredds/dodsC/testdods/in_grp.nc
      
      This fails because of the presence of groups, which DAP2 cannot handle properly.

    Components of a DAP Response

    • For DAP2, there are three core kinds of responses, providing different information. Each kind can be obtained through a web browser using a different extension(s). e.g.
      http://remotetest.unidata.ucar.edu/thredds/dodsC/testdata/testData.nc.dds
      1. .dds – Return just the meta-data for the requested dataset; this will be the result of translating the CDM to DAP2.
      2. .das – Return just the attributes of the requested dataset; additional attributes may be added that are not in the original dataset.
      3. .dods – Return the metadata followed by the actual contents of the dataset encoded in DAP2 format.

    • DAP4 has different extensions.
      1. .dmr – Equivalent to .dds + .das.
      2. .dap – Equivalent to .dods
      3. .dsr – (New) Returns the "dataset services" that describes how to access the dataset.

    • DAP2 Actually has some additional extensions that are designed for access specifically through a web browser.
      1. .asc – Return the .dods information in ascii format.
      2. .html – Provide a form for accessing subsets of a dataset.

    • DAP4 Does the equivalent by adding additional extensions; e.g.
      1. .dmr.txt – Return the metadata information in textual format.
      2. .dmr.xml – Return the metadata information in xml format.

    DAP2 Constraints

    DAP4 Constraints