You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is common that the domain of values of a property is an enumerated list. The value in the data is often a short code with a human-readable title and potentially a description. It is a good practice to publish such codelists (or codesets as used in the new ISO 19103:2024) as resources on the web.
When requesting a schema that contains such properties (as returnables, receivables, queryables), the response should not only list the codes, but also provide access to additional information about each code.
In the discussion we have identified two ways of representing properties with an enumerated list of codes.
The first option uses oneOf with a schema for each code. This has the advantage that all information is in the schema; no external information needs to be accessed.
The second option uses enum with a URI reference to the codelist resource. This has the advantage that enum is easier to parse/handle than oneOf and that a separate resource for codelists may be useful for other purposes (in the API or separate from the API). A codelist URI may exist and the codelist may already be managed / published at the URI.
Here is an example using the CulturePnt feature type in the Daraa dataset that was used in various OGC initiatives.
Using oneOf with each option with a const and optional title / description values
Both variants have their advantages and disadvantages. Part 5 should, therefore, define the two variants as profiles (e.g., codelist-inline and codelist-ref). It would be the decision of each API that has coded values, whether they support none of the profiles, only one profile or both profiles.
In the by-reference profile, the new key for the URI reference to the codelist should be x-ogc-codelistUri.
The text was updated successfully, but these errors were encountered:
The discussion about this issue started in #953.
It is common that the domain of values of a property is an enumerated list. The value in the data is often a short code with a human-readable title and potentially a description. It is a good practice to publish such codelists (or codesets as used in the new ISO 19103:2024) as resources on the web.
When requesting a schema that contains such properties (as returnables, receivables, queryables), the response should not only list the codes, but also provide access to additional information about each code.
In the discussion we have identified two ways of representing properties with an enumerated list of codes.
The first option uses
oneOf
with a schema for each code. This has the advantage that all information is in the schema; no external information needs to be accessed.The second option uses
enum
with a URI reference to the codelist resource. This has the advantage thatenum
is easier to parse/handle thanoneOf
and that a separate resource for codelists may be useful for other purposes (in the API or separate from the API). A codelist URI may exist and the codelist may already be managed / published at the URI.Here is an example using the CulturePnt feature type in the Daraa dataset that was used in various OGC initiatives.
Using
oneOf
with each option with aconst
and optionaltitle
/description
valuesExample, see properties
ZI037_REL
andF_CODE
:Using
enum
and a separate codelist resourceNote that this a (live example).
Proposal
Both variants have their advantages and disadvantages. Part 5 should, therefore, define the two variants as profiles (e.g.,
codelist-inline
andcodelist-ref
). It would be the decision of each API that has coded values, whether they support none of the profiles, only one profile or both profiles.In the by-reference profile, the new key for the URI reference to the codelist should be
x-ogc-codelistUri
.The text was updated successfully, but these errors were encountered: