Skip to content

Commit

Permalink
Merge pull request #84 from tomkralidis/record-schema
Browse files Browse the repository at this point in the history
resolve extents to OGC API - Common, Collections, make optional
  • Loading branch information
pvretano authored Feb 11, 2021
2 parents f76cd8e + 2eda522 commit 338e959
Show file tree
Hide file tree
Showing 6 changed files with 202 additions and 78 deletions.
209 changes: 142 additions & 67 deletions core/examples/json/record.json
Original file line number Diff line number Diff line change
@@ -1,72 +1,147 @@
{
"id": "rid67",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[[-10,-10],[-5,0],[0,0],[10,10],[-6,-7],[-10,-10]]
"id": "urn:x-wmo:md:int.wmo.wis::https://geo.woudc.org/def/data/ozone/total-column-ozone/totalozone",
"type": "Feature",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-180,
-90
],
[
-180,
90
],
[
180,
90
],
[
180,
-90
],
[
-180,
-90
]
]
]
},
"properties": {
"type": "some_resource_type",
"recordcreated": "2020-03-06T00:00:00Z",
"recordupdated": "2020-05-17T10:34:39Z",
"title": "The Resource's Title",
"description": "Some human readable description of the resource.",
"keywords": [
"keyword1",
"keyword2",
"keyword3"
],
"extents": [
{
"spatial": {
"bbox": [-10,-10,10,10],
"crs": "http://www.opengis.net/def/crs/EPSG/0/4326"
},
"temporal": {
"interval": ["2019-05-21T07:05:35","2019-05-21T07:07:08"],
"trs": "http://www.opengis.net/def/uom/ISO-8601/0/Gregorian"
}
}
],
"associations": [
{
"rel": "related",
"title": "Some related record in this catalogue.",
"href": "http://demo.server.com/collations/ogccat/items/rid574"
},
{
"rel": "related",
"title": "Some related record in another catalogue.",
"href": "http://other.server.com/collations/catalogue/items/id6574"
},
{
"rel": "search",
"type": "text/html",
"title": "WOUDC - Data - Station List",
"href": "https://woudc.org/data/stations"
},
{
"rel": "item",
"type": "image/png",
"title": "World Ozone and Ultraviolet Radiation Data Centre (WOUDC) stations",
"href": "https://geo.woudc.org/ows?service=WMS&version=1.3.0&request=GetMap&crs={crs}&bbox={miny},{minx},{maxy},{maxx}&layers=stations&width={width}&height={height}&format=image/png",
"templated": "true"
}
]
},
"links": [
{
"rel": "alternate",
"type": "application/atom+xml",
"title": "This records encoded as ATOM/XML.",
"href": "http://demo.server.com/collations/ogccat/items/rid67.xml"
},
{
"rel": "next",
"title": "The next record in this result set.",
"href": "http://demo.server.com/collations/ogccat/items/rid53"
}
]
"record-created": "2021-02-08",
"record-updated": "2021-02-08",
"type": "dataset",
"title": "Total Ozone - daily observations",
"description": "A measurement of the total amount of atmospheric ozone in a given column from the surface to the edge of the atmosphere. Ground based instruments such as spectrophotometers and ozonemeters are used to measure results daily",
"keywords": [
"total",
"ozone",
"level 1.0",
"column",
"dobson",
"brewer",
"saoz"
],
"language": "en",
"externalId": "urn:x-wmo:md:int.wmo.wis::https://geo.woudc.org/def/data/ozone/total-column-ozone/totalozone",
"created": "2015-01-23",
"updated": "2015-01-23",
"publisher": "https://woudc.org",
"themes": [
{
"scheme": "https://geo.woudc.org/codelists.xml#WOUDC_InstrumentCode",
"concepts": [
"dobson",
"brewer",
"vassey",
"pion",
"microtops",
"spectral",
"hoelper",
"saoz",
"filter"
]
},
{
"scheme": "https://wis.wmo.int/2012/codelists/WMOCodeLists.xml#WMO_CategoryCode",
"concepts": [
"atmosphericComposition",
"pollution",
"observationPlatform",
"rocketSounding"
]
}
],
"formats": [
"CSV",
"GeoJSON"
],
"contactPoint": "https://woudc.org/contact.php",
"license": "https://woudc.org/about/data-policy.php",
"rights": null,
"extent": [
{
"spatial": {
"bbox": [
-180,
-90,
180,
90
],
"crs": "http://www.opengis.net/def/crs/OGC/1.3/CRS84"
},
"temporal": {
"interval": [
[
"1924-08-18",
null
]
],
"trs": "http://www.opengis.net/def/uom/ISO-8601/0/Gregorian"
}
}
],
"associations": [
{
"rel": "item",
"type": "image/png",
"title": "OGC Web Map Service (WMS)",
"href": "https://geo.woudc.org/ows?service=WMS&version=1.3.0&request=GetMap&crs={crs}&bbox={miny},{minx},{maxy},{maxx}&layers=totalozone&width={width}&height={height}&format=image/png",
"templated": true
},
{
"rel": "enclosure",
"type": "text/html",
"title": "Web Accessible Folder (WAF)",
"href": "https://woudc.org/archive/Archive-NewFormat/TotalOzone_1.0_1"
},
{
"rel": "search",
"type": "text/html",
"title": "Data Search / Download User Interface",
"href": "https://woudc.org/data/explore.php?dataset=totalozone"
},
{
"rel": "enclosure",
"type": "application/zip",
"title": "Static dataset archive file",
"href": "https://woudc.org/archive/Summaries/dataset-snapshots/totalozone.zip"
},
{
"rel": "service",
"type": "application/xml",
"title": "OGC Web Feature Service (WFS)",
"href": "https://geo.woudc.org/ows"
}
],
"links": [
{
"rel": "alternate",
"type": "text/html",
"title": "This document as HTML",
"href": "https://woudc.org/data/dataset_info.php?id=totalozone"
}
]
}
}
2 changes: 1 addition & 1 deletion core/openapi/schemas/common/collectionInfo.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ properties:
itemType:
description: indicator about the type of the items in the collection (the default value is 'unknown').
type: string
default: unknown
default: record
crs:
description: the list of coordinate reference systems supported by the API; the first item is the default coordinate reference system
type: array
Expand Down
26 changes: 26 additions & 0 deletions core/openapi/schemas/featureCollectionGeoJSON.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
type: object
required:
- type
- features
properties:
type:
type: string
enum:
- FeatureCollection
features:
type: array
items:
$ref: record.yaml
links:
type: array
items:
$ref: link.yaml
timeStamp:
type: string
format: date-time
numberMatched:
type: integer
minimum: 0
numberReturned:
type: integer
minimum: 0
20 changes: 13 additions & 7 deletions core/openapi/schemas/record.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,20 @@ properties:
items:
type: object
properties:
category:
scheme:
type: string
description: A category of the resource.
format: uri
taxonomy:
type: string
description: The knowledge organization system used to classify the resource.
format: uri
description: |-
An identifier for the knowledge organization
system used to classify the resource. It is recommended that the
identifier by a resolvable URI.
concepts:
type: array
description: |-
One or more entity/concept identifers from
this knowledge system. it is recommended that a resolvable URI be used
for each entity/concept identifier.
items:
type: string
formats:
type: array
description: A list of available distributions of the resource.
Expand Down
19 changes: 18 additions & 1 deletion core/standard/clause_7_core.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ An implementation could use opaque links that are managed by the server. It is
up to the server to determine how long these links can be de-referenced.
Clients should be prepared to receive a 404 response.

