opengeospatial / ets-wfs20

Executable Test Suite for WFS 2.0
Other
9 stars 11 forks source link

NullPointerExceptions for several WFS tests #199

Closed JohannaOtt closed 2 years ago

JohannaOtt commented 3 years ago

When validating this WFS with the WFS test class, I get multiple NullPointerExpections, e.g. for Temporal Filter grafik

This is the validation log: s0003.zip

I originally reported this issue in the INSPIRE Validator GitHub repository, because I got validation error messages from the INSPIRE Validator that I did not understand. The assumption there is that the issue results from the Team Engine Validator, which actually seems to be the case as it is returning NullPointerExcpetions for this test case.

Could you please check why there are NullPointerExceptions and if they actually hint to validation issues or if it is an issue in the Team Engine Validator itself?

dstenger commented 3 years ago

Thank you for reporting.

As this issue is related to the WFS 2.0 test suite, I transferred it to the corresponding issue tracker.

dstenger commented 3 years ago

Can you please re-run the test on the OGC CITE Beta environment (https://cite.opengeospatial.org/te2/)? Your problem should be fixed there. The version currently installed on Beta environment will most likely be moved to Production environment this summer.

JohannaOtt commented 3 years ago

@dstenger Thank you for the hint. The behavior is different but still not right in my opinion. The tests fail with these messages grafik

The same occurred in the INSPIRE Validator. I don't think they are correct. The data values provided in the data are correct.

lgoltz commented 3 years ago

The WFS provides two feature types: SpatialPlan and OfficialDocumentation. The feature type OfficialDocumentation has no temporal property, so it is fine that these tests are skipped. The feature type SpatialPlan has the property validFrom. The service provides exactly one feature with the following value:

<plu:validFrom>2012-04-04</plu:validFrom>

The "after Instant" test request all features after 2012-04-04T11:39:59.999Z.

<wfs:GetFeature xmlns:wfs="http://www.opengis.net/wfs/2.0" count="10" service="WFS" version="2.0.0">
  <wfs:Query
          typeNames="ns5:SpatialPlan">
    <fes:Filter xmlns:fes="http://www.opengis.net/fes/2.0">
      <fes:After>
        <fes:ValueReference xmlns:tns="http://inspire.ec.europa.eu/schemas/plu/4.0">tns:validFrom</fes:ValueReference>
        <gml:TimeInstant xmlns:gml="http://www.opengis.net/gml/3.2" frame="http://www.iso.org/iso/iso8601" gml:id="T01">
          <gml:timePosition>2012-04-04T11:39:59.999Z</gml:timePosition>
        </gml:TimeInstant>
      </fes:After>
    </fes:Filter>
  </wfs:Query>
</wfs:GetFeature>

The result is an empty feature collection.

dstenger commented 3 years ago

@JohannaOtt The tests are not failing but they are skipped because the target feature type does not have temporal properties. Please check the analysis of @lgoltz: https://github.com/opengeospatial/ets-wfs20/issues/199#issuecomment-832426466 Does this clarify your question?

JohannaOtt commented 3 years ago

I do understand they are skipped for the types that do not contain temporal properties.

I do not understand why the empty feature collection is assessed being an error if there are no features after the one the request uses grafik

In my opinion, the data is not wrong, so the test should not fail. But maybe I misunderstood the analysis and the data acutally is wrong?

dstenger commented 3 years ago

I agree that in your special case (one feature) the test suite might be improved. We will do further investigation.

dstenger commented 3 years ago

Findings of analysis:

Test suite is sending following request: https://geodienste.komm.one/ows/services/org.506.78427a5b-2f82-4311-ba7d-74eb7b8c10f4_wfs/org.506.e21f771b-0d06-4dbc-b246-60aa8d12ed52?service=WFS&version=2.0.0&request=GetFeature&count=10&typenames=ns58:SpatialPlan&namespaces=xmlns(xml,http://www.w3.org/XML/1998/namespace),xmlns(ns58,http://inspire.ec.europa.eu/schemas/plu/4.0),xmlns(wfs,http://www.opengis.net/wfs/2.0)&filter=<fes:Filter xmlns:ns58="http://inspire.ec.europa.eu/schemas/plu/4.0" xmlns:wfs="http://www.opengis.net/wfs/2.0" xmlns:fes="http://www.opengis.net/fes/2.0"><fes:During><fes:ValueReference xmlns:tns="http://inspire.ec.europa.eu/schemas/plu/4.0">tns:validFrom</fes:ValueReference><gml:TimePeriod xmlns:gml="http://www.opengis.net/gml/3.2" frame="http://www.iso.org/iso/iso8601" gml:id="TP01"><gml:beginPosition>2012-04-04T03:00:00Z</gml:beginPosition><gml:endPosition>2012-04-05T04:59:59.999Z</gml:endPosition></gml:TimePeriod></fes:During></fes:Filter>

It returns an empty feature collection.

However, if the time window of beginPosition and endPosition is changed, a feature is returned. E.g.: <gml:beginPosition>2012-04-04</gml:beginPosition><gml:endPosition>2012-04-05</gml:endPosition>

So, it must be investigated how the ETS decides what beginPosition and endPosition are.

dstenger commented 3 years ago

Problem is probably related to the time zones where the service and TEAM Engine are located.

Possible solution: Time range generated by TEAM Engine is increased by adding one day to the endPosition and subtracting one day from the beginPosition. Solution will be checked by CITE TEAM.

robblis commented 2 years ago

Hi @dstenger

Wanted to add some more information that I'm still observing which was posted in issue #185 .

Testing the Direct WFS for the Sea Regions theme, I'm seeing generated in the "before Period" test the following GET request.

https://inspiredemo.esri.com/arcgis/rest/services/sr_test/MapServer/exts/InspireFeatureDownload/service?service=WFS&version=2.0.0&request=GetFeature&count=10&typenames=ns91:Sea&namespaces=xmlns(xml,http://www.w3.org/XML/1998/namespace),xmlns(ns91,http://inspire.ec.europa.eu/schemas/sr/4.0),xmlns(wfs,http://www.opengis.net/wfs/2.0)&filter=tns:beginLifespanVersion</fes:ValueReference>2017-07-12T17:40:00Z</gml:beginPosition>2017-07-12T18:20:00Z</gml:endPosition></gml:TimePeriod></fes:Before></fes:Filter>

If I remove the "Z" zulu reference in the DateTime value, the request returns a record.

https://inspiredemo.esri.com/arcgis/rest/services/sr_test/MapServer/exts/InspireFeatureDownload/service?service=WFS&version=2.0.0&request=GetFeature&count=10&typenames=ns91:Sea&namespaces=xmlns(xml,http://www.w3.org/XML/1998/namespace),xmlns(ns91,http://inspire.ec.europa.eu/schemas/sr/4.0),xmlns(wfs,http://www.opengis.net/wfs/2.0)&filter=tns:beginLifespanVersion</fes:ValueReference>2017-07-12T17:40:00</gml:beginPosition>2017-07-12T18:20:00</gml:endPosition></gml:TimePeriod></fes:Before></fes:Filter>

So it seems like the URL request generation from the validator is expecting all DateTime values to be in a Zulu format, which in our case, we can't do because the data for our services are in the local time zone of the server the service is running. on. I've attached the test log file.

Please let me know if you have any questions. We'll try to keep this service running so you can test.

Thanks, Robert

DirectWFS_Sea_Regions_s0036.zip