opengeospatial / ets-sta10

Repository for the Executable Test Suite for OGC Sensor Things API
Other
6 stars 8 forks source link

Two additional Generated FoI tests #34

Closed hylkevds closed 7 years ago

hylkevds commented 7 years ago
taniakhalafbeigi commented 7 years ago

This test is not part of conformance test suite as of Annex A in the specification of OGC SensorThings API.

hylkevds commented 7 years ago

Yes it is part of the conformance test suit as of Annex A:

Create an Observation entity for a Datastream without any Observations and the Observation creation request does not create a new or linking to an existing FeatureOfInterest, check if the service creates a new FeatureOfInterest for the created Observation with the location property of the Thing’s Location entity.

This also has to work for a Thing that has moved, since it no longer has a Location with an auto-generated Feature of Interest.

Create an Observation entity for a Datastream that already has Observations and the Observation creation request does not create a new or linking to an existing FeatureOfInterest, check if the service automatically links the newly created Observation with an existing FeatureOfInterest whose location property is from the Thing’s Location entity.

If two things share the same location and an auto-generated FoI was generated for that Location then all Observations without a FoI should get this auto-generated FoI, even if they are in different Datastreams/Things. The requirement does not specify that it should only work for the same Datastream/Thing.

taniakhalafbeigi commented 7 years ago

The two tests from the spec you mentioned are already in the test. For the case Thing is moved, you can add it to your system test, but it is not part of Conformance test suit due to spec. And in the spec it is not mandatory that "if the two Things share a Location, they should share FeatureOfInterest", because there is no constraint of not having redundant FeaturesOfInterest, it could be a design decision.

hylkevds commented 7 years ago

Actually, the spec forbids generation of duplicate FoIs:

In this case, when a client creates an Observation entity, the client SHOULD omit the link to a FeatureOfInterest entity in the POST body message and SHOULD not create a related FeatureOfInterest entity with deep insert. And if the service detects that there is no link to a FeatureOfInterest entity in the POST body message that creates an Observation entity, the service SHALL either (1) create a FeatureOfInterest entity by using the location property from the Location of the Thing entity when there is no FeatureOfInterest whose location property is from the Location of the Thing entity or (2) link to the FeatureOfInterest whose location property is from the Location of the Thing entity.