sth-comet 提供了计算最大值、最小值和其他函数的可能性,如 [此处] https://github.com/telefonicaid/fiware-sth-comet/blob/master/doc/manuals/aggregated-data-retrieval 所述。 MD
但我尝试了不同的类型,但它没有给出聚合结果。
我的实体的简化版本(我在本例中使用温度属性)是:
{
"id": "Beach:27",
"type": "Beach",
"flag": {
"type": "Property",
"value": "Verde"
},
"temperature": {
"type": "Number",
"value": 45
}
我做了这个应该给出最大值的查询:
http://{{sth-comet}}/STH/v1/contextEntities/type/Beach/id/Beach:27/attributes/temperature?aggrMethod=max&hLimit=100&hOffset=0
但结果不是最大值而是属性的所有变化:
{
"contextResponses": [
{
"contextElement": {
"attributes": [
{
"name": "temperature",
"values": [
{
"recvTime": "2019-09-15T18:32:18.166Z",
"attrType": "Number",
"attrValue": "43"
},
{
"recvTime": "2019-09-15T18:32:24.645Z",
"attrType": "Number",
"attrValue": "44"
},
{
"recvTime": "2019-09-15T18:32:28.931Z",
"attrType": "Number",
"attrValue": "45"
}
]
}
],
"id": "Beach:27",
"isPattern": false,
"type": "Beach"
},
"statusCode": {
"code": "200",
"reasonPhrase": "OK"
}
}
]
}
该属性必须具有哪种类型才能正常工作?我尝试了“数字”、“整数”、“字符串”、“属性”,但没有获得“最大值”值。
感谢您的时间