helpdesk-validator icon indicating copy to clipboard operation
helpdesk-validator copied to clipboard

Requirement for self-reference link in Atom feed is too strict

Open ejn opened this issue 2 years ago • 4 comments

According to RFC4287, the URI reported by <link rel="self" "is the preferred URI for retrieving Atom Feed Documents representing this Atom feed" (my emphasis). This implies that the same feed may be available at alternative URIs, but that the canonical URI is the one reported in <link rel="self".

The abstract test description for INSPIRE Atom feeds interprets this as "the self link must be the same as the Download Service feed URI" (note not "the URI from which the Download Service was retrieved").

The concrete implementation in the validator however obviously requires that the canonical URL is used for retrieving the feed otherwise an error "The Atom feed does NOT contain a link to itself that equals the URL of the requested resource. Check the element /atom:feed/atom:link with @rel='self' and the the request URL." is reported.

Note that the TG also requires (Section 5.1.8) regarding the feed id element that:

An identifier shall be provided for the feed as a whole. This identifier shall be the same HTTP URI that was used for the ‘self’ reference and shall therefore also dereference to the feed itself. (In the Atom standard it is not required that the ‘id’ matches the ‘self’ reference but since this Download TG requires the use of HTTP URIs to identify feeds they are the same as a consequence).

From this Requirement 9 (and also Requirement 22) is derived: "The ‘id’ element of a feed shall contain an HTTP URI which dereferences to the feed".

This implies very clearly that the requirement for <link rel="self" is also that it contains a HTTP URI which dereferences to the feed itself, not that it is necessarily the URI from which the feed is retrieved, as its contents shall be the same as the id element.

I think that the abstract test description for the self-reference link should be corrected to match the abstract test description for the id element, and the implementation updated accordingly.

Please note that there also appears to be a technical problem in the implementation of this test within the validator: Starting the test with the canonical URL https://www.geodaten-mv.de/dienste/verkehrsnetz_lsbv_inspire_atom?id=17a14b95-94a7-1213-e2a1-pa2424ga2b12&type=service then the request is made to the non-canonical (but in this case still functional) URL https://www.geodaten-mv.de/dienste/verkehrsnetz_lsbv_inspire_atom (see report, which however reports the canonical URL in the self-link and therefore fails this test. Perhaps query parameters are not expected in the URL for an Atom feed (although these are of course valid, and may in many cases be required)?

ejn avatar Aug 20 '21 09:08 ejn