opengeospatial / ets-wfs20

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

Unexpected error messages on nil attribute #223

Closed JohannaOtt closed 2 years ago

JohannaOtt commented 2 years ago

Describe the bug When validating this WFS I get an error concerning CEMTClass that I cannot understand when looking at the data: Unexpected result evaluating XPath expression with context node tn-w:CEMTClass: ns1:validFrom[@xsi:nil='true'] expected [true] but found [false] This is an excerpt of the data with all CEMTClass objects contained CEMTClass.zip

To Reproduce Validate the WFS linked above with the WFS test.

Expected behavior I would not expect an error but maybe I am misinterpreting the test

Screenshots grafik grafik

Additional context This is a follow up ticket from https://github.com/opengeospatial/ets-wfs20/issues/206

dstenger commented 2 years ago

Thank you for reporting.

Analyse failure

I was able to reproduce this behavior on Beta environment.

I used following test request:

It seems that following line is set correctly for each member: <tn:validFrom nilReason="other:unpopulated" xsi:nil="true"/>

Thus, I also do not see why this test fails. Also, it works for all other feature types.

dstenger commented 2 years ago

After doing some debugging, I was able to find the root cause of the test failure.

Again, as in #206, the duplicate usage of tn-w:CEMTClass is the reason. Excerpt of response of previously documented request:

<?xml version='1.0' encoding='UTF-8'?>
<wfs:FeatureCollection xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs/2.0 http://schemas.opengis.net/wfs/2.0/wfs.xsd http://www.opengis.net/gml/3.2 http://schemas.opengis.net/gml/3.2.1/gml.xsd http://inspire.ec.europa.eu/schemas/tn-w/4.0 https://haleconnect.com/ows/services/org.292.6cef2128-a227-4aa7-bc74-0e3797644d51_wfs?SERVICE=WFS&amp;VERSION=2.0.0&amp;REQUEST=DescribeFeatureType&amp;OUTPUTFORMAT=application%2Fgml%2Bxml%3B+version%3D3.2&amp;TYPENAME=tn-w:CEMTClass&amp;NAMESPACES=xmlns(tn-w,http%3A%2F%2Finspire.ec.europa.eu%2Fschemas%2Ftn-w%2F4.0)" xmlns:wfs="http://www.opengis.net/wfs/2.0" timeStamp="2022-02-08T19:47:21Z" xmlns:gss="http://www.isotc211.org/2005/gss" xmlns:gn="http://inspire.ec.europa.eu/schemas/gn/4.0" xmlns:gsr="http://www.isotc211.org/2005/gsr" xmlns:gts="http://www.isotc211.org/2005/gts" xmlns:ogc="http://www.opengis.net/ogc" xmlns:tn-w="http://inspire.ec.europa.eu/schemas/tn-w/4.0" xmlns:gco="http://www.isotc211.org/2005/gco" xmlns:tn="http://inspire.ec.europa.eu/schemas/tn/4.0" xmlns:net="http://inspire.ec.europa.eu/schemas/net/4.0" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:gml="http://www.opengis.net/gml/3.2" numberMatched="unknown" numberReturned="0">
  <!--NOTE: numberReturned attribute should be 'unknown' as well, but this would not validate against the current version of the WFS 2.0 schema (change upcoming). See change request (CR 144): https://portal.opengeospatial.org/files?artifact_id=43925.-->
  <wfs:member>
    <tn-w:CEMTClass gml:id="INSPIRE.CEMTClass.I">
      <gml:identifier codeSpace="http://inspire.ec.europa.eu/ids">http://www.rws.nl/tn-w/INSPIRE.CEMTClass.I</gml:identifier>
      <gml:name>CEMT-class I</gml:name>
...
      <net:beginLifespanVersion nilReason="other:unpopulated" xsi:nil="true"/>
      <tn:validFrom nilReason="other:unpopulated" xsi:nil="true"/>
      <tn-w:CEMTClass>I</tn-w:CEMTClass>
    </tn-w:CEMTClass>
  </wfs:member>
...

As tn-w:CEMTClass is the member itself and a property of the member, the test suite interprets the property as a feature as well and runs into a test failure.

Relevant lines of code which retrieve the property as feature: https://github.com/opengeospatial/ets-wfs20/blob/6a6cfc2d4d1fa2bde4b0376cf307edb2ea49a564/src/main/java/org/opengis/cite/iso19142/basic/filter/PropertyIsNilOperatorTests.java#L81-L82

We already concluded in #206 that this is schema valid and thus a fix must be implemented in the test suite.