Compatibility between OData and STA
hylkevds opened this issue · comments
Hylke van der Schaaf commented
At the last TC meeting I gave a little demo of using STA/OData in Excel.
Here are the differences I found so far:
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, cast to Edm.String | Edm.Untyped |
Time Interval/Value | phenomenonTime , validTime |
not supported, use phenomenonTime.start and phenomenonTime.end |
not supported, use phenomenonTime.start and phenomenonTime.end |
Non existing entities | 404 Not Found |
204 No Content |
204 No Content |
Things that STA has that can not easily be mapped to OData:
- Type ANY doesn't exist in OData 4.0. Version 4.01 has Edm.Untyped.
- 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 split the interval intointervalProperty.start
andintervalProperty.end
in the OData interface.
Our test endpoint, for people that would like to try it out:
- STA: https://ogc-demo.k8s.ilt-dmz.iosb.fraunhofer.de/v1.1/
- OData 4.0: https://ogc-demo.k8s.ilt-dmz.iosb.fraunhofer.de/ODATA_4.0/
- OData 4.01: https://ogc-demo.k8s.ilt-dmz.iosb.fraunhofer.de/ODATA_4.01/
It's the same server instance, so the database in these three endpoints is the same.
Related to #72
Also in the FROST wiki.
Hylke van der Schaaf commented
Some more progress:
- The ANY result type can be forced to Edm.String, since everything can be displayed as a String. This makes Excel content.
- Times that are a TimeInterval can be mapped to a custom type with start and end (both mandatory):
"TimeInterval": { "$Kind": "ComplexType", "@Core.Description": "An ISO time interval.", "start": { "$Type": "Edm.DateTimeOffset" }, "end": { "$Type": "Edm.DateTimeOffset" } }
- Times that are a TimeObject (Interval or Instant) can be mapped to a custom type with start and optional end:
"TimeValue": { "$Kind": "ComplexType", "@Core.Description": "An ISO time instant or time interval.", "start": { "$Type": "Edm.DateTimeOffset" }, "end": { "$Type": "Edm.DateTimeOffset", "$Nullable": true } },