csapi

package
v1.0.0-beta.75 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package csapi provides Go constants for the OGC API — Connected Systems v1.0 (CS API) vocabulary — specifically the §10 Datastream concept and its surrounding predicates, which SOSA and OMS do not cover.

SOSA models discrete Observations attached to a Sensor; the CS API adds the Datastream concept (§10) — a stream of Observations produced by one System for one ObservableProperty, with temporal bounds and a result-type discriminator. Sister-repo gateways (semconnect, future CS API hosts) that publish or list Datastreams over `POST /datastreams` / `GET /datastreams` need a shared vocabulary primitive so JSON-LD exports resolve and downstream graph consumers can discover Datastreams without grepping for local IRI strings.

Namespace pinning

The Namespace constant pins to the OGC spec-rooted IRI stem for Connected Systems v1.0. The CS API is still a working draft; when the OGC publishes canonical IRIs (which may differ in form), this package gets a one-shot constant swap and existing entities re-tag via the migration playbook. The constant-name surface is the load- bearing API — consumers reference csapi.Datastream etc., not the string form, so the URI change is invisible at the call site.

Coverage

MVP coverage is the load-bearing subset for the CS API §10 → Datastream representation: the Datastream class plus the four predicates needed for the wire shape — ProducedBy, ResultTimeRange, PhenomenonTimeRange, ResultType. The Schema field (SWE Common DataRecord describing observation result structure) is intentionally absent — see [ADR-044] framework-primitives reference §Scope-cut for the rationale (Schema flows as a StorageRef pointer rather than an inline triple).

Standards-at-work, not semweb hell

This package follows the [vocabulary] family pattern. Constants are exported strings; no OWL inferencing, no SPARQL, no operator- authored RDF. Prefix registration is automatic on import.

External references

[vocabulary]: .. [oms]: ../oms [ADR-044]: ../../docs/adr/044-ogc-connected-systems-framework-split.md

Index

Constants

View Source
const (
	// Prefix is the CS API short token used when compacting IRIs.
	Prefix = "csapi"

	// Namespace is the CS API v1.0 IRI stem.
	Namespace = "http://www.opengis.net/spec/ogcapi-connectedsystems-1/1.0/"
)

CS API namespace identifiers. Pinned to the spec-rooted stem used by OGC API Connected Systems v1.0. The spec is a working draft; when canonical IRIs publish, this constant gets a one-shot swap.

View Source
const (
	// ProducedBy binds a Datastream to the entity ID of the System
	// (sensor or system of systems) that produces its Observations.
	// Inverse of a forthcoming `producesDatastream` predicate.
	ProducedBy = Namespace + "producedBy"

	// ResultTimeRange is the ISO 8601 time-interval representation
	// of the temporal bounds during which the Datastream produced
	// result values (clock time of the measurements). CS API §10.4.
	ResultTimeRange = Namespace + "resultTimeRange"

	// PhenomenonTimeRange is the ISO 8601 time-interval representation
	// of the temporal bounds of the observed phenomena. May differ
	// from ResultTimeRange for processed or back-dated observations.
	// CS API §10.4.
	PhenomenonTimeRange = Namespace + "phenomenonTimeRange"

	// ResultType discriminates the structure of the Datastream's
	// Observations — om:Measurement, om:Category, om:CountObservation,
	// etc. Consumers branch on this to decode the result payload.
	ResultType = Namespace + "resultType"
)

CS API predicate IRIs.

View Source
const (
	// Datastream — a stream of Observations produced by one System
	// (sensor or system of systems) for one ObservableProperty, with
	// declared temporal bounds (PhenomenonTimeRange,
	// ResultTimeRange) and a result-type discriminator (ResultType).
	// CS API v1.0 §10.
	Datastream = Namespace + "Datastream"
)

CS API class IRIs. Use as the object of an rdf:type triple, or anywhere a Connected-Systems-aware encoder references the type.

Variables

This section is empty.

Functions

func IRIs

func IRIs() map[string]string

IRIs returns a copy of the full set of compact → IRI mappings covered by this package.

func IsKnown

func IsKnown(iri string) bool

IsKnown reports whether the given IRI is part of this package's coverage.

func LocalName

func LocalName(iri string) string

LocalName returns the local part of a CS API IRI, or the empty string if the IRI is not in the CS API namespace.

func Register

func Register() error

Register binds the csapi: prefix into the export prefix table. Importing the package triggers this from init(); idempotent.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL