简体   繁体   中英

FIWARE: Orion Context Broker and CKAN

I am using a Raspberry Pi and Figway to work with Orion ContextBroker. My Raspberry Pi is sending data from some sensors to the public Context Broker that Fiware provide (I don't have any local Context Broker). Futhermore I have a dashboard in Freeboard that shows the information of my sensors.

Now I have found Fiware has a CKAN tool, it allows to real time context information can be published in CKAN as Context Broker queries. I have followed this Tutorial but I can't understand how to connect CKAN with my devices in Orion Context Broker. How can I found a the URL of my entities?

I am very new in Fiware and my concepts in writing code are not enough but I am able to learn!

Thanks in advance.

As stated in the documentation:

You can also provide dynamic context information by providing a context broker URL and selecting the fiware-ngsi format. Once selected the fiware-ngsi format, three extra fields will appear allowing you to configure the tenant and the service path to use for accesing the context broker (you can leave them empty if the data is stored in the default tenant or service path). The last field allows you to indicate whether the context broker requires authentication (see the Handling authorization and access control to APIs tutorial for more details).

NOTE: fiware-ngsi resources are always linked resources, so if the dataset is private, the fiware-ngsi must require an auth token for coherence.

Please also see this guide .

You may take advantage of the connectors supported by the Context Broker that automatically generate historic records generated each time there is a change in the context information and make those records available for upload on the Open Data publication GE. The data is then stored in a Datastore, and can be downloaded and queried through REST APIs.

In order to achieve this behaviour it is necessary to deploy and configure Cygnus, a piece of software complementary to the Context Broker GE. The instructions to install Cygnus can be found here.

Once Cygnus has been installed, it is required to configure it. In a nutshell, there are three steps: configure CKAN storage, create the desired subscriptions in the Context Broker and run the process.

This sink persists the data in a datastore in CKAN. Datastores are associated to CKAN resources and as CKAN resources we use the entityId-entityType string concatenation. All CKAN resource IDs belong to the same dataset (also referred as package in CKAN terms), which name is specified with the default_dataset property (prefixed by organization name) in the CKAN sink configuration.

You will have to configure Fiware Cygnus too.

I hope this can help you.

In order to complement @Dalton's answer...

What you are trying to do is a way of publishing CKAN resources pointing to Orion CB by means of a query URL. CKAN resources allow for that, ie a resource in CKAN can be related to data stored within CKAN itself, or be related to data outside CKAN; in that case the resource contains a link to the data.

Thus, having resources linking to Orion CB entities is a way of querying Orion CB through CKAN. This means each time you access the CKAN resource, you will be accessing the current value of the related entity's attributes. If any entity's attribute change and you access the resource again, then you'll be accesing such new value; the previous one is lost.

A very different thing is when you need to store in CKAN itself (through its DataStore, a PostgreSQL wrapper) all the values your entities have had along the time, ie when you need to store your entities' history. In that case, you will need to use Cygnus tool.

You have to create a subscription in ContextBroker and set the endpoint inside the subscription pointing at the url of ckan so that when the entities or attributes that you want to copy to ckan are updated, that information is moved to ckan. The component that you need to do so is Cygnus, then you have to install Cygnus too, Cygnus is in charge to take the information to Ckan, furthermore you have to follow a pattern in the entities' names that you want to store in Ckan, the name of the entities have to be in lowercase and you only can use this two symbols hyphen and underscore, no others.

https://fiware-tutorials.readthedocs.io/en/latest/subscriptions/index.html
https://fiwaretourguide.readthedocs.io/en/latest/core/cygnus/introduction/
https://fiware-tutorials.readthedocs.io/en/latest/index.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM