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

Lack of DescribeFeatureType request #56

Closed
rouault opened this issue Mar 5, 2018 · 18 comments
Closed

Lack of DescribeFeatureType request #56

rouault opened this issue Mar 5, 2018 · 18 comments

Comments

@rouault
Copy link
Contributor

rouault commented Mar 5, 2018

Part 1 Core doesn't have a DescribeFeatureType sort of request, which makes it a bit inconvenient for some client like GDAL/OGR that requires to know quite early the schema to be able to expose a layer/ feature collection. For full feature collection ingestion, one can potentially download the whole response and analyze it afterwards to discover the schema. But for filtering based on properties, this wouldn't be an appropriate behaviour.

One way of implementing DescribeFeatureType would be to extend the feature collection metadata. Or in the OpenAPI description, instead of refering to the standard GeoJSON FeatureCollection to refer instead fo a derived FeatureCollection that describes the properties (although that solution would require to have a description for each encoding format, and that probably only works for json-based encodings)

@cportele
Copy link
Member

cportele commented Mar 6, 2018

Actually, this is by design. There is no requirement to have an application schema or even feature types in the Core. Since the Core does not support filtering in CQL or similar, the API should be usable without an application schema. In extensions this will clearly change, both because sometimes it is important for data providers or users to be explicit about the schema / support validation and to be able to formulate queries.

By the way, in a handcrafted OpenAPI 2.0 / Swagger variant for one of our demo services we have indeed specified the schema of the features in the OpenAPI definition: https://app.swaggerhub.com/apis/cportele/lika-nrw/0.0.1. In an OpenAPI. In an OpenAPI context this would seem to be the most "natural" approach to me, but it mostly works for JSON encoded data and less for data in XML or other encodings (see also #58).

@cportele
Copy link
Member

cportele commented Mar 6, 2018

@rouault We had a discussion here at the hackathon and basically identified three approaches for providing schema information:

  1. as part of the OpenAPI definition (see my example above)
  2. using links from the collection (see /rec/core/fc-md-descriptions)
  3. using a separate endpoint /schema under the collection (the Cubewerx server supports this)

They all have their role / advantages. The first one is easiest for users that do not know or care about WFS and "just" want to use an API. This also leverages the OpenAPI stack and tooling. The second one supports the hypermedia approach and one can determine the schema etc. when accessing and navigating through the information. The third option publishes the information about the schema resource already in the OpenAPI definition. Since all three have their use we want to "allow" all of them.

The first option has a lot of potential for new users, so we agreed that this has a priority for experimenting with it. Peter is looking into supporting it in his implementation.

@pvretano, @cholmes - does this capture the main points of our discussion?

@cholmes
Copy link
Member

cholmes commented Mar 6, 2018

Yup. And to emphasize the key point: Even should try to implement client support for 1., using https://app.swaggerhub.com/apis/cportele/lika-nrw/0.0.1 And @pvretano will post his implementation here when it's up.

Having that in GDAL client will likely make it a defacto recommendation, for those who write servers and test with GDAL. It'll be good to have GDAL to not have to rely on the schema, but it'd be great to code up the support for reading the schema.

@rouault
Copy link
Contributor Author

rouault commented Mar 6, 2018

@cholmes https://app.swaggerhub.com/apis/cportele/lika-nrw/0.0.1 is Swagger/OpenAPI 2.0 . It needs to be "ported" to the /api openapi 3.0 first as I'm not fluent enough in openapi to anticipate what it would look like. But yes that's certainly a reasonable option.

@cholmes
Copy link
Member

cholmes commented Mar 6, 2018

@rouault - gotcha. I talked to @cportele and he said he'd try to update it, but he's got a lot going on. Will update this ticket if it gets done.

@cportele
Copy link
Member

cportele commented Mar 6, 2018

@rouault - I have tried to compile an OpenAPI 3.0 version. I did not have much time to verify it, let me know, if you hit any issues.

https://raw.githubusercontent.com/opengeospatial/wfs3hackathon/master/openapi.json

@rouault
Copy link
Contributor Author

rouault commented Mar 7, 2018

@cportele Thanks I've just added support for it in the GDAL driver.
OGR_WFS3_API_URL=https://raw.githubusercontent.com/opengeospatial/wfs3hackathon/master/openapi.json ogrinfo WFS3:https://www.ldproxy.nrw.de/kataster flurstueck -al -q
(the OGR_WFS3_API_URL is a hack to use an alternate URL for the /api endpoint)

I'm thinking that the geometry type could also be advertized by specializing the following and indicating which type(s) are possible

          "geometry": {
            "$ref": "#/components/schemas/geometryGeoJSON"
          },

@aaime
Copy link
Contributor

aaime commented Mar 7, 2018

I'm a bit worried about the size of the resulting API document, installations with thousands of layers are not uncommon (the uncommon ones have hundred of thousands of layers), the API document already has a fair amount of redundancy, if all the schemas are also added in it, it will become really large...

@cportele
Copy link
Member

cportele commented Mar 7, 2018

@rouault - Thanks, forgot to be update to MultiPolygon only

@aaime - Yes, for servers with many collections that is clearly an issue. I think for these cases the approach to document the schema in the OpenAPI does not work and the OpenAPI definition should fallback to just

  • /{name}
  • /{name}/{id}

instead of a specific description of each collection.

cportele added a commit that referenced this issue Mar 8, 2018
@cportele
Copy link
Member

Discussion in 2018-03-13 web-meeting: No action needed for the Core.

Links to schemas in current implementations:

@cmheazel
Copy link
Contributor

OpenAPI issue 1532 may help here. It is a proposal to allow multiple alternate schemas in the Media Type object. These alternate schemas are not restricted to JSON schema. This allows us to specify multiple schemas in the Response Object, including XML (GML) schema. This feature is likely to make it into the next version of OpenAPI. If this is a feature we want to use, please let me know so that I can argue for the requirement in the TSC.

@cportele
Copy link
Member

@cmheazel - Yes, I think that change would be good for supporting XML schema. We knew the current XML support is not really sufficient and so removed all the XML snippets from the OpenAPI examples waiting for an approach to XML that allows us to leverage "our" XML schemas. This approach also avoids the clutter of XML snippets that OpenAPI 3.0 has.

@cmheazel
Copy link
Contributor

@cportele - Thanks. I'll put together an update reflecting the discussions at Mondays TSC meeting. We can discuss specific requirements under this issue.

@mdastous-bentley
Copy link

I'm interested in this topic as well, is there a document that summarizes the different options to get the feature(s) schema? My understanding is that, WFS 3.0 will be mainly schema-less, but a schema could be available on some implementations.

@cportele
Copy link
Member

cportele commented Mar 5, 2019

This should be addressed by #129 (schema links from the API definition) and #126 (schema links from the resources).

@cportele cportele added Part 1: Core Issue related to Part 1 - Core OGC API: Common Issue related to general resources or requirements (see #190) OGC API: Features Issue related to feature resources (see #190) labels Mar 5, 2019
@cportele cportele added this to the Part 1, Second Draft Release milestone May 6, 2019
@cportele
Copy link
Member

cportele commented May 6, 2019

06-MAY-2019 Conference call: Keep it open until #129 is resolved.

@cportele cportele removed the Part 1: Core Issue related to Part 1 - Core label Jun 25, 2019
@cportele cportele removed this from the Part 1, Second Draft Release milestone Jun 25, 2019
@cmheazel
Copy link
Contributor

See Pull Request #256
This may address at least some of the requirements.

@cportele cportele added the Future work support in an additional part of OGC API Features label Dec 13, 2020
@cportele cportele added Part 5: Schemas and removed Future work support in an additional part of OGC API Features OGC API: Common Issue related to general resources or requirements (see #190) OGC API: Features Issue related to feature resources (see #190) progress: waiting for feedback/input labels Mar 21, 2021
@cportele
Copy link
Member

Code Sprint 2024-02-27: A draft of "Part 5: Schemas" exists and addresses the need for a feature schema. The part is expected to be submitted for OGC Architecture Board Review and then Public Comment soon. We are, therefore, closing this issue and invite comments on the draft of Part 5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants