-
-
Notifications
You must be signed in to change notification settings - Fork 265
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
py conventions for trailing slash management #97
Comments
@pvgenuchten think this can be closed as indicated above. you can try on http://geo.kralidis.ca/pygeoapi which runs current master branch. |
i want to reopen this issue, because we seem to be incompatible with stac i'm not aware if common/features/records has any recommendation on trainling slash stac seems to require a trailing slash, https://github.com/radiantearth/stac-spec/blob/e8c409513fb46685556c2e340d06deaf5d4c7084/best-practices.md#consistent-uris our behaviour: |
chat with Clemens Portele on discord:
|
As per RFC4, this Issue has been inactive for 90 days. In order to manage maintenance burden, it will be automatically closed in 7 days. |
As per RFC4, this Issue has been closed due to there being no activity for more than 90 days. |
@pvgenuchten, @webb-ben, @tomkralidis -- I feel I may have stumbled into a hornets nest? radiantearth/stac-browser#486 (comment) Is there any way around this issue that will satisfy both OGC-API and STAC or is the issue of trailing slashes a point of divergence and incompatibility? |
I guess the second:
a way forward could be to introduce a trailing slash setting in config |
Wrong guess. There should not be any divergence and incompatibility. Resolving relative URIs is well-defined. Either an implementation is following RFC 3986 (see chapter 5) or not. STAC and OGC APIs must follow RFC 3986, otherweise they are pretty much unusable because the URIs are ambiguous and can't be resolved properly. A trailing slash is not required, but depending on whether a trailing slash is provided in the base URL, the relative URLs must be provided differently. See some examples here: https://github.com/radiantearth/stac-spec/blob/master/best-practices.md#consistent-uris (and although this is in the STAC specification, this is generally applicable and not STAC specific at all.) |
I'll admit I don't know STAC exactly, but the consistent-uri guidance underscores the issue: OGC-API Features (and Common) |
Not sure how to interpret a thumbs down... but I think it is worth being clear here and teasing this apart more than that. It seems that there are two interpretations of how OGC-API links should be constructed from a geojson feature collection. On one hand, the On the other hand, the This is why I was asking about the use of the OGC-API Common "conformance" document. Since stac-browser is querying for conformance information, it should know that some servers that do not return an indication of STAC conformance but do indicate that they adhere to OGC-API Features will likely adhere to the latter interpretation of how geojson Am I off base here? I'm concerned that we are pushing the IETF URL construction standard into a place that it is not intended to apply. |
I would suggest we bring this up at OGC API - Common or Features as a next step. |
Scanning issues -- this one pops up. opengeospatial/ogcapi-features#918 This? opengeospatial/ogcapi-features#742 Also this. opengeospatial/ogcapi-features#139 Any others that folks see that may have discussed this issue previously? |
I feel like there's a mixup of various things as the discussion is around resources, files, Features, feature IDs and trailing slashes in self links etc, which is all irrelevant, I think. It should just be about how to resolve a relative link against a base URL. How that's done is described in RFC3896. It's pretty simple. Let say you have a Feature at https://example.com/collections/123/items/321 and you want to have a link from the collection 123 to that feature, using a self-links and a relative link. You have two options (you can omit the
That are your options. No one cares whether you do 1 or 2, as long as it complies to RFC 3986. Important: For this example, self url: I'm actually not sure what to discuss here. Follow the RFC or accept that your API can't be properly handled by clients because the URL resolving is ambiguous/invalid. 🤷♂️ |
The discussion is that the convention we are using (OGC-API Features) doesn't actually say that there should be a relative URL encoded in hypermedia from The url template: So for example, we look here:
Notice that the links in the Notice that if we give the example collection of lakes to stac-browser we do get tiles for each lake. But if we click a link, the geojson id (not a relative url) is put into a url that drops the collection id in @webb-ben made a modification to https://reference.geoconnex.us/ which adds a trailing slash to urls such as:
Which does get stac-browser to template the url as would be expected. But I still feel like we are pushing RFC3986 rules into an area (geojson IDs) where it shouldn't necessarily be thought to apply dogmatically. Am I just missing where a relative URL actually exists in these documents? I feel like I'm just not seeing something here. |
Aha! That makes a lot of sense and was never clear to me. But I think in your original examples there were relative links?! Can't find them anymore, but anyway: STAC is all about hypermedia, there should be no "URL construction by knowing the API" or so, just a fallback mechanism to care for some invalid APIs, which ideally I actually should remove from STAC Browser to encourage valid implementations. Also note, there's no official support for OGC API - Features/Records in STAC Browser. If someone wants to fund that long-term (i.e. implementation and maintenance), I'm happy to talk. |
I noticed sometimes users arrive in collections/obs/items and sometimes at collections/obs/items/. Both url's provide a valid answer however browsers treat both url's different when linking relatively. From these locations a '..' link will guide users to /collections in case 1 and to /collections/obs in case 2
Some 'solutions'
The text was updated successfully, but these errors were encountered: