csapi

package
v1.0.0-beta.89 Latest Latest
Warning

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

Go to latest
Published: May 30, 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 (
	// 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"

	// ControlStream — a stream of Commands sent to one System
	// (typically an Actuator-bearing platform) for one
	// ActuatableProperty. CS API v1.0 Part 2 §14. Draft surface;
	// IRI swaps to the canonical spec form once published.
	ControlStream = Namespace + "ControlStream"

	// Command — an individual instruction issued through a
	// ControlStream targeting an ActuatableProperty. CS API v1.0
	// Part 2 §15. Draft surface; IRI may swap when the spec
	// publishes.
	Command = Namespace + "Command"

	// SystemEvent — a discrete notification about a System
	// (deployment lifecycle, configuration change, alert). Used
	// by /systems/{id}/events. CS API v1.0 Part 2 §16. Draft
	// surface; IRI may swap when the spec publishes.
	SystemEvent = Namespace + "SystemEvent"
)

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

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"

	// ControlsSystem binds a ControlStream to the entity ID of the
	// System it targets with Commands. Inverse counterpart to a
	// forthcoming `hasControlStream`. CS API v1.0 Part 2 §14.
	ControlsSystem = Namespace + "controlsSystem"

	// PartOfControlStream binds a Command to the entity ID of the
	// ControlStream it was issued through. CS API v1.0 Part 2 §15.
	PartOfControlStream = Namespace + "partOfControlStream"

	// EventForSystem binds a SystemEvent to the entity ID of the
	// System the event is about. CS API v1.0 Part 2 §16.
	EventForSystem = Namespace + "eventForSystem"
)

CS API predicate IRIs.

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