-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #195 from noi-techpark/issue-190-rearrange-accessi…
…ng-data Issue 190 rearrange accessing data
- Loading branch information
Showing
7 changed files
with
211 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
.. e-charging station | ||
.. panels:: | ||
:container: container-fluid | ||
:column: col-md-6 | ||
|
||
----- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
|
||
The APIs are composed of a few generic methods, that can be combined | ||
with many parameters to retrieve only the relevant data and then | ||
post-processed in the preferred way. | ||
|
||
The following table summarises how the two versions of the API can be | ||
used within the Open Data Hub's domains. | ||
|
||
=== ============ ============= | ||
API Tourism Mobility | ||
=== ============ ============= | ||
v1 |recommend| |deprecated| | ||
v2 -- |recommend| | ||
=== ============ ============= | ||
|
||
|
||
There are currently two versions of the API, v1 and v2, with the | ||
former now :strong:`deprecated` for the Mobility domain and marked as | ||
such |deprecated| throughout the Open Data Hub documentation. New | ||
users are recommended to use the new API v2, while users of the API v1 | ||
are encouraged to plan a migration to the new API. | ||
|
||
The new API v2 has a different approach compared to the previous | ||
version, and therefore is not compatible with the API v1, the main | ||
difference being that all data stored in the Open Data Hub can now be | ||
retrieved `from a single endpoint`, while with API v1 there was an | ||
endpoint for each dataset. | ||
|
||
This change in approach requires also a breaking change for the users | ||
of API v1. The initial step, indeed, will not be to open the URL of | ||
the dataset and start exploring, but to retrieve the | ||
:literal:`stationType`\s and then retrieve additional data about each | ||
station. A :literal:`stationType` is the main object of a datasets, | ||
about which all the information in a dataset relate to; a dataset | ||
includes at least one :literal:`stationType`. A new, dedicated howto | ||
describing in detail the new API v2 and a few basic examples is | ||
:ref:`already available <get-started-mobility>` in the dedicated | ||
section of this documentation. | ||
|
||
.. note:: It is important to remark that the API v2 is :strong:`only | ||
available` for datasets in the :strong:`Mobility` Domain. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
Unlike browser access, that provides an interactive access to data, | ||
with the option to incrementally refine a query, command line access | ||
proves useful for non-interactive, one-directional, and quick data | ||
retrieval in a number of scenarios, including: | ||
|
||
* Scripting, data manipulation and interpolation, to be used in | ||
statistical analysis. | ||
* Applications that gather data and present them to the end users. | ||
* Automatic updates to third-parties websites or kiosk-systems like | ||
e.g., in the hall of hotels. | ||
|
||
Command line access to the data is usually carried out with the | ||
:program:`curl` Linux utility, which is used to retrieve information | ||
in a non-interactive way from a remote site and can be used with a | ||
variety of options and can save the contents it downloads, which can | ||
them be send to other applications and manipulated. | ||
|
||
The number of options required by :program:`curl` to retrieve data | ||
from Open Data Hub's dataset is limited, usually they are not more | ||
than 3 or 4, but their syntax and content might become long and not | ||
easily readable by a human, due to the number of :ref:`filters | ||
<common-filters>` available. For example, to retrieve the list of all | ||
points of interests in South Tyrol, the following command should be | ||
used: | ||
|
||
.. code-block:: bash | ||
curl -X GET "http://tourism.opendatahub.bz.it/api/ODHActivityPoi?pagenumber=1&pagesize=10&type=63&subtype=null&poitype=null&idlist=null&locfilter=null&langfilter=null&areafilter=null&highlight=null&source=null&odhtagfilter=null&odhactive=null&active=null&seed=null&latitude=null&longitude=null&radius=null" -H "accept: application/json" | ||
Your best opportunity to learn about the correct syntax and parameters | ||
to use is to go to the :strong:`swagger interface` of the `tourism | ||
<http://tourism.opendatahub.bz.it/swagger/ui/index>`_ or `mobility | ||
<https://mobility.api.opendatahub.bz.it/>`_ domains and execute a | ||
query: with the output, also the corresponding :program:`curl` command | ||
used to retrieve the data will be shown. |
Oops, something went wrong.