使用EntityID从EntityContext检索Fiware-ServicePath [英] Retrieve Fiware-ServicePath from EntityContext using EntityID

查看:78
本文介绍了使用EntityID从EntityContext检索Fiware-ServicePath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我找不到有关实体服务和服务路径的详细文档,最好的是

I could not find detailed documentation about Entity Service and Service Path, this is best i could find is this section in the Orion User Manual

我想为特定的Entity_ID检索"Fiware-ServicePath",但是NGSI10不使用queryContext提供该信息.

I would like to retrieve a "Fiware-ServicePath" for a specific Entity_ID but NGSI10 does not provide that information using queryContext.

是否有检索此信息的方法?

Is there a way of retrieving this information ?

这里描述了我的流程,除了使用EntityID获取ServicePath 部分之外,其他所有功能都可以正常工作:

My process is described here, everything is working except the the Get ServicePath using EntityID part:

  • 网关正在将数据推送到Orion中,我想进行更新或插入过程":
    • 使用EntityID获取ServicePath
      • 如果存在:请更新
      • 如果不存在:带有ServicePath'/NewItems'的updatecontext
      • A gateway is pushing data into Orion and i would like to make to "update or insert procedure":
        • Get ServicePath using EntityID
          • IF exists: update it
          • If not exists: updatecontext with ServicePath '/NewItems'

          作为一种解决方法,我将ServicePath添加到一些元数据中...

          As a workaround, I would add the ServicePath into some metadata...

          推荐答案

          您可以将Fiware-ServicePath: /NewItems添加到查询请求中,以检查实体是否在该服务路径中.您还可以添加逗号分隔的列表,例如Fiware-ServicePath: /NewItems1, /NewItems2.

          You can add Fiware-ServicePath: /NewItems to the query request in order to check if the entity is in that service path or not. You can also add a comma-separated list, e.g. Fiware-ServicePath: /NewItems1, /NewItems2.

          该方法将起作用,除非该实体可以位于任何服务路径中(甚至与将用于创建实体的"/NewItems"都无法通过存在检查)并且您不事先知道它们.

          This approach would work except if the entity can be in any service path (even diffent to the "/NewItems" that is going to be use to create entity failing the existence checking) and you don't know them in advance.

          在那种情况下,目前的解决方法就是存储与该实体关联的服务路径,尽管我的建议是为此使用实体属性,而不是元数据(请注意,在NGSI中,元数据已关联属性,而不是实体本身.

          In that case, the workaround by the moment is as you say, to store the service path associated to the entity, although my recomendation is to use an entity attribute for that, not a metadata (note that in NGSI metadata are associated to attributes, not entity themselves).

          这篇关于使用EntityID从EntityContext检索Fiware-ServicePath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