Skip to content

Differences STA OData

Hylke van der Schaaf edited this page Jul 2, 2023 · 18 revisions

Discussion: https://github.com/opengeospatial/sensorthings/issues/136

STA OData 4.0 OData 4.01
Self Links @iot.selfLink @odata.id @id
NavLinks @iot.navigationLink @odata.navigationLink @navigationLink
ID property @iot.id id (@ and . confuse clients) id (@ and . confuse clients)
Context @odata.context @context
Flexible Properties property type ANY not supported Edm.Untyped
Time Interval/Value phenomenonTime, validTime not supported not supported, use a complex property phenomenonTime/start and phenomenonTime/end?
Non existing entities 404 Not Found 204 No Content 204 No Content
Updating relations Add only Add only, remove using $ref deep updates
Specifying related entities @iot.id (primary key) @id (selfLink) @id (selfLink)

Things that are different between OData and the SensorThings API

  • SelfLinks: @iot.selfLink == @id
    These IDs in OData can be Dereferenceable, but don't have to be. If they are this can be annotated with DereferenceableIDs. These IDs can follow OData standard URL patterns. If they do, this can be annotated with ConventionalIDs.
  • @iot.id is a normal field (usually id)
    The SensorThings API uses the name @iot.id for the primary key field. Even though this name starts with an @, this has no special meaning. The @ and . do confuse clients.
  • In OData the fields making up the Primary Key are simply fields. The CSDL lists the primary key fields of each entity type.
  • @iot.navigationLink == @navigationLink
    The semantics are the same.
  • Non-existing entity -> 204 No Content instead of 404 Not Found.

Things that STA has that can not easily be mapped to OData:

  • Type ANY doesn't exist in OData 4.0
  • No TimeInterval or TimeValue, only Edm.DateTimeOffset. This is an issue for Observation/phenomenonTime, Observation/validTime, Datastream/phenomenonTime and Datastream/resultTime. One solution would be to just use Edm.String, but this doesn't help clients. A better solution is to turn the interval into a complex property with an intervalProperty/start and intervalProperty/end in the OData interface.

Things that are missing from the SensorThings API