CKAN extension that will give you the ability to manage right-time resources provided by a FIWARE Context Broker. This extension also provides a basic view to provide a data preview to user browsing context broker resources, altough it can be combined with other plugins (e.g. the ckanext-wirecloud_view one) to provide a more advanced visualization of the data provided using CKAN.
Note: This extension is being tested using CKAN 2.5, 2.6, 2.7 and 2.8. These are therefore considered as the supported versions
resource_proxy. This extension is required to be able to make requests to the Context Broker and thus is required for the raw view (ngsi-view) provided by this plugin.- OAuth2 CKAN Extension. This extension is required to make request to secured Context Broker instances. The autentication token will be taken from the current user session, so the accessed context broker must be connected to the same IdM server as the one used to login into CKAN, if not, the token will not work.
To install ckanext-right_time_context:
-
Activate your CKAN virtual environment, for example:
. /usr/lib/ckan/default/bin/activate -
Install the
ckanext-right_time_contextpython package into your virtual environment:pip install ckanext-right_time_context -
Add
right_time_contextto theckan.pluginssetting in your CKAN config file (e.g./etc/ckan/default/production.ini). If you want to make use of the raw view provided by this plugin, you will have to ensure theresource_proxyis also enabled (comes directly with CKAN, but it is not enabled by default) -
Restart CKAN. For example if you've deployed CKAN with Apache:
sudo service apache2 graceful
Please take a look into the
ckanext-oauth2installation guide if you are interested on linking secured context brokers.
To install ckanext-right_time_context for development, activate your CKAN virtualenv and
do:
git clone https://github.com/conwetlab/ckanext-right_time_context.git
cd ckanext-right_time_context
python setup.py develop
The way to create a NGSI resource is fairly simple:
-
Firstly you have to access to the form for creating a new resource.
-
Use
fiware-ngsito fill theFormatfield, this will make the form change adding some extra fields required when using thefiware-ngsiformat. -
Fill the
URLfield with a Context Broker query. It is recommended to use a NGSIv2 query, but it is possible to use also a v1 convenience query context url. Examples are:http://orion.lab.fiware.org:1026/v2/entities?type=AirQualityObservedhttp://orion.lab.fiware.org:1026/v1/contextEntities/MeteoLo
-
Finally, check if you have to use some of the extra options:
- Set
Auth Typeto the appropiate value if the Context Broker server requires authentication. - Fill the
FIWARE-Servicefield if the data is not provided by the default tenant. - And finally, fill the
FIWARE-ServicePathfield if the data should be filtered using a service path.
- Set
-
Once you provide all the requested information, click on the Add button.