3. 2
Orion: Review
▪ Main NGSI Concepts:
▪ Entity Id
▪ Entity Type
▪ Attributes
▪ By design, Orion CB persists only
the last pushed value of each attribute.
{ https://github.com/Fiware/dataModels/blob/master/Weather/
WeatherObserved/example.json
"id": "Spain-WeatherObserved-Valladolid-2016-11-30T07:00:00.00Z",
"type": "WeatherObserved",
"address":
{
"addressLocality": "Valladolid",
"addressCountry": "ES"
},
"barometricPressure": 938.9,
"dataProvider": "TEF",
"dateObserved": "2016-11-30T07:00:00.00Z",
"location":
{
"type": "Point",
"coordinates":
[
-4.754444444,
41.640833333
]
},
"precipitation": 0,
"pressureTendency": 0.5,
"relativeHumidity": 1,
"source": "http://www.aemet.es",
"stationCode": "2422",
"stationName": "Valladolid",
"temperature": 3.3,
"windDirection": -45,
"windSpeed": 2,
"refDevice": "device-0A3478"
}
4. 3
Comet: Review
▪ Comet brings Historical Data to FIWARE in two forms:
• Raw Queries
http://fiware-sth-comet.readthedocs.io/en/latest/raw-data-retrieval/index.html
http://<sth-host>:<sth-port>/STH/v1/
contextEntities/type/<entityType>/id/<entityId>/attributes/<attrName>?
hLimit=3&hOffset=0&dateFrom=2016-01-01T00:00:00.000Z&dateTo=2016-01-31T23:59:59.999Z
• Aggregated Queries
http://fiware-sth-comet.readthedocs.io/en/latest/aggregated-data-retrieval/index.html
http://<sth-host>:<sth-port>/STH/v1/
contextEntities/type/<entityType>/id/<entityId>/attributes/<attrName>?
aggrMethod=sum&aggrPeriod=second&dateFrom=2016-02101T00:00:00.000Z&dateTo=2016-01-
01T23:59:59.999Z
5. 4
Comet: What’s missing
▪ Support for NGSI v2.
• Discussed in GH #323
▪ Support for Cross-Entities Queries.
• E.g: Avg temperature of all weather station meters in Madrid?
• Discussed in GH #430
• /STH/v1/contextEntities/type/<entityType>/id/<entityId>/attributes/<attrName>?
▪ Support for other than MongoDB. Why?
• Difficult to scale it properly.
• Schemaless -> no joins -> not easy cross-document queries.
• Many new options for efficient and powerful TimeSeries data handling.
11. 10
4: The API proposal: PARAMETERS
Query
parameter
Example Value
type WeatherObserved,
id station01,station02,
idPattern .*
attrs temperature,pressure
Query
parameter
Example Value
aggrMethod avg
aggrPeriod month
options see NGSIv2
Query
parameter
Example Value
from
2016-01-
01T00:00:00.000Z
to
2016-03-
01T00:00:00.000Z
lastN 100
limit 100
12. 11
The API proposal: META
/config endpoint to bring optimization opportunities through the customization of:
▪ Number of replicas
▪ Number of shards
▪ Partitioning by index