简体   繁体   English

Fiware orion /op/query 端点工作解释

[英]Fiware orion /op/query endpoint working explaination

I'm a student learning the fiware ecosystem.我是一名学习 fiware 生态系统的学生。 From my previous explorations, I learned how Orion can use proxy services to use external context providers to fetch dynamic context data.从我之前的探索中,我了解了 Orion 如何使用代理服务来使用外部上下文提供程序来获取动态上下文数据。 Here I understood how different endpoints can provide different responses from the given example code which is an express.js application.在这里,我了解了不同的端点如何从给定的示例代码(一个 express.js 应用程序)提供不同的响应。 But I am confused on a few points and want to know working of these.但我对几点感到困惑,想知道这些的工作原理。

  1. How is the Orion batch query able to hit the data if there is no /op/query endpoint defined in the example code?如果示例代码中没有定义/op/query端点,Orion 批处理查询如何能够命中数据?

  2. In the commented section there is these endpoints of the format /random/temperature/ngsi-ld/v1/entities/ , In these does Orion append the ngsi-ld/v1/entities/ part whenever the context of the Store entity is requested using orion/v2/entities/<entity-id> endpoint?在注释部分中,有格式为/random/temperature/ngsi-ld/v1/entities/的这些端点,只要使用请求 Store 实体的上下文,Orion append ngsi-ld/v1/entities/部分就会出现orion/v2/entities/<entity-id>端点?

  3. If orion context broker somehow directs these queries to the proxy by altering them, Where can I get code of the context broker itself for better understanding?如果 orion context broker 以某种方式通过更改这些查询将这些查询定向到代理,我从哪里可以获得 context broker 本身的代码以便更好地理解?

I am working on my college project and any help is appreciated.我正在研究我的大学项目,感谢任何帮助。 Thanks in advance.提前致谢。

The code for the example application you are using is written for NGSI-LD , not NGSI-v2 - they are not the same.您正在使用的示例应用程序的代码是为NGSI-LD而不是NGSI-v2 编写的- 它们不一样。 The example written explicitly for NGSI-v2 does indeed contain an /op/query/ endpoint see here明确为NGSI-v2编写的示例确实包含一个/op/query/端点,请参见此处

router.post('/catfacts/:type/:mapping/op/query', CatFactsNGSIProxy.getAsNGSIv2);
router.post('/random/:type/:mapping/op/query', RandomNGSIProxy.getAsNGSIv2);
router.post('/static/:type/:mapping/op/query', StaticNGSIProxy.getAsNGSIv2);
router.post('/twitter/:type/:mapping/:queryString/op/query', TwitterNGSIProxy.getAsNGSIv2);
router.post('/weather/:type/:mapping/:queryString/op/query', WeatherNGSIProxy.getAsNGSIv2);

This allows for a simple connection to IoT Agents which just needs to handle the /op/query/ endpoint.这允许与只需要处理/op/query/端点的 IoT 代理的简单连接。

Note :type/:mapping/:queryString are just added to keep the sample code generic, and would not be needed for a simple registrant.注意:type/:mapping/:queryString只是为了保持示例代码的通用性而添加的,简单的注册者不需要。

In NGSI-LD , the ETSI committee has decided that a request forwarded to a registrant application shall mimic the original request as far as possible, so a GET is forwarded as a GET, a POST as a POST, a DELETE as a DELETE etc. The equivalent endpoints look like this:NGSI-LD中, ETSI 委员会决定转发给注册者应用程序的请求应尽可能模仿原始请求,因此 GET 转发为 GET,POST 转发为 POST,DELETE 转发为 DELETE 等。等效端点如下所示:

router.get('/catfacts/:type/:mapping/ngsi-ld/v1/entities/:id', CatFactsNGSIProxy.getAsNgsiLD);
router.get('/random/:type/:mapping/ngsi-ld/v1/entities/:id', RandomNGSIProxy.getAsNgsiLD);
router.get('/static/:type/:mapping/ngsi-ld/v1/entities/:id', StaticNGSIProxy.getAsNgsiLD);
router.get('/twitter/:type/:mapping/:queryString/ngsi-ld/v1/entities/:id', TwitterNGSIProxy.getAsNgsiLD);
router.get('/weather/:type/:mapping/:queryString/ngsi-ld/v1/entities/:id', WeatherNGSIProxy.getAsNgsiLD);

In NGSI-LD , the focus is generally on the federated use cases of multiple full context brokers talking to each other, which obviously can handle all NGSI endpoints, however, there are also other common distributed deployment scenarios:NGSI-LD中,重点通常是多个全上下文代理相互对话的联合用例,这显然可以处理所有 NGSI 端点,但是,还有其他常见的分布式部署场景:

  • Support for actuation (IoT Agents)支持驱动(物联网代理)
  • Support for “lazy” attributes (IoT Agents)支持“惰性”属性(物联网代理)
  • Explicit distribution of context information, eg one context source for vehicles, another for bicycles上下文信息的显式分布,例如车辆的一个上下文源,自行车的另一个上下文源
  • Backup context sources eg less frequently updated备份上下文源,例如更新频率较低
  • Complex Data Sharing scenarios复杂的数据共享场景

To cover this, it is now possible to define a subset of accepted operations - more information can be found here .为了解决这个问题,现在可以定义一个可接受的操作的子集——更多信息可以在这里找到。 This decision allows for a much wider range of data sharing scenarios to be catered for.这一决定允许满足更广泛的数据共享场景。

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

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