-
Notifications
You must be signed in to change notification settings - Fork 85
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
Add link template for Feature resources to the Collection #742
Comments
Happy to see this being raised again as I had raised the same issue identified during compliance testing with the ETS.
{
"rel" : "item",
"type" : "application/geo+json",
"title" : "ne_10m_admin_0_countries (individual feature as GeoJSON)",
"href" : "/ogcapi/collections/NaturalEarth:cultural:ne_10m_admin_0_countries/items/{featureId}.json",
"templated" : true
}, Note that in OGC API - Tiles we used |
Thanks for the reminder, I now remember that we agreed to use It is still important to understand that this link template would be just for client convenience. The URI in |
@cportele Yes, I understand that Features specifies (req 32) a fixed path of Yes, it is for client convenience, but convenience in the context of consistency with the overall OGC API approach of supporting both "follow the links" and "API definition" ways of discovering path resources. There was no way to get to individual items following links. "Fixed paths" really is yet a third approach for client to know where to access resources, that is required for some OGC API resources (most of them except for the location of the API definition in Features). In other specifications, other resources are not required at a fixed path (e.g., the tiles and tilesets resources in OGC API - Tiles could be anywhere, even hosted on a separate server like cheap cloud object storage -- therefore clients need to either follow links, or recognize operationID prefixes in the OpenAPI definition if the service implements Tiles/OAS30 conformance class). Unlike the other two approaches which can be discovered organically, the only way to learn about "Fixed paths" is by reading the specification. One cannot know from looking at one API implementation/deployment that the same path will work with other implementations/deployments. |
@jerstlouis - I agree that it would be good to add the link template, but the "two approaches" are this:
Links (and link templates) are important in general since these are Web APIs and linking is fundamental in the architecture of the web. But that clients will use the links is only one aspect how the first approach can be supported. To use fixed paths for the resources in Features (except for the API definition) was a conscious design decision to make APIs more predictable for client developers and I still think it was the right decision. For the API definition or for the Tile resources it does make sense to allow more flexibility because of the existing ways that API definitions or tilesets are already published on the web. |
I don't disagree.
It seems that this might have been absorbed and slightly metamorphosed into different flavors of two approaches e.g., Tiles says this:
Same two approaches in our Quickstart Guide for Clients (Follow the links and API approach) Regarding:
I think that first approach mentioned in Features is closest to that third approach in Tiles. But because several OGC API resources do not have a fixed path, I think in practice follow the link is really what clients need to implement in several places, so being able to consistently use that approach to get to every resource is really a good idea to avoid surprising client developers who come to expect this. This is also well illustrated by Joan's nice API exploration graphs. |
Meeting 2022-09-12: This issue is related to part 1 and should be addressed there (with a recommendation for now). @cportele will create a PR. |
Raised by @IvanSanchez in the July 2022 Code Sprint while developing a client for Part 4:
The feature URIs are unambiguously specified in Part 1, but it would be good for clients to have an explicit link template for the Feature resources in the Collection resource. This is in particular relevant for Part 4 where clients frequently interact with individual features. So something like:
Note that "varBase" is inspired by the Link Template ID and the value implies that there is a register in the OGC definition server for such variables. In this case
featureId
would be described athttps://www.opengis.net/def/vars/ogc/0/featureId
.With regard to the link relation type, since it is a template and not a proper link, it should not be "item", but something else?
The text was updated successfully, but these errors were encountered: