Description
I want to get data contained in private dataset via REST API so that I can write an application that consumes such data.
This case is almost identical to "retrieve metadata about dataset via public catalog API". The only difference here is, that we we are accessing data in internal catalog (which might not be public, yet) and thus ODN account is needed.
Preconditions
- dataset exists in internal catalog with resource created and available via REST API
How to do it:
- clicks the selected dataset 'Name' in the list of catalog records in internal catalog
- list of available resources for a dataset are displayed
- clicks to resource 'Name' or selects 'Preview' from 'Explore' combo box of a resource presented as a resource dedicated for REST API
- if clicks to resource 'Name' or selects 'More information' from 'Explore' combo box
- metadata fields about dataset resource are displayed
- REST API base URL is displayed
- 'Data API' button is available
- clicks 'Data API' button
- REST API documentation is displayed within resource description including
- scheme of the dataset - list of all columns (see preview)
- URL for get all IDs type of request
- URL for get data for one ID type of request (ID is chosen automatically - random) including HTTP header of request
- corresponding response to get data for one ID request with random ID including HTTP header and data returned
- show examples of other types of REST API requests (including HTTP headers) with URLs directly usable including corresponding responses (with real data and HTTP headers)
- if clicks to resource 'Name' or selects 'More information' from 'Explore' combo box
- external code calls the REST API (REST service) of the public catalog according to documentation provided (two types of requests supported: get all IDs, get data for one ID)
- REST API returns JSON representation of data contained in a dataset
Example
In order to demonstrate data API usage in general, and show how to maintain local copies of datasets from ODN efficiently (using uv-t-relationalDiffToCkan DPU), we've created proof-of-concept harvesting application. For more information, take a look at:
https://github.com/OpenDataNode/poc-harvester-app
Introduction article can be found here:
http://opendatanode.org/efficient-dataset-replication-with-odn/