简体   繁体   English

固件:Orion上下文代理和CKAN

[英]FIWARE: Orion Context Broker and CKAN

I am using a Raspberry Pi and Figway to work with Orion ContextBroker. 我正在使用Raspberry Pi和Figway与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). 我的Raspberry Pi正在将数据从某些传感器发送到Fiware提供的公共Context Broker(我没有任何本地Context Broker)。 Futhermore I have a dashboard in Freeboard that shows the information of my sensors. 此外,我在Freeboard中有一个仪表板,可显示我的传感器信息。

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. 现在我发现Fiware具有CKAN工具,它允许实时上下文信息可以作为Context Broker查询在CKAN中发布。 I have followed this Tutorial but I can't understand how to connect CKAN with my devices in Orion Context Broker. 我已经按照本教程进行操作,但是我不明白如何在Orion Context Broker中将CKAN与设备连接。 How can I found a the URL of my entities? 如何找到我实体的URL?

I am very new in Fiware and my concepts in writing code are not enough but I am able to learn! 我在Fiware中非常陌生,我编写代码的概念还不够,但是我能够学习!

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. 您还可以通过提供上下文代理URL并选择fiware-ngsi格式来提供动态上下文信息。 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). 选择fiware-ngsi格式后,将出现三个额外的字段,使您可以配置租户和用于访问上下文代理的服务路径(如果数据存储在默认的租户或服务路径中,则可以将它们保留为空)。 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). 最后一个字段使您可以指示上下文代理是否需要身份验证(有关更多详细信息,请参见处理授权和对API的访问控制教程)。

NOTE: fiware-ngsi resources are always linked resources, so if the dataset is private, the fiware-ngsi must require an auth token for coherence. 注意:fiware-ngsi资源始终是链接资源,因此,如果数据集是私有的,则fiware-ngsi必须要求使用auth令牌才能保持一致性。

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. 您可以利用Context Broker支持的连接器,该连接器会自动生成每当上下文信息发生更改时生成的历史记录,并使这些记录可用于在Open Data出版物GE上上传。 The data is then stored in a Datastore, and can be downloaded and queried through REST APIs. 然后,数据将存储在数据存储中,并可通过REST API下载和查询。

In order to achieve this behaviour it is necessary to deploy and configure Cygnus, a piece of software complementary to the Context Broker GE. 为了实现此行为,有必要部署和配置Cygnus,这是与Context Broker GE互补的软件。 The instructions to install Cygnus can be found here. 可以在此处找到安装Cygnus的说明。

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. 简而言之,分三个步骤:配置CKAN存储,在Context Broker中创建所需的订阅,然后运行该过程。

This sink persists the data in a datastore in CKAN. 该接收器将数据持久存储在CKAN中的数据存储中。 Datastores are associated to CKAN resources and as CKAN resources we use the entityId-entityType string concatenation. 数据存储与CKAN资源相关联,作为CKAN资源,我们使用entityId-entityType字符串串联。 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. 所有CKAN资源ID都属于同一数据集(在CKAN中也称为包),该名称由CKAN接收器配置中的default_dataset属性(由组织名称前缀)指定。

You will have to configure Fiware Cygnus too. 您还必须配置Fiware Cygnus

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. 您正在尝试做的是一种通过查询URL发布指向Orion CB的CKAN资源的方法。 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; CKAN资源允许这样做,即CKAN中的资源可以与CKAN自身中存储的数据相关,也可以与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. 因此,拥有链接到Orion CB实体的资源是通过CKAN查询Orion CB的一种方式。 This means each time you access the CKAN resource, you will be accessing the current value of the related entity's attributes. 这意味着每次您访问CKAN资源时,您都将访问相关实体属性的当前值。 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. 完全不同的是,当您需要(通过其DataStore,一个PostgreSQL包装器)存储在CKAN本身中时,即当您需要存储实体的历史时,您的实体具有的所有值。 In that case, you will need to use Cygnus tool. 在这种情况下,您将需要使用Cygnus工具。

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. 您必须在ContextBroker中创建一个预订,并在预订内部设置指向ckan URL的终结点,以便在要复制到ckan的实体或属性更新时,该信息将移至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. 您需要这样做的组件是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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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