FIWARE:Orion 上下文代理和 CKAN

FIWARE: Orion Context Broker and CKAN

我正在使用 Raspberry Pi 和 Figway 与 Orion ContextBroker 一起工作。我的 Raspberry Pi 正在将数据从一些传感器发送到 Fiware 提供的 public 上下文代理(我没有任何本地上下文代理)。此外,我在 Freeboard 中有一个显示我的传感器信息的仪表板。

现在我发现 Fiware 有一个 CKAN 工具,它允许实时上下文信息可以作为上下文代理查询在 CKAN 中发布。我已遵循此 Tutorial 但我无法理解如何在 Orion Context Broker 中将 CKAN 与我的设备连接。我怎样才能找到我的实体的 URL?

我对Fiware很陌生,写代码的概念还不够,但我可以学习!

提前致谢。

如文档中所述:

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.

请参阅 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.

您还必须配置 Fiware Cygnus

希望对您有所帮助

为了补充@Dalton 的回答...

您正在尝试做的是一种通过查询URL 发布指向 Orion CB 的 CKAN 资源的方法。 CKAN 资源允许这样做,即 CKAN 中的资源可以与 CKAN 本身存储的数据相关,也可以与 CKAN 外部的数据相关;在这种情况下,资源包含数据的 link。

因此,将资源link发送到 Orion CB 实体是通过 CKAN 查询 Orion CB 的一种方式。这意味着每次访问 CKAN 资源时,您将访问相关实体属性的当前值。如果任何实体的属性发生变化并且您再次访问该资源,那么您将访问这样的新值;上一个丢了。

一个非常不同的事情是当你需要在 CKAN 本身中存储(通过它的数据存储,一个 PostgreSQL 包装器)你的实体一直以来拥有的所有值,即当你需要存储你的实体的历史时。在这种情况下,您将需要使用 Cygnus 工具。

您必须在 ContextBroker 中创建订阅并将订阅内的端点设置为指向 ckan 的 url,这样当您要复制到 ckan 的实体或属性更新时,该信息是搬到ckan。你需要这样做的组件是 Cygnus,然后你也必须安装 Cygnus,Cygnus 负责将信息带到 Ckan,此外你必须遵循要存储在 Ckan 中的实体名称的模式,实体的名称必须是小写的,您只能使用连字符和下划线这两个符号,不能使用其他符号。

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