Skip to content

URL builder: ControlStream missing nested navigation methods that DataStream has (systems, procedures, history) #104

Closed

Description

@Sam-Bolling

Task

Add three missing ControlStream nested navigation methods (getControlStreamSystems, getControlStreamProcedures, getControlStreamHistory) to CSAPIQueryBuilder to match the DataStream equivalents, per OGC 23-002 Tables 5 and 10.

Finding Reference: Demo app finding from ogc-csapi-explorer#34 — ControlStream detail views could not display Systems/Procedures relationship cards because the URL builder methods don't exist.
Severity: Moderate
Category: Design gap
Ownership: Ours


Problem Statement

The CSAPIQueryBuilder provides five sub-resource navigation methods for DataStream but only three for ControlStream:

Navigation DataStream ControlStream
Schema getDataStreamSchema ✅ getControlStreamSchema ✅
Child resources getDataStreamObservations ✅ getControlStreamCommands ✅
Systems getDataStreamSystems ✅ MISSING ❌
Procedures getDataStreamProcedures ✅ MISSING ❌
History getDataStreamHistory ✅ MISSING ❌

OGC 23-002 Tables 5 (DataStream Associations, §9.2.2) and 10 (ControlStream Associations, §10.2.2) define identical association structures — both have system, procedure, deployment, samplingFeatures, and featuresOfInterest. There is no specification basis for this asymmetry.

Additionally, history is implemented for every other resource type — ControlStream is the only gap:

  • getSystemHistory ✅ • getDeploymentHistory ✅ • getProcedureHistory ✅ • getSamplingFeatureHistory ✅ • getPropertyHistory ✅ • getDataStreamHistory ✅ • getObservationHistory ✅ • getControlStreamHistory ❌

Impact: ControlStream detail views in the explorer demo cannot display "Systems" and "Procedures" relationship cards. History navigation is unavailable for ControlStream resources.

Findings Report

📄 Issue #104 Findings Report — Full risk assessment, spec analysis, and recommendation (FIX — purely additive, zero backward compatibility risk).


Files to Create or Modify

File Action Est. Lines Purpose
src/ogc-api/csapi/url_builder.ts Modify ~+60 Add 3 methods with JSDoc
src/ogc-api/csapi/url_builder.spec.ts Modify ~+30 Add 6 test cases (3 happy-path + 3 EndpointError guards)

Proposed Fix

Add three methods to CSAPIQueryBuilder, following the exact same buildResourceUrl pattern as the DataStream equivalents:

getControlStreamSystems(id: string, options?: QueryOptions): string {
  this.assertResourceAvailable('controlStreams');
  return this.buildResourceUrl('controlStreams', id, 'systems', options);
}

getControlStreamProcedures(id: string, options?: QueryOptions): string {
  this.assertResourceAvailable('controlStreams');
  return this.buildResourceUrl('controlStreams', id, 'procedures', options);
}

getControlStreamHistory(id: string, options?: QueryOptions): string {
  this.assertResourceAvailable('controlStreams');
  return this.buildResourceUrl('controlStreams', id, 'history', options);
}

All three follow the existing pattern — no changes to URL assembly logic, types, or infrastructure.

Scope — What NOT to Touch

Acceptance Criteria

  • getControlStreamSystems(id, options?) method exists and generates controlStreams/{id}/systems URLs
  • getControlStreamProcedures(id, options?) method exists and generates controlStreams/{id}/procedures URLs
  • getControlStreamHistory(id, options?) method exists and generates controlStreams/{id}/history URLs
  • All new methods have complete JSDoc documentation with @see links to OGC 23-002
  • 3 happy-path URL generation tests pass
  • 3 EndpointError guard tests pass
  • Existing tests still pass (npm test)
  • No lint errors

Dependencies

Blocked by: Nothing
Blocks: ogc-csapi-explorer#34 — relationship cards for ControlStream detail views


Operational Constraints

⚠️ MANDATORY: Before starting work on this issue, review docs/governance/AI_OPERATIONAL_CONSTRAINTS.md.

Key constraints:

  • Precedence: OGC specifications → AI Collaboration Agreement → This issue description → Existing code → Conversational context
  • No scope expansion: Fix the finding, nothing more
  • No server-specific branches: Fixes must be general-purpose, not "if OSH" / "if 52N"
  • Minimal diffs: Prefer the smallest change that satisfies the acceptance criteria

References

# Document What It Provides
1 Issue #104 Findings Report Full risk assessment and FIX recommendation
2 OGC 23-002 §9.2.2 Table 5 DataStream associations (system, procedure, deployment, etc.)
3 OGC 23-002 §10.2.2 Table 10 ControlStream associations (identical structure)
4 AI_OPERATIONAL_CONSTRAINTS.md Authority precedence and stop conditions
5 src/ogc-api/csapi/url_builder.ts L1615–1670 DataStream blueprint (Systems, Procedures, History methods)
6 src/ogc-api/csapi/url_builder.spec.ts L1896–1961 DataStream test blueprint

Related Issues

  • #102 — ControlStream query parameter model incomplete (DEFERRED)
  • #103 — Cross-reference fields not extracted in Part 2 parsers (FIXED)
  • ogc-csapi-explorer#34 — Add related-resource cards (blocked by this issue)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugurl-builder

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions