opengeospatial / ets-wfs20

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

Is ImplementsSorting must be TRUE for WFS or INSPIRE download service? #250

Closed zguo closed 1 year ago

zguo commented 1 year ago

Dear All,

We recently run ogc validation for an INSPIRE download services (the service url is at https://agsinspire1.esri.com/arcgis/rest/services/gn_spain2/MapServer/exts/InspireFeatureDownload/service?VERSION=2.0.0&SERVICE=wfs&REQUEST=getcapabilities)

The OGC test engine reports the following error:

OGC TEAM Engine reported a failed test: 1 schema validation error(s) detected.
 # Constraints on WFS 2.0 service descriptions.

_____
Severity: Error  
Message: The filter constraint 'ImplementsSorting' must be 'TRUE' for all conforming Basic WFS implementations.  
Test: fes:Constraint[@name='ImplementsSorting']/ows:DefaultValue = 'TRUE'  
Location: /*:WFS_Capabilities[namespace-uri()='http://www.opengis.net/wfs/2.0'][1]/*:Filter_Capabilities[namespace-uri()='http://www.opengis.net/fes/2.0'][1]/*:Conformance[namespace-uri()='http://www.opengis.net/fes/2.0'][1]  
 expected [false] but found [true]

Currently we have set ImplementsSorting to be FALSE in the capabilities, similar to examples given within the WFS specification, INSPIRE example is false as well at https://github.com/inspire-eu-validation/ets-repository/blob/3ed17ef069b758420063fadb9c6872e4ff26dfa9/schemas/inspire_dls/1.0/examples/WFS20_Caps_Scenario2_long.xml

It seems per the OGC specification it is optional, below is in the 7.9.2 of the spec (url is at http://docs.opengeospatial.org/is/09-025r2/09-025r2.html#172).

7.9.2 Ad hoc query expression 7.9.2.1 Request Semantics An ad hoc query expression may be used in a GetPropertyValue (see Clause 10), GetFeature (see Clause 11), GetFeatureWithLock (see Clause 13) or LockFeature (see Clause 12) operation to identify the set of features to be operated upon. As shown in Figure 8, an ad hoc query expression contains a typeNames parameter, projection clause, a selection clause and a sorting clause. The mandatory typeNames parameter lists the name of one or more feature types to query. The optional projection clause identifies a subset of optional feature properties that shall be presented in the result set. The projection clause for XML-encoded ad hoc query expressions may also be used to control, on a per-property basis, how resource references (see 7.6.4) are resolved in the response document. NOTE How resource references are resolved in a response document can only be controlled at the operation level for KVP-encoded requests. This is accomplished using the RESOLVE, RESOLVEDEPTH and RESOLVETIMEOUT keywords (see 7.6.4.3). This is in contrast to XML-encoded requests where resource resolution can be controlled at the operation and property levels. The optional selection clause specifies criteria that conditionally select features from a server’s data store. The optional sorting clause specifies how the features in the response document should be ordered. An ad hoc query also allows a CRS to be asserted and used when presenting feature geometries in a response document.

I am not that familiar with this parameter, and have raised the same issue on the INSPIRE forum at https://github.com/INSPIRE-MIF/helpdesk-validator/issues/897, they suggest me to post here.

If someone can clarify/confirm whether ImplementsSorting is required to be "TRUE" by the specification, and whether the ogc test would not report it as an error when this parameter is set to FALSE, it would be great.

Thanks,

ZhongPing

dstenger commented 1 year ago

Thank you for reporting.

This requirement derives from chapter A.2.22.3 Sorting clause of the abstract test suite (see specification). The abstract tests are part of the Basic WFS conformance class.

The requirement is implemented via schematron in the test suite:

https://github.com/opengeospatial/ets-wfs20/blob/457bed2834d903d31153ea68423b2bb53ce6e84e/src/main/resources/org/opengis/cite/iso19142/sch/wfs-capabilities-2.0.sch#L162-L164

Please note that the Basic WFS conformance class is not mandatory as a WFS can also just be compliant to Simple WFS conformance class.

Thus, it is correct that test describes Basic WFS of the Basic WFS conformance class contains a check for the optional sorting clause.

zguo commented 1 year ago

Hi @dstenger,

Thanks for the clarification, that explains the seeming inconsistence between the spec and validation results.

dstenger commented 1 year ago

I propose to close this issue unless you have any further question @zguo.

ghobona commented 1 year ago

Unless we hear otherwise, we will close this issue on 2023-01-16.