-
Notifications
You must be signed in to change notification settings - Fork 74
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 (usuallyid
)
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 of404 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 forObservation/phenomenonTime
,Observation/validTime
,Datastream/phenomenonTime
andDatastream/resultTime
. One solution would be to just useEdm.String
, but this doesn't help clients. A better solution is to turn the interval into a complex property with anintervalProperty/start
andintervalProperty/end
in the OData interface.
Things that are missing from the SensorThings API
- Metadata document
-
@context
in every json response, linking to the $metadata document. -
metadata=none|minimal|full
: Controlling the Amount of Control Information in Responses - Multi-field primary keys (ids)
- Removing references: AddressingReferencesbetweenEntities RemoveaReferencetoanEntity
- Deep Updates: OData4.01 Patch can add and remove links and even create new entities (like POST can)