FraunhoferIOSB / FROST-Server

A Complete Server implementation of the OGC SensorThings API
https://fraunhoferiosb.github.io/FROST-Server/
GNU Lesser General Public License v3.0
194 stars 70 forks source link

MultiDatastream Issue and Query #5

Closed aditisg17 closed 7 years ago

aditisg17 commented 7 years ago

Issue While working on MultiDatastream, we noticed that we were not able to get the observations for the MultiDatastream.

http://apiserver:8080/SensorThingsService/v1.0/Observations(7)/MultiDatastream - working http://apiserver:8080/SensorThingsService/v1.0/MultiDatastreams(3)/Observations - not working

Analysis: PathSqlBuilder class helps to bulid "SQLQuery" for "Multidatastream/Observation" using "queryMultiDatastreams" method.

Here SQLQuery uses "Datastreams" instead "MultiDatastreams"

Fix: To get correct MultiDatastreams/Observations, build SQLQuery innerJoin using "MultiDatastreams"

Query: The MultiDatastream observation looks as follows: ["2017-04-12","21",["20","22"]]

1> Is there a way to get the 2nd value in the result array? Observations(2815)/result[1]/$value

2> Is it possible to use the value with comparison operator? Observations(2815)?$filter = result[1] eq 21

hylkevds commented 7 years ago

Thanks for the clear bug report! Good catch. It seems the tests I added to the test-suit did not test for that. I've also updated the tests.

hylkevds commented 7 years ago

As for querying the result: At the moment that is not possible. SensorThings API and OData both do not specify how to query for specific items in arrays. There is an issue item on the SensorThings API github about that very topic here: https://github.com/opengeospatial/sensorthings/issues/22 If you are interested in this feature, do let us know in that topic!