You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

FIWARE Orion Context Broker支持的原始数据类型有哪些?

Orion Context Broker: Supported Raw Data Types for Entity Attributes

I totally get the frustration of hunting down clear documentation on this—NGSI's own type system vs. native JSON types can be confusing at first. Let's break this down based on official definitions and practical usage in Orion:

First, as you noted in the NGSI docs:

属性类型表示属性值的NGSI值类型。请注意,FIWARE NGSI拥有自身的属性值类型系统,因此NGSI值类型与JSON类型并不相同。

Orion (which implements NGSI v2) doesn't use raw JSON types like integer or float directly. Instead, it relies on a streamlined set of NGSI-specific value types for attributes. Here are the core supported raw types you can use reliably:

  • Text: For string-based values (maps directly to JSON string type)
  • Number: For all numeric values—integers, floats, decimals alike (maps to JSON number; you don't need separate types like integer here)
  • Boolean: For true/false logical values (maps to JSON boolean type)

Beyond these raw types, there are structured options like StructuredValue (for JSON objects/arrays) and GeoProperty (for geospatial data like coordinates), but those are more specialized use cases.

If you tried using something like integer directly, Orion will either default to treating it as an unrecognized generic type or throw an error—stick to the official NGSI types listed above. Here's a quick example of creating an entity with these raw types via the Orion API:

{
  "id": "LivingRoomSensor_001",
  "type": "TemperatureSensor",
  "currentTemp": {
    "value": 22.7,
    "type": "Number"
  },
  "sensorLocation": {
    "value": "Living Room",
    "type": "Text"
  },
  "isCalibrated": {
    "value": true,
    "type": "Boolean"
  }
}

Just to confirm: even if you pass an integer value like 45, using Number as the attribute type is the correct, officially supported approach in NGSI v2 for Orion. The broker handles all numeric value variations internally without needing a dedicated integer type.

内容的提问来源于stack exchange,提问作者Emiliano Viotti

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.19 04:18:39