Skip to content
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

More flexible path structure under /collections #90

Closed
pvretano opened this issue Mar 19, 2018 · 16 comments
Closed

More flexible path structure under /collections #90

pvretano opened this issue Mar 19, 2018 · 16 comments
Assignees
Labels
OGC API: Common Issue related to general resources or requirements (see #190) Part 1: Core Issue related to Part 1 - Core progress: pull request available

Comments

@pvretano
Copy link
Contributor

Right now the core indicates that the the path to a collection of features is /collections/{name}. This path structure is a little rigid in some use cases such has organizing the collections into themes. A request was made to loosen up that structure a bit to allow things like /collections/path1/path2/{name} to accomodate additional organization structures on the feature collections. See issue #64 for additional discussion.

@lieberjosh
Copy link

lieberjosh commented Mar 19, 2018 via email

@pvretano
Copy link
Contributor Author

pvretano commented Mar 19, 2018

@lieberjosh, I think that approach is really nice but would most likely fall into the category of "extension" to the core. I was thinking of something simpler that could be done in the core and was suggested by @cholmes. The core would allow an arbitrary number of path elements between the /collections resource and the leaf collection resource. Doing a GET at any level gets you aggregate metadata about the immediate child levels below it. So, consider: themes. Doing a GET at any level gets you the aggregate metadata about the first child level. So 'GET /collections' gets you the metadata about 'Governmental Units', 'Hydrography' and 'Transportation'. Doing a 'GET /collections/Hydrography' gets you the metadata about each layer under the 'Hydrography' theme (i.e. 'Hydrographic Areas (1:24000)', 'HydrographicAreas (1:100000), etc.). This approach kinda mirrors how the WMS organizes layers.
To get the features themselves, you do a GET on the /collections/{path to leaf node}/items resource (e.g. GET /collections/Hydrography/Point Features/items).

@rcoup
Copy link

rcoup commented Mar 19, 2018

@pvretano so would the “name” be Hydrography/Point Features? Or just Point Features? (though would need to be globally unique). Or do we introduce an additional property for the Hydrography bit?

@jvanulde
Copy link
Contributor

@pvretano why wouldn't one just do a 'GET /Hydrography/Point Features/items'? I don't see a need for collections...

@lieberjosh
Copy link

lieberjosh commented Mar 19, 2018 via email

@rcoup
Copy link

rcoup commented Mar 19, 2018

@lieberjosh even if you had a theme concept you still need globally unique collection identifiers under /collections/? Which I guess tends for them to be {namespace}__{collection} (as Andrea implemented in #64 discussion) or something equivalent. Or servers just fallback to numeric/UUID identifiers.

(I like the theme concept in principle, especially as collections could conceivably fall into multiple themes)

@pvretano
Copy link
Contributor Author

pvretano commented Mar 20, 2018

@rcoup The {name} path element does not need to be unique but the complete resource URI does. So, "/collections/Hydrography/Point Feature" is a different resource than "/collections/Bob/Point Features". Underneath the covers, these URIs could point to the same Oracle table (for example) but such implementation details would be opaque to clients.

@jvanulde Joost, I am not tied to the existence of the "/collections" path element. I was just trying to extend the current paradigm (i.e. /collections is defined in core) slightly. I (... pointed out in issue #64 ) prefer a completely hypermedia driven approach where the server advertises the URIs of its collection resources in its landing page. (e.g. I mocked this approach up here: http://www.pvretano.com/cubewerx/cubeserv/default/wfs/3.0.0/foundation?f=json)

@pvretano
Copy link
Contributor Author

@lieberjosh Yeah, I am starting to think that it is best to keep the core simple and have a /themes extension as you described.
@rcoup I think that under Josh's approach, /collections would only be 1 level deep pointing directly to the service holdings. Any hierarchy would need to be described under /themes. @lieberjosh Josh, did I get that right?

@cmheazel
Copy link
Contributor

Observations and diatribe:

  1. Many of the users of these services will be analytics, no humans involved. So everything required to use the service must be formalized in the standard or be machine readable through an OpenAPI document.
  2. OpenAPI allows us to define a path using the Server Object. Server Objects provide a URL template and enumerations of the valid values for each variable in the template.
  3. Server Objects can be defined for the service as a whole, for a single path, or for a single operation.
  4. Server Objects do not provide a description of the purpose served by the variables in the template. Therefore, we need a URL construct with enough structure to convey those semantics. Consider a template which consists of path elements which are defined in the standard and implementation unique variables which lie between the standardized path elements. The standardized elements serve as delimiters. Variables between delimiters will have a well defined purpose (semantics). An analytic will "know" the purpose of the variables based on the known semantics of the bounding delimiters.
    example: https://{authority}/collections/{theme}/features/{name}
    collections - delimiter indicating the start of the collections path
    {theme} - optional theme path element(s)
    features - delimiter indicating the end of the theme path and start of the features
    {name} - feature names
    (NOTE: the enumerated list of valid values for {theme} also defines the thematic structure of the collection)
  5. One more wrinkle. There is no requirement that the {authority} of a path is the same as the authority of the OpenAPI document. Nor is there a restriction that a path can only be used by a single "service". A path is a microservice in it's own right. Paths are aggregated but not contained by the higher level service. Since a path may be accessed through more than one landing page or OpenAPI document, everything you need to know to use that Path should be captured in the Path Item Object.

@rcoup
Copy link

rcoup commented Mar 20, 2018

@cmheazel can you add an example?

So... {theme} here can be delimited? With /?

And in the collections response, you'd see something like this? (I guess your /features/ maps to /items/ in the spec?)

 "collections": [
    {
      "name": "some/theme/buildings",
      "title": "Buildings",
      "description": "Buildings in the city of Bonn.",
      "extent": {
        "bbox": [ 7.01, 50.63, 7.22, 50.78 ]
      },
      "links": [
        { "href": "http://data.example.org/collections/some/theme/buildings/items",
          "rel": "item", "type": "application/geo+json",
          "title": "Buildings" }
        { "href": "http://example.org/concepts/building.html",
          "rel": "describedBy", "type": "text/html",
          "title": "Feature catalogue for buildings" }
      ]
    }
  ]

@cmheazel
Copy link
Contributor

The capability I describe is in OpenAPI, not is the collections response. That being said, the same technique could be applied. I'll put together an example. However, I want to make sure it is right so it might take a little time.

@lieberjosh
Copy link

Yes: "under Josh's approach, /collections would only be 1 level deep pointing directly to the service holdings. Any hierarchy would need to be described under /themes."

@lieberjosh
Copy link

Re: "globally unique collection identifiers under /collections/"

The issue of identifiers vs locators is much larger than WFS. It is a well known problem, for example, that if you use a URL as a global identifier, i.e. URI, there isn't really an HTTP-native way of asserting that another URL is an equivalent URI. One way is to use a UUID-type of hash and incorporate that in whatever URL locates objects with that identity. It works, but it's awkward, obscure, and long.

Another approach is just to accept that a WFS service is not necessarily the authoritative identifier for a feature / feature collection / feature type. If there is, for example, a globally canonical URL for a feature collection which serves as its URI, the redirection to a specific WFS or other access point will have to be outside of that service. Working in the other direction, it would be useful to support global / authoritative URI's as standard (queryable) attributes (GML_ID or other) for resources of a particular WFS instance that are not necessarily the same as the access URL's for the service such as "https://wfs_service/collections/collection_name". Then one wouldn't necessarily get into recursive tangles of re-encoding URL paths with underscores and inserting them into -- URL paths.

It could well be a good practice, say under /themes, to replicate the path of the authoritative URI for a feature (collection) as part of the access URL. Then the feature with URI "https://authoritativeDN/usgs/hydro/huc8/catchment/520348" could be accessed as "https://wfs_service/themes/usgs/hydro/huc8/catchment/520348" providing a useful semantic hint to its identity. An id attribute of this feature would still include the former URI, however, for corroboration of the authoritative identity. The feature would also always be available under /collections in any way that is practically unique within the /collections domain, e.g. "collections/catchment/520348" or even "collections/usgs_hydro_huc8_catchment/520348" without requiring that any more globally unique identity be recorded within the URL.

I wouldn't say that the issues of identity vs access have been solved but these are a couple of ways that a WFS can at least be part of a larger solution.

@cportele cportele added the Part 1: Core Issue related to Part 1 - Core label Apr 6, 2018
@dr-shorthair
Copy link

Arriving late in this conversation.

A URI style issue: why plural 'collections' and not singular 'collection'? While it maybe makes sense for the initial request, for which the result is a list|set of collections, a longer URI with 'collections' in the path reads a bit strange. Suggest dropping the 's'.

@cportele cportele added this to the Part 1, Second Draft Release milestone Aug 8, 2018
@cportele cportele added the OGC API: Common Issue related to general resources or requirements (see #190) label Mar 5, 2019
@cportele
Copy link
Member

15-APR-2019 Teleconference: Keep the simple, reliable /collections/{collectionId} path structure. This should always be available. In addition, extensions may specify deeper, alternate collection hierarchies (see the /themes discussion or the discussion in Testbed-14 ER, http://docs.opengeospatial.org/per/18-045.html#hierarchical_paths_extension, as examples). Clemens will review the wording that there is no contradiction and then close the issue.

@cportele
Copy link
Member

resolved by #208

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
OGC API: Common Issue related to general resources or requirements (see #190) Part 1: Core Issue related to Part 1 - Core progress: pull request available
Projects
Development

No branches or pull requests

7 participants