You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add optional @link-derived fields and a shared CSAPIResourceRef type to the Part 1 GeoJSON interfaces (System, Deployment, SamplingFeature) in model.ts so consumers have typed access to structural associations defined by OGC 23-001 §16.
The OGC CS API JSON encoding (OGC 23-001 §16) defines inline @link properties on Part 1 GeoJSON resources to encode structural associations between resources:
System ──systemKind@link──→ Procedure
Deployment ──platform@link──→ System (platform)
Deployment ──deployedSystems@link──→ [System, System, ...]
SamplingFeature ──sampledFeature@link──→ Feature
The four Part 1 GeoJSON resource interfaces in model.ts do not include any @link fields. After extractCSAPIFeature() parses server JSON, all @link data is silently discarded because:
The TypeScript interfaces have no @link fields to define the shape
The parser uses an allowlist extraction pattern — only named interface properties survive
Evidence:
The SamplingFeature JSDoc (model.ts L412) explicitly states:
"The sampledFeature@link link relation is also required."
…but the interface below it omits the field entirely.
After parsing, systemKind@link is gone. The parsed System object provides no path to the procedure it implements.
Impact: Consumers cannot type-safely read @link fields from parsed resources. The ogc-csapi-explorer demo app had to implement a tryLinkFallback() workaround (commit ad06b52) that bypasses the library's typed models and reads @link fields from raw JSON.
Add CSAPIResourceRef interface + optional @link-derived fields to 3 interfaces
src/index.ts
Modify
~+1
Export CSAPIResourceRef type
Proposed Fix
Add a shared CSAPIResourceRef type and optional @link-derived fields to 3 Part 1 interfaces:
New Type
/** Parsed form of a CS API `@link` inline property. */exportinterfaceCSAPIResourceRef{/** URL of the referenced resource. */href: string;/** Globally unique identifier of the referenced resource. */uid?: string;/** Human-readable title. */title?: string;/** Resource type URI. */rt?: string;}
Interface Changes
Interface
New Field
Type
Spec Reference
System
systemKindLink?
CSAPIResourceRef
OGC 23-001 §8.3 Table 8
Deployment
platformLink?
CSAPIResourceRef
OGC 23-001 §8.5 Table 10
Deployment
deployedSystemsLink?
CSAPIResourceRef[]
OGC 23-001 §8.5 Table 10
SamplingFeature
sampledFeatureLink?
CSAPIResourceRef
OGC 23-001 §8.9 Table 14
Design notes:
All fields are optional (?) — servers aren't required to include @link properties in every response context
camelCase naming without @ sigil (e.g., systemKindLink not systemKind@link) for TypeScript ergonomics
deployedSystemsLink is CSAPIResourceRef[] (array) because deployments can have multiple systems
Procedure has no spec-defined @link properties — no change needed
Task
Add optional
@link-derived fields and a sharedCSAPIResourceReftype to the Part 1 GeoJSON interfaces (System,Deployment,SamplingFeature) inmodel.tsso consumers have typed access to structural associations defined by OGC 23-001 §16.Finding Reference: Gap 1 from CS API
@linkProperty Gap AnalysisSeverity: Moderate
Category: Design gap
Ownership: Ours
Problem Statement
The OGC CS API JSON encoding (OGC 23-001 §16) defines inline
@linkproperties on Part 1 GeoJSON resources to encode structural associations between resources:The four Part 1 GeoJSON resource interfaces in
model.tsdo not include any@linkfields. AfterextractCSAPIFeature()parses server JSON, all@linkdata is silently discarded because:@linkfields to define the shapeEvidence:
The
SamplingFeatureJSDoc (model.tsL412) explicitly states:…but the interface below it omits the field entirely.
Server JSON that gets lost:
{ "id": "of45kp7s5ims", "type": "Feature", "properties": { "featureType": "http://www.w3.org/ns/sosa/Platform", "uid": "urn:osh:sensor:odas:buoy:46042", "name": "ODAS Station 46042 — Monterey", "systemKind@link": { "href": "http://45.55.99.236:8080/sensorhub/api/procedures/of45l6iqgims", "uid": "urn:osh:sensor:odas:procedure:buoy-platform", "rt": "http://www.w3.org/ns/sosa/Procedure", "title": "ODAS Standard Buoy Platform" } } }After parsing,
systemKind@linkis gone. The parsedSystemobject provides no path to the procedure it implements.Impact: Consumers cannot type-safely read
@linkfields from parsed resources. The ogc-csapi-explorer demo app had to implement atryLinkFallback()workaround (commit ad06b52) that bypasses the library's typed models and reads@linkfields from raw JSON.Findings Report
📋 Issue #108 Findings Report — Part 1 (GeoJSON) TypeScript Interfaces Omit All
@linkAssociation PropertiesFiles to Create or Modify
src/ogc-api/csapi/model.tsCSAPIResourceRefinterface + optional@link-derived fields to 3 interfacessrc/index.tsCSAPIResourceReftypeProposed Fix
Add a shared
CSAPIResourceReftype and optional@link-derived fields to 3 Part 1 interfaces:New Type
Interface Changes
SystemsystemKindLink?CSAPIResourceRefDeploymentplatformLink?CSAPIResourceRefDeploymentdeployedSystemsLink?CSAPIResourceRef[]SamplingFeaturesampledFeatureLink?CSAPIResourceRefDesign notes:
?) — servers aren't required to include@linkproperties in every response context@sigil (e.g.,systemKindLinknotsystemKind@link) for TypeScript ergonomicsdeployedSystemsLinkisCSAPIResourceRef[](array) because deployments can have multiple systemsProcedurehas no spec-defined@linkproperties — no change neededextractCSAPIFeature()silently drops all@linkproperties during parsing #109Scope — What NOT to Touch
src/ogc-api/csapi/formats/geojson.ts— parser changes belong to Part 1extractCSAPIFeature()silently drops all@linkproperties during parsing #109@linkresolution utility functions — those belong to DEFERRED — No@link/@idresolution utilities for cross-resource reference following #110@linkfields are a separate concernResourceLink/OgcApiDocumentLink— different type for HATEOAS linksProcedureinterface — no spec-defined@linkproperties for ProceduresAcceptance Criteria
CSAPIResourceRefinterface exists inmodel.tswithhref,uid?,title?,rt?fieldsSystem.propertiesincludes optionalsystemKindLink?: CSAPIResourceRefDeployment.propertiesincludes optionalplatformLink?: CSAPIResourceRefanddeployedSystemsLink?: CSAPIResourceRef[]SamplingFeature.propertiesincludes optionalsampledFeatureLink?: CSAPIResourceRefCSAPIResourceRefis exported fromsrc/index.ts@seelinks to OGC spec sectionsnpm test)Dependencies
Blocked by: Nothing
Blocks: #109 — Part 1
extractCSAPIFeature()parser must extract@linkproperties (needs interface fields first)Operational Constraints
Key constraints:
References
@linkProperty Gap Analysis@linkgaps across the library@idfields (same pattern, already resolved)tryLinkFallback()(ad06b52)src/ogc-api/csapi/model.tssrc/index.tsSpecification References
procedureassociation (Conditional)platform(Optional),deployedSystems(Required)sampledFeature(Required)@linkinline property convention