OGC-IoT / ogc-iot-api

http://ogc-iot.github.io/ogc-iot-api/index.html
11 stars 3 forks source link

Count and expanded collections #35

Closed hylkevds closed 8 years ago

hylkevds commented 8 years ago

When $count is specified, or enabled by default, should $expand-ed collections also get a count? In the returned json there is no place to put it. Or does it become something like Observations@iot.count ?

The same goes for the @iot.nextLink of expanded sub-collections.

btw, the count and nextLink propertynames are incorrect in http://www.sensorup.com/docs/#get83

tkhalafbeigi commented 8 years ago

$count=true enables the count for the main entity type but not the expanded ones. If you want to enable count for expanded entity type you should use inline count query in the expand. For example, /Datastreams?$expand=Observations($count=true) enables the count for expanded Observations for each Datastream. In this case the count of expanded entity will be shown like Observations@iot.count= as you mentioned. It is the same for nextLink, in this case Observations@iot.nextLink contains the nextLink for expanded Observations inside each Datastream. You can also use other query options inline to expand. Again example could be like /Datastreams?$expand=Observations($count=true;$top=10;$skip=1).