JSON response specification
Nathan Potter
ndp at opendap.org
Tue Nov 14 08:18:34 PST 2006
On Nov 14, 2006, at 3:59 AM, Roberto De Almeida wrote:
> Hi, all.
>
> I would like to propose an informal specification of a JSON
> (JavaScript Object Notation) response for DAP servers. The JSON
> response combines the DDS and DAS in a single response; optionally,
> the client may also request the data values together with the
> response.
As part of the pending DAP4 specification we have been developing a
combined DDS/DAS using XML. The DDX combines DDS and DAS information
in a single XML document. Prototype code has been developed that
supports this. We have not releases it yet because there are pending
changes to the draft DAP4 specification that have not been
implemented in the current prototype code.
However, if you check out the Java-OPeNDAP project from our
subversion repository you can get the prototype code. The prototype
schema is included in this. The current C++ code also supports the
DDX. The caveat is that the way that data gets returned will
definitely change from the way the prototype code does it (through
multiple requests) to a single request/response in which the server
returns a multipart MIME document containg the DDX in one part and
the XDR encoded binary data in another part.
I skimmed you spec and my first response to this idea of JSON is to
ask - can you do it with an XML representation?
And does our XML representation suffice? Combining the DDS and DDS
is an idea whose time has come, but it would be cool if we could use
a standard representation.
Nathan
>
> The rationale behind the JSON response is to simplify the development
> of AJAX applications that access the server using Javascript. The JSON
> response is valid Javascript and can be evaled by the browser to
> return a "dataset object" with variables, attributes and possibly
> data. Since AJAX applications are becoming more common I thought it
> would be interesting to write a specification that could be shared
> between servers and clients.
>
> The current specification is implemented by pydap through a plugin
> called ``dap.responses.json`` that can be installed separately. The
> current draft of the spec is located at:
>
> http://pydap.org/responses/json.html#dap-json-spec
>
> The spec is by no means final. I would be happy to hear comments,
> critics and suggestions.
>
> More information about JSON can be found here:
>
> http://json.org
>
> Incidentally, I also wrote DDS and DAS parsers in Javascript:
>
> http://code.google.com/p/jsdap/
>
> My plan was to write a full DAP client in Javascript, but I gave up
> when I started writing the XDR decoder. :)
>
> Thanks,
> Roberto
>
=======================================================
Nathan Potter The OPeNDAP Project
ndp at opendap.org http://opendap.org
541.752.1852 voice
More information about the Opendap-tech
mailing list