Description
I want to get data contained in a publicly available dataset via REST API so that I can write an application that consumes such data.
Preconditions
- dataset exists in public catalog with resource created and available via REST API
How to do it:
- clicks the selected dataset 'Name' in the list of publicly available catalog records
- 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 according to DCAT/VoID specification
- 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 (the preview contains all columns)
- 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
- include types of columns in scheme
- 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/
Notes
- 'Go to resource' value of the 'Explore' combo box should be disabled for resources published as REST API resource