OGC-IoT / ogc-iot-api

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

symbols in properties names #32

Closed Yannick183 closed 8 years ago

Yannick183 commented 8 years ago

Hi,

I would like to know what purpose serves the '@' and '.' symbols in the json properties names. I thought at first glance that it may be Json-LD but it isn't. Are those really required ? Don't you think it may make parsing more painful since it is very uncommon to encounter such special chars in json properties ?

liangsteve commented 8 years ago

Thanks for asking. @ and . are used for control information.

@ is very important for pagination for example. Take the following request as an example:

http://example.org/v1.0/Datastreams?$expand=Observations

Let's assume the number of Datastreams and Observations are higher than the service-driven pagination limit, so the service will only return a limited number of results back (i.e., service-driven pagination imposed). In this case, @ is needed in order for a client to know which link for which entity's nextLink. In the above example, in the JSON response, there will be two nextLink:

Without @, a client cannot differentiate which nextLink is for Datastreams and which one is for Observations.

Regarding ., it is a prefix to differentiate SensorThings from OData. OData has a prefix of odata.