Skip to content

Commit

Permalink
Merge pull request #456 from tomkralidis/edr-part2-pubsub-clean
Browse files Browse the repository at this point in the history
add OGC EDR Part 2 extension
  • Loading branch information
chris-little authored Sep 7, 2023
2 parents 6bd50f3 + 79e60eb commit 81c17eb
Show file tree
Hide file tree
Showing 46 changed files with 1,609 additions and 0 deletions.
11 changes: 11 additions & 0 deletions extensions/pubsub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Standard template

This folder contains the content for OGC API - Environmental Data Retrieval - Part 2: Publish-Subscribe workflow.


The repo is organized as follows:

* standard - the main standard document content
- organized in multiple sections and directories
* openapi - normative OpenAPI components specified by the standard
* examples - JSON and XML examples
40 changes: 40 additions & 0 deletions extensions/pubsub/examples/json/pubsub-message-payload.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"id": "31e9d66a-cd83-4174-9429-b932f1abe1be",
"version": "v04",
"type": "Feature",
"geometry": {
"type": "Point",
"coordinates": [
6.146255135536194,
46.223296618227444
]
},
"properties": {
"pubtime": "2022-03-20T04:50:18.314854383Z",
"operation": "create",
"datetime": "2022-03-20T04:45:00Z",
"integrity": {
"method": "sha512",
"value": "A2KNxvks...S8qfSCw=="
},
"data_id": "dataset/123/data-granule/UANT01_CWAO_200445___15103.bufr4",
"metadata_id": "urn:x-wmo:md:can:eccc-msc:observations.swob",
"content": {
"encoding": "utf-8",
"value": "encoded bytes from the file",
"size": 457
}
},
"links": [
{
"href": "https://example.org/data/4Pubsub/92c557ef-d28e-4713-91af-2e2e7be6f8ab.bufr4",
"rel": "canonical",
"type": "application/x-bufr"
},
{
"href": "https://example.org/oapi/collections/my-dataset/items/my-data-granule",
"rel": "item",
"type": "application/json"
}
]
}
163 changes: 163 additions & 0 deletions extensions/pubsub/examples/yaml/asyncapi.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
asyncapi: '2.5.0'
info:
title: AsyncAPI demo
version: '0.0.1'
description: |
AsyncAPI description of the proposed Pub/Sub functionality
contact:
name: Contact Name
email: you@example.org

servers:
mqtt_prod:
url: example.org
protocol: mqtt
description: MQTT endpoint
security:
- user-password: []
defaultContentType: application/json

channels:
collections:
subscribe:
message:
$ref: '#/components/messages/collection_msg'
collections/wthr_stn:
subscribe:
message:
$ref: '#/components/messages/collection_msg'
collections/stream_gage:
subscribe:
message:
$ref: '#/components/messages/collection_msg'
collections/wthr_stn/items:
subscribe:
message:
$ref: '#/components/messages/wthr_stn_msg'
collections/stream_gage/items:
subscribe:
message:
$ref: '#/components/messages/stream_gage_msg'

components:
messages:
collection_msg:
description: collection updated notification
payload:
type: object
required:
- id
- href
properties:
id:
type: string
description: collection name
time:
type: string
format: date-time
description: time collection changed
href:
type: string
format: uri
description: URL of the changed collection
wthr_stn_msg:
description: An observation formatted as GeoJSON
payload:
type: object
additionalProperties: false
properties:
id:
type: string
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
format: float
properties:
type: object
properties:
time:
type: string
format: date-time
id:
type: string
wind_direction:
type: number
format: float
wind_speed:
type: number
format: float
wind_gust:
type: number
format: float
visibility:
type: number
format: float
air_temperature:
type: number
format: float
dew_point:
type: number
format: float
mean_sea_level_pressure:
type: number
format: float
stream_gage_msg:
description: Monitoring station data formatted as GeoJSON
payload:
type: object
additionalProperties: false
properties:
id:
type: string
type:
type: string
geometry:
type: object
properties:
type:
type: string
coordinates:
type: array
items:
type: number
format: float
links:
type: array
items:
type: object
properties:
rel:
type: string
type:
type: string
title:
type: string
href:
type: string
format: uri
properties:
type: object
properties:
datetime:
type: string
format: date-time
label:
type: string
parametername:
type: array
items:
type: string
edrqueryendpoint:
type: string
format: uri
securitySchemes:
user-password:
type: userPassword
11 changes: 11 additions & 0 deletions extensions/pubsub/openapi/schemas/link.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
$schema: 'https://json-schema.org/draft/2020-12/schema'
$id: 'https://raw.githubusercontent.com/wmo-im/wcmp2/main/schema/wcmpRecordGeoJSON.yaml'
title: OGC API - Pub/Sub message payload link definition
description: OGC API - Pub/Sub message payload link definition

allOf:
- $ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-common/master/19-072/openapi/schemas/link.yaml'
- properties:
channel:
type: string
description: topic to subscribe to for Publish-Subscribe workflow
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
$schema: 'https://json-schema.org/draft/2020-12/schema'
$id: 'https://raw.githubusercontent.com/wmo-im/wcmp2/main/schema/wcmpRecordGeoJSON.yaml'
title: OGC API - Pub/Sub message payload definition
description: OGC API - Pub/Sub message payload definition

required:
- id
- type
- geometry
- properties

properties:
id:
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/core/openapi/schemas/featureGeoJSON.yaml#/properties/id'
type:
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/core/openapi/schemas/featureGeoJSON.yaml#/properties/type'
geometry:
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/core/openapi/schemas/featureGeoJSON.yaml#/properties/geometry'
properties:
type: object
required:
- pubtime
properties:
pubtime:
type: string
format: date-time
description: |
Identifies the date/time of when the file was posted/published, in RFC3339 format.
The publication date/time is critical for subscribers to prevent message loss by knowing
their lag (how far behind the publisher they are).
operation:
type: string
description: the event associated with the lifecycle of a resource.
enum:
- create
- update
- delete
default: create
links:
$ref: 'https://raw.githubusercontent.com/opengeospatial/ogcapi-features/master/core/openapi/schemas/link.yaml'
4 changes: 4 additions & 0 deletions extensions/pubsub/standard/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
source "https://rubygems.org"

gem "metanorma-cli"
gem "relaton-cli"
Loading

0 comments on commit 81c17eb

Please sign in to comment.