INSPIRE-MIF / helpdesk-validator

Community discussion forum for INSPIRE validation issues
42 stars 23 forks source link

Application schema conformance class tests (here: Planned Land Use) not accepting feature GML #534

Open gdmhrogut opened 3 years ago

gdmhrogut commented 3 years ago

Dear INSPIRE validator team,

today I wanted to validate a feature of one of our INSPIRE download services against its application schema Planned Land Use. Thus I started a test within the INSPIRE validator (i.e. https://inspire.ec.europa.eu/validator/) using test class Conformance class: Application schema, Planned Land Use. As data source, I chose Remote file (URL) and pasted the following link in the corresponding input field:

https://geo.sv.rostock.de/inspire/plu-bylaws/download/SpatialPlan_2f86deae-c744-4a39-b4a9-151a76fa2f44

Then, I clicked start and the following error message showed up:

Test Run initialization failure The test object type could not be determined. Check the uploaded / referenced resource. Uploaded files may only contain test data and no other files. If the problem persists, please contact the ETF system administrator of the server.

I also made a screenshot of the error message:

screenshot-error

Of course I also tried file upload as data source, uploading the feature linked above as a GML file, but that led to exactly the same error.

The browsers I used:

Thank you very much for your help and with kindest regards

Sebastian Gutzeit

carlospzurita commented 3 years ago

Dear @kvlahrogut

This issue is related to the way Test Objects are detected in the validator, based on the Content-Type of the response and in regex over the URL. We are taking a look if this endpoint is complying with the detection rules and if we should apply any modification on the validator software.

Kind regards.

gdmhrogut commented 3 years ago

Dear @carlospzurita,

thank you very much! Very curious about the outcome of your analyses…

With kindest regards

Sebastian

iuriemaxim commented 3 years ago

Besides the fact that the file does not have an .xml or .gml termination in order to indicate that is a GML file according to the provisions of IANA organisation (https://www.iana.org/assignments/media-types/application/gml+xml), I am almost sure that the header of the XML file is not correct.

image

According to TGs, the datasets should be provided trough services, such as for example ATOM, WFS, WCS, SOS etc.

As in the header there are references to a WFS service, the header should start with <wfs:FeatureCollection ... followed by ...

and by
iuriemaxim commented 3 years ago

@kvlahrogut Here you can download your file (zip compressed) with corrected header + first and last lines: SpatialPlan.zip

The INSPIRE Validator is not currently able to indicate that the header of the GML file is wrong, neither to indicate that the file is not ending with .xml or .gml as it should be. The Validator is just trying to analyse the content of the file, but it fails to do it because of the wrong header and due to the fact that the first and last lines are not correct at all.

The tests results are here: https://inspire.ec.europa.eu/validator/v2/TestRuns/EID14d54c1b-eeca-4f8b-96a3-5e39f34d308d.html

image

Hope it helps.

iuriemaxim commented 3 years ago

@carlospzurita Maybe it is time to add a validation to check the header of the XML files in order to indicate to the users that the header is wrong. If the user is uploading a file that does not have an .xml or .gml termination, the INSPIRE Validator could also trigger an error, isnt't it?

gdmhrogut commented 3 years ago

Dear @iuriemaxim,

thank you very much for your help and advices! And sorry that it took me so long to answer...

Well, I would not say that https://geo.sv.rostock.de/inspire/plu-bylaws/download/SpatialPlan_2f86deae-c744-4a39-b4a9-151a76fa2f44 is not correct in terms of its header. Why? Because it is a single GML feature/object directly accessed by its gml:identifier (which is the URI https://geo.sv.rostock.de/inspire/plu-bylaws/download/SpatialPlan_2f86deae-c744-4a39-b4a9-151a76fa2f44). So you do not need and you do not expect a WFS-like root element here (like <wfs:FeatureCollection).

But since we are providing all of our INSPIRE data through WFS and thanks to your hints, @iuriemaxim, I can now use the application schema conformance class tests within the INSPIRE validator. For example, ...

https://geo.sv.rostock.de/inspire/plu-bylaws/download?service=WFS&version=2.0.0&request=GetFeature&typenames=plu:SpatialPlan&count=1

... leads to this result:

https://inspire.ec.europa.eu/validator/v2/TestRuns/EID1d56d3a5-908b-4b2d-addf-0d056a3e4f09.html

Nevertheless, shouldn't the INSPIRE validator accept files/URIs with pure GML and thus without a WFS-like root element like <wfs:FeatureCollection as well as files/URIs with a WFS-like root element like <wfs:FeatureCollection? Maybe you can evaluate that, @carlospzurita.

iuriemaxim commented 3 years ago

Dear @kvlahrogut my suposition that the file is incorrect related to the header was based on two things:

  • There is any XML validator that validates the file? If not, what error is provided? If yes, which one?
  • The header contains information in relation to WFS and if maintained in the header, then my understanding is that the file should be valid against the WFS 2.0.0 standard (https://www.ogc.org/standards/wfs). Alternatively the information related to WFS could be removed from the header.
  • If features are served, it means that most probably a download service exist. If a download service exist, than most probably it is a Network Service. If so, than it could be ATOM, WFS, SOS or WCS. Otherwise it is an SDS that is not a Network Service? Based on the information from the header it indicates a WFS (INSPIRE Network Service - Download Service).

Glad to help, Iurie

iuriemaxim commented 3 years ago

@kvlahrogut This is also a short-URL redirect to a single feature directly accessed based on its human readable identifier: https://inspire.meteoromania.ro/ids/EnvironmentalMonitoringFacility.15015

And the file looks like in the image below:

image

The response is encoded as specified by OGC (and INSPIRE), namely as application/gml+xml according to the provisions of IANA organisation (https://www.iana.org/assignments/media-types/application/gml+xml).

That's why the file is not opening directly in the browser, but is downloaded, as browsers do not know (yet) how to deal with MIME type application/gml+xml.

image

Hope it helps, Iurie