Skip to content

Commit f006df1

Browse files
committed
schemas: Changes to sync OGC API - Common review
- The main change relates to the ability to describe meaning of enum values related to opengeospatial/ogcapi-coverages#173 (comment) using a combination of `anyOf` with `const` + `title` as described in https://stackoverflow.com/questions/64233370/in-json-schema-how-to-define-an-enum-with-description-of-each-elements-in-the-e - Changes also introduce a new `x-ogc-nilValues` keyword for identifying nil values - Other changes are gramamr fixes and minor clarifications - Changing indirect dependency to QUDT in general as opposed to QUDT units since QUDT can also used for semantic definitions (not only QUDT units) - Clarified that JSON Schema keywords can also include additional keywords in section below
1 parent 0183c73 commit f006df1

File tree

2 files changed

+22
-12
lines changed

2 files changed

+22
-12
lines changed

extensions/schemas/standard/clause_3_references.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ The following normative documents contain provisions that, through reference in
99
1010
* [[ogc06_103r4]] Open Geospatial Consortium (OGC). OGC 06-103r4: **OpenGIS® Implementation Standard for Geographic information - Simple feature access - Part 1: Common architecture**. Edited by J. Herring. 2011. Available at http://portal.opengeospatial.org/files/?artifact_id=25355
1111
12-
* [[qudtunits]] QUDT.org. **QUDT Units Vocabulary 2.1**. Edited by R. Hodgson. 2024. Available at https://www.qudt.org/doc/DOC_VOCAB-UNITS.html.
12+
* [[qudt]] QUDT.org. **QUDT Ontologies, derived models and vocabularies 2.1**. Edited by R. Hodgson. 2024. Available at https://www.qudt.org/.
1313
1414
* [[ucum]] Regenstrief Institute, Inc. **The Unified Code for Units of Measure**. Edited by G. Schadow, .C J. McDonald. 2017. Available at https://ucum.org/ucum.
1515

extensions/schemas/standard/clause_7_schemas.adoc

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The Requirements Class "Schemas" specifies basic provisions for schemas of items
1212
|Indirect Dependency |<<json-schema-validation,JSON Schema Validation: A Vocabulary for Structural Validation of JSON>>
1313
|Indirect Dependency |<<ogc06_103r4,Simple feature access - Part 1: Common architecture>>
1414
|Indirect Dependency |<<ucum,The Unified Code for Units of Measure>>
15-
|Indirect Dependency |<<qudtunits,QUDT Units Vocabulary>>
15+
|Indirect Dependency |<<qudt,QUDT Ontologies, derived models and vocabularies>>
1616
|===
1717

1818
[#schema-representation]
@@ -27,7 +27,7 @@ The Requirements Class "Schemas" specifies basic provisions for schemas of items
2727
^|B |The schema SHALL have the following characteristics:
2828
2929
* "$schema" is "\https://json-schema.org/draft/2020-12/schema";
30-
* "$id" is a HTTP(S) URI without query parameters that returns the schema, if requested with the header "Accept: application/schema+json"; and
30+
* "$id" is a HTTP(S) URI without query parameters that returns the schema, if requested with the header "Accept: application/schema+json"; and
3131
* "type" is "object".
3232
|===
3333
@@ -58,12 +58,13 @@ The following recommendations are intended to simplify parsing a schema and to h
5858
^|C |Properties that represent a URI SHOULD be represented as a string with format "uri" or "uri-reference".
5959
^|D |Properties that represent a URI template SHOULD be represented as a string with format "uri-template".
6060
^|E |Properties that represent a UUID SHOULD be represented as a string with format "uuid".
61-
^|F |For string properties that are, "minLength", "maxLength", "enum" and/or "pattern" SHOULD be provided, where applicable.
61+
^|F |For string properties, "minLength", "maxLength", "enum" and/or "pattern" SHOULD be provided, where applicable.
6262
^|G |For numeric properties, "multipleOf", "minimum", "exclusiveMinimum", "maximum", "exclusiveMaximum" SHOULD be provided, where applicable.
63-
^|H |For integer properties that represent enumerated values, "enum" SHOULD be provided.
64-
^|I |For array properties, the property SHOULD consist of items that are strings or numbers.
65-
^|J |Required properties SHOULD be included in "required".
66-
^|K |The JSON Schema keywords SHOULD be constrained to the those mentioned in this recommendation and requirement `/req/{req-class}/properties`.
63+
^|H |For integer properties that represent enumerated values without providing a description for each, "enum" SHOULD be provided.
64+
^|I |For integer properties that represent enumerated values while providing a description for each, "anyOf" with a combination of "const" and "title" for each entry SHOULD be provided.
65+
^|J |For array properties, the property SHOULD consist of items that are strings or numbers.
66+
^|K |Required properties SHOULD be included in "required".
67+
^|L |The JSON Schema keywords SHOULD be constrained to those mentioned in this recommendation, requirement `/req/{req-class}/properties` and requirements in the _additional keywords_ section below.
6768
|===
6869

6970
[#additional-keywords]
@@ -79,7 +80,7 @@ In order to be able to map the logical schema to a format-specific schema, exten
7980
^|A |Additional keywords SHALL start with "x-ogc-".
8081
|===
8182
82-
CAUTION: The next version of JSON Schema will likely restrict the use of additional keywords. As a result, this Standard may need to change the prefix or change the way as to how the vocabulary is extended.
83+
CAUTION: The next version of JSON Schema will likely restrict the use of additional keywords. As a result, this Standard may need to change the prefix or change how the vocabulary is extended.
8384
8485
:req: role
8586
[#{req-class}_{req}]
@@ -122,9 +123,9 @@ In geospatial data, numeric property values often represent a measurement and ha
122123
^|A |The keyword "x-ogc-unit" SHALL be used to declare the unit of measure of the property.
123124
^|B |The value of the keyword "x-ogc-unit" SHALL be a string representing the unit of measure.
124125
^|C |The value of the keyword "x-ogc-unit" SHALL be the case sensitive UCUM representation ("c/s") unless a different language / register for units is identified in keyword "x-ogc-unitLang".
125-
^|D |The value for UCUM, if explicitly declared as the language for units in keyword "x-ogc-unitLang", SHALL be "UCUM".
126-
^|E |The value for the QUDT Units Vocabulary, if declared as the language for units in keyword "x-ogc-unitLang", SHALL be "QUDT".
127-
^|F |The value of the keyword "x-ogc-unit" SHALL be the URI of the unit for values from the QUDT Units Vocabulary.
126+
^|D |The value for UCUM, if explicitly declared as the language for units in keyword "x-ogc-unitLang", SHALL be "UCUM".
127+
^|E |For specifying a unit from QUDT Units Vocabulary, "x-ogc-unitLang", SHALL be "QUDT".
128+
^|F |For specifying a unit from QUDT Units Vocabulary, the value of the keyword "x-ogc-unit" SHALL be the URI of the unit.
128129
|===
129130
130131
Communities or other OGC Standards can specify additional values for other unit languages, e.g., https://www.opengis.net/def/uom[units registered in the OGC Rainbow]. For each language it must be specified how units have to be represented in the "x-ogc-unit" value.
@@ -142,6 +143,15 @@ NOTE: For example, the value for hectopascal is `hPa` in UCUM and `\https://qudt
142143
^|B |The value of the keyword "x-ogc-definition" SHALL be a URI.
143144
|===
144145

146+
:req: nilvalues
147+
[#{req-class}_{req}]
148+
[width="90%",cols="2,7a"]
149+
|===
150+
^|*Requirement {counter:req-num}* |/req/{req-class}/{req}
151+
^|A |The keyword "x-ogc-nilValues" SHALL be used to identify the values considered nil.
152+
^|B |The value of the keyword "x-ogc-nilValues" SHALL be an array of objects, each including a mandatory "const" value and an optional "title" explanation of the meaning of that particular nil value.
153+
|===
154+
145155
=== Examples
146156
147157
The following example is the schema of a feature type representing cultural entities. The schema includes additional keywords that apply to feature data (specified in the next Clause).

0 commit comments

Comments
 (0)