条件为georel的Fiorion Orion订阅 [英] Fiware orion subscription with georel expression in condition

查看:86
本文介绍了条件为georel的Fiorion Orion订阅的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的猎户座数据库中有一个实体:

I have an entity in my orion DB:

{
  "id"=>"User-121",
  "type"=>"User",
  "location"=>{
    "type"=>"geo:point", 
    "value"=>"59.851484, 30.199463"
  }, 
  "time"=>{"type"=>"none", "value"=>222909, "metadata"=>{}}
}

此外,我对此实体有3个订阅,它们在条件表达式中的坐标相同:

Also, I have 3 subscriptions to this entity, which have the same coordinates in condition's expression:

  1. 当实体位于距参考点至少100米的位置时应触发.

{
  "id"=>"...",
  "expires"=>"...",
  "status"=>"active",
  "subject"=>{
    "entities"=>[{"id"=>"User-121", "idPattern"=>"", "type"=>"User"}],
    "condition"=>{
      "attributes"=>["location", "time"], 
      "expression"=>{
        "q"=>"", 
        "geometry"=>"point", 
        "coords"=>"59.851484, 30.199463", 
        "georel"=>"near;minDistance:100"}
    }
  },
  "notification"=>{
    "callback"=>"http://callback", 
    "attributes"=>["time"]
  }
}

  1. 应在实体距参考点最大距离为100米时触发

{
  "id"=>"...",
  "expires"=>"...",
  "status"=>"active",
  "subject"=>{
    "entities"=>[{"id"=>"User-121", "idPattern"=>"", "type"=>"User"}],
    "condition"=>{
      "attributes"=>["location", "time"], 
      "expression"=>{
        "q"=>"", 
        "geometry"=>"point", 
        "coords"=>"59.851484, 30.199463", 
        "georel"=>"near;maxDistance:100"}
    }
  },
  "notification"=>{
    "callback"=>"http://callback",  
    "attributes"=>["time"]
  }
},

  1. 当实体位于参考点(具有相同的坐标)时应触发

{
  "id"=>"...",
  "expires"=>"...",
  "status"=>"active",
  "subject"=>{
    "entities"=>[{"id"=>"User-121", "idPattern"=>"", "type"=>"User"}],
    "condition"=>{
      "attributes"=>["location", "time"], 
      "expression"=>{
        "q"=>"", 
        "geometry"=>"point", 
        "coords"=>"59.851484, 30.199463", 
        "georel"=>"equals"}
    }
  },
  "notification"=>{
    "callback"=>"http://callback", 
    "attributes"=>["time"]
  }
}

问题在于,每次我更新实体时,所有订阅都会发送通知.它甚至不依赖于实体的坐标值.无论坐标是什么,我总是会收到3条有关任何更新的通知.

The problem is that all of the subscriptions send notifications each time I update the entity. It doesn't even depend on the entity's coordinates values. Whatever the coordinates are, I always receive 3 notifications of any update.

我在做什么错了?

Orion Context Broker版本为 0.28.0 (git版本:5c1afdb3dd748580f10e1809f82462d83d2a17d4)

The Orion Context Broker version is 0.28.0 (git version: 5c1afdb3dd748580f10e1809f82462d83d2a17d4)

推荐答案

尚未实现NGSIv2订阅中的地理位置功能(在Orion 0.28.0上).请注意,NGSIv2仍处于测试版状态,有时甚至是规范(其中geometrygeorelcoords被定义为expression的一部分)是向前迈进的一步.

Geo-location features in NGSIv2 subscriptions have not been yet implemented (at Orion 0.28.0). Note that NGSIv2 is yet in beta status and sometimes the specification (where the geometry, georel and coords are defined as part of expression) is a step forward the implementation.

有关github的问题,您可以订阅以便知道何时实现此功能.

There is a github issue about this, to which you can subscribe in order to know when this feature gets implemented.

编辑:NGSIv2订阅中的地理位置功能将在Orion 1.3.0中提供(将于8月底或9月初发布).如果您不想等待,请注意,该功能在develop分支(和相关的Docker)中也可用.

EDIT: geo-location features in NGSIv2 subscriptions will be available in Orion 1.3.0 (to be released by the end of August or begining of September). If you don't want to wait, note the functionality is also available in the develop branch (and associated Docker).

这篇关于条件为georel的Fiorion Orion订阅的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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