1 / 12

Tools to Build Clients

Learn how to build client toolkits in C/C++ using Libdap, the reference implementation of DAP2. Explore Libdap, Ocapi, Libnc-dap, and Loaddap for building clients in various languages. Understand the two types of clients built using DAP implementations and non-DAP APIs, and gain access to all datasets with well-matched network I/O operations.

guinnm
Download Presentation

Tools to Build Clients

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Tools to Build Clients

  2. Toolkits based on C/C++ • Libdap • C++ library, the reference implementation of DAP2 • Ocapi • C library, client side only • Libnc-dap • Build clients using netCDF • Loaddap • Build clients using either Matlab or IDL

  3. Two types of Clients • Built using DAP implementations • Complete access to all data sets served • Well matched to network I/O operations • Can be confusing to use - not intended for casual use • Built using non-DAP APIs • Easy APIs to use because many people are familiar with them - designed to be suited to application domains • Not well matched to all data sets - data model mis-match between the API and the DAP2

  4. Libdap C++ • Basic use model: open a ‘connection’ to a server • Get the data set’s metadata • Access data • Close connection

  5. Libdap Connect Class • Provides the interface for most client access • The Connect constructor method is used to ‘connect’ to a URL • Four methods are used to get the DAS, DDS, DDX and Data responses • Other methods control miscellaneous features: • Configure client-side caching • Set username and password credentials • Establish whether the client can process compressed responses • Get the server/protocol version given a virtual connection has been established

  6. Libdap example • Look at libdap’s Connect.h source file for the complete interface to Connect • The getdap client uses Connect • Look at the libdap source file getdap.cc • ‘name’ below is the URL minus any CE

  7. Get a Response - How getdap gets the DDS The request. ‘expr’ is the constraint expression passed in using ‘-c’. The DDS object is a value-result parameter Getdap just prints the DDS using the DD::print() method

  8. Getdap access data in much the same way… The data request. Note that the DDS is a value-result parameter here too. However the variables in this DDS are loaded with data The print_data function handles access to the data values

  9. More about using libdap • Responses from the ‘get’ methods of Connect are libdap container classes • DAS: Semantic metadata; access values using methods bound to the DAS class • DDS: Syntactic metadata; access name and type information for the dataset • Data: Also returned using a DDS, but now the variables hold data

  10. About Connect’s Get Methods • DDS -vs- Data: The syntactic metadata is represented using a DDS object with variables that are instances of classes which specialize BaseType • Or, think of the DDS/Variables objects as a parse tree typical of a compiler or interpreter • This tree is used to record/express the variables’ types and their relationships

  11. Where data resides • In the DDS ‘parse tree’ data can be held in the variables. • Accessor methods can be used to read values out. • These Accessors behave like most data read functions (stdio’s read(), netCDF’s get_var(), et c.) providing data in blocks of memory.

  12. Client APIs Summary • C++ is hard(er) to use for many people, but the basic mode of operation for libdap (C++) and Ocapi ( C) is the same: • Open • Read • Close • The read operation used for our interfaces are very similar to those used with netCDF, HDF4, HDF5 • Grab the metadata, look at the types, allocate memory, read data per variable. • DAP APIs (libdap, Ocapi) provide a way to read several variables at once (optimized for network I/O), but the concepts are really the same.

More Related