Skip to content

Commit 3b9bd3f

Browse files
committed
add codelist handling
closes #978
1 parent f3d0ce5 commit 3b9bd3f

File tree

5 files changed

+121
-2
lines changed

5 files changed

+121
-2
lines changed

extensions/schemas/standard/23-058.adoc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,9 +123,11 @@ include::clause_13_profile_parameter.adoc[]
123123

124124
include::clause_14_profile_references.adoc[]
125125

126-
include::clause_15_media_types.adoc[]
126+
include::clause_15_profile_codelists.adoc[]
127127

128-
include::clause_16_security_considerations.adoc[]
128+
include::clause_16_media_types.adoc[]
129+
130+
include::clause_17_security_considerations.adoc[]
129131

130132
<<<
131133
include::annex_ats.adoc[]
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
:req-class: profile-codelists
2+
[#rc_{req-class}]
3+
== Requirements Class "Profiles for codelists"
4+
5+
The Requirements Class "Profiles for codelists" specifies two profiles for representing enumerated values with additional information about each value, typically including a human-readable label (codelists). Enumerated values without additional information about each value are specified in the "enum" member of the JSON Schema.
6+
7+
It is good practice to publish codelists as resources on the web - as HTML, SKOS, a JSON object with each code value as a key, and/or another format.
8+
9+
When requesting a schema that contains properties with values from a codelist, the response should not only list the codes, but also provide access to additional information about each code.
10+
11+
Two different representations of a property with values from a codelist are specified as profiles.
12+
13+
The first profile ("codelist-inline") uses "oneOf" with a schema for each code. This profile has the advantage that all information is in the schema; no external information needs to be accessed.
14+
15+
The second profile ("codelist-ref") 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, too, and in fact may already be published.
16+
17+
[cols="2,7",width="90%"]
18+
|===
19+
^|*Requirements Class* |http://www.opengis.net/spec/{standard}/{m_n}/req/{req-class}
20+
|Target type |Web resources
21+
|Dependency |<<rc_schemas>>
22+
|Dependency |<<rc_profile-parameter>>
23+
|===
24+
25+
:req: ref-profiles
26+
[#{req-class}_{req}]
27+
[width="90%",cols="2,7a"]
28+
|===
29+
^|*Requirement {counter:req-num}* |/req/{req-class}/{req}
30+
^|A |Any schema resource SHALL provide the query parameter "profile".
31+
|===
32+
33+
:req: codelist-inline
34+
[#{req-class}_{req}]
35+
[width="90%",cols="2,7a"]
36+
|===
37+
^|*Requirement {counter:req-num}* |/req/{req-class}/{req}
38+
^|A |In the profile "codelist-inline" (`\http://www.opengis.net/def/profile/OGC/0/codelist-inline`) the schema of each property with values from a codelist SHALL be represented by a "oneOf" schema with a schema for each code.
39+
^|B |The schema for each code SHALL have a "const" member with the code as the value.
40+
|===
41+
42+
:rec: codelist-inline-title
43+
[#{req-class}_{rec}]
44+
[width="90%",cols="2,7a"]
45+
|===
46+
^|*Recommendation {counter:rec-num}* |/req/{req-class}/{rec}
47+
^|A |In the profile "codelist-inline", the schema for each code SHOULD have a "title" member.
48+
|===
49+
50+
[[example_15_1]]
51+
.Profile "codelist-inline"
52+
====
53+
[source,JSON]
54+
----
55+
{
56+
"title": "Language",
57+
"oneOf": [
58+
{
59+
"const": "eng",
60+
"title": "English"
61+
},
62+
{
63+
"const": "deu",
64+
"title": "German"
65+
},
66+
{
67+
"const": "fra",
68+
"title": "French"
69+
},
70+
{
71+
"const": "spa",
72+
"title": "Spanish"
73+
}
74+
]
75+
}
76+
----
77+
====
78+
79+
:req: codelist-ref
80+
[#{req-class}_{req}]
81+
[width="90%",cols="2,7a"]
82+
|===
83+
^|*Requirement {counter:req-num}* |/req/{req-class}/{req}
84+
^|A |In the profile "codelist-ref" (`\http://www.opengis.net/def/profile/OGC/0/codelist-ref`) the codelist SHALL be referenced by a HTTP(S) URI using the keyword "x-ogc-codelistUri".
85+
|===
86+
87+
[[example_15_2]]
88+
.Profile "codelist-ref"
89+
====
90+
[source,JSON]
91+
----
92+
{
93+
"title": "Language",
94+
"type": "string",
95+
"enum": [
96+
"eng",
97+
"deu",
98+
"fra",
99+
"spa"
100+
],
101+
"x-ogc-codelistUri": "https://example.com/codelists/languages"
102+
}
103+
----
104+
====
105+
106+
:per: default
107+
[#{req-class}_{per}]
108+
[width="90%",cols="2,7a"]
109+
|===
110+
^|*Permission {counter:per-num}* |/rec/{req-class}/{per}
111+
^|A |A resource MAY support only one of the profiles.
112+
^|B |Any codelist profile MAY be the default profile for a schema resource.
113+
|===

extensions/schemas/standard/clause_4_terms_and_definitions.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ the time instant or time interval that the publisher considers as the most impor
4545

4646
NOTE: A feature can be described by multiple temporal properties. For example, an event can have a property with an instant or interval when the event occurred or will occur and another property when the event was recorded in the dataset. The primary temporal information can also be built from two properties, e.g., when the feature has two properties describing the start and end instants of an interval.
4747

48+
[[profile-def]]
49+
profile::
50+
additional semantics (constraints, conventions, extensions) that are associated with a resource representation, in addition to those defined by the media type (<<rfc6906,RFC 6906: The 'profile' Link Relation Type>>)
51+
4852
[[publisher-def]]
4953
publisher::
5054
entity responsible for making a resource available (https://www.dublincore.org/specifications/dublin-core/dcmi-terms/#http://purl.org/dc/terms/publisher[Dublin Core Metadata Initiative - DCMI Metadata Terms])

0 commit comments

Comments
 (0)