Another implementation approach is to use an implementation-specific parameter that specifies the index within the result set from which the server begins presenting results in the response, like the `startIndex` parameter that was used in <<WFS20,WFS 2.0>> (and which may be added again in additional parts of the OGC API Features series).
Another implementation approach is to use an implementation-specific parameter that specifies the index within the result set from which the server begins presenting results in the response, like the `startIndex` parameter that was used in <<WFS20,WFS 2.0>> (and which may be added again in additional parts of the OGC API - Features series).

The API will return no `next` link, if it has returned all selected record, and the server knows that. However, the server may not be aware that it has already returned all selected records. For example, if the request states `limit=10` and the query to the backend datastore returns 10 records, the server may not know, if there are more records or not (in most cases there will be more records), unless the total number of matches is also computed, which may be too costly. The server will then add the next link, and if there are no more records, dereferencing the next link will return am empty feature collection and no next link. This behavior is consistent with the statements above.

Expand All @@ -414,6 +414,23 @@ NOTE: The representation of the links and the other properties in the payload de

include::recommendations/core/PER_additional-properties.adoc[]

[#record-schema,reftext='Record Response Schema']
.Record Response Schema
[source,yaml]
----
include::../openapi/schemas/record.yaml[]
----

The following JSON is an example of a response to an OGC API - Records
query operation.

[#record-example,reftext=`Record Example`]
.Record Example
[source,json]
----
include::../examples/json/record.json[]
----

[[core-queryables-record-table]]
[reftext='{table-caption} {counter:table-num}']
.Table of Core Queryables related to the catalogue record
Expand Down
4 changes: 2 additions & 2 deletions core/standard/clause_8_collections.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ include::requirements/requirements_class_collections.adoc[]

The purpose of the conformance class is to specify requirements that extend
the behaviour at the `/collections` endpoint to make it queryable by
OGC API Records clients.
OGC API - Records clients.

The conformance class defines the following extensions:

1. It extends the set of query parameters defined in the https://github.com/opengeospatial/oapi_common/blob/master/collections/clause_8_collections.adoc#11-collections-metadata[Collections Metadata] section to support the richer set of query parameters defined in the <<parameters-section,Parameters>> clause of this specification.

2. It extends the schema of the collection information object defined in the https://github.com/opengeospatial/oapi_common/blob/master/collections/clause_8_collections.adoc#12-collection-information[Collection Information] clause of the https://github.com/opengeospatial/oapi_common/blob/master/core/OAPI_Common-Core.adoc[OGC API - Common - Part 2: Geospatial Data] extension to add additional keys/properties that are required by OGC API Records.
2. It extends the schema of the collection information object defined in the https://github.com/opengeospatial/oapi_common/blob/master/collections/clause_8_collections.adoc#12-collection-information[Collection Information] clause of the https://github.com/opengeospatial/oapi_common/blob/master/core/OAPI_Common-Core.adoc[OGC API - Common - Part 2: Geospatial Data] extension to add additional keys/properties that are required by OGC API - Records.


=== Collections Metadata
Expand Down

0 comments on commit 338e959

Please sign in to comment.