Fiware 如何计算彗星中的最大值?
sth comet提供了计算最大值、最小值和其他函数的可能性,如[此处]所述 但是我尝试了不同的类型,它没有给出聚合结果 在本例中,我使用属性“温度”的实体的简化版本为:Fiware 如何计算彗星中的最大值?,fiware,fiware-sth-comet,Fiware,Fiware Sth Comet,sth comet提供了计算最大值、最小值和其他函数的可能性,如[此处]所述 但是我尝试了不同的类型,它没有给出聚合结果 在本例中,我使用属性“温度”的实体的简化版本为: { "id": "Beach:27", "type": "Beach", "flag": { "type": "Property", "value": "Verde" }, "temperature": { "type": "Numbe
{
"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"
}
}
]
}
属性必须使用哪种类型才能正常工作?我尝试了Number、integer、string和Property,但没有获得最大值
感谢您的时间对聚合时间序列上下文信息的请求可以使用以下查询参数: aggrMethod:必须使用max、min、sum和sum2。 aggrPeriod:强制您可以使用月、日、小时、分钟和秒。 dateFrom和dateTo:对于查询的数据范围是可选的。 在您的请求中,您没有放置强制参数aggrPeriod。你能测试一下别的东西吗 http://{sth comet}/sth/v1/contextenties/type/Beach/id/Beach:27/attributes/temperature?aggrMethod=max&aggrPeriod=second&dateFrom=2019-09-15T00:00:00.000Z&dateTo=2019-09-15T23:59:59.999Z