opengeospatial/ogcapi-features

Part 5: relating the Schema requirement class to Part 1 describedBy

Opened this issue · 4 comments

Neither https://docs.ogc.org/DRAFTS/23-058.html#overview nor https://docs.ogc.org/DRAFTS/23-058.html#rc_schemas recall that in Part 1 there's already a way to associate a schema with a FeatureCollection by specifying a "rel": "describedBy" link in the FeatureCollection description. I don't know if that must be a requirement for Part 5, or just a note, but that would be worth recalling.

Hum actually looking at https://demo.ldproxy.net/daraa/collections/CulturePnt, I see a { "rel" : "http://www.opengis.net/def/rel/ogc/0.0/schema", "title" : "Schema of features in 'Cultural (Points)'", "href" : "https://demo.ldproxy.net/daraa/collections/CulturePnt/schema" }, where the rel value relates to the one mentioned in https://docs.ogc.org/DRAFTS/23-058.html#_additional_link_relation_types

but no describedBy. So this raises the question: is describedBy deprecated?

Good point, thank you for raising this.

The reason why Part 5 adds the "schema" link relation type and does no reference the "descibedby" link relation type is that JSON Schema recommends the "describedby" link relation type for linking to the JSON Schema from a JSON instance.

The issue is that while the schema as specified in Part 5 describes the feature properties, it cannot be used directly to validate a GeoJSON or JSON-FG instance using a JSON Schema validator. See this discussion.

Based on the recommendation in JSON Schema, it was our assumption that most software that sees a "describedby" link from a JSON document to a resource with media type application/schema+json would expect that the schema can be used to validate the instance. To avoid this, we decided to mint and use specific media types for the link to the Part 5 schemas.

"describedby" is not deprecated, but it should be used in links from a JSON document to a JSON Schema that can be used to validate the JSON document.

We should make this clearer in Part 5 and also in Part 1.

Does this make sense?

Does this make sense?

yes, thanks, that makes sense.

We should make this clearer in Part 5 and also in Part 1.

+1 as the difference between the "physical" schema of describedBy and the "logical" schema of Part 5 is quite subtle when you are not aware of it.

Thanks, I will work on a pull request.

Meeting 2024-07-01: Agreed, we should clarify this.