Skip to content

Add SSN namespace support to featureType recognition (F83) #76

Closed

Description

@Sam-Bolling

Task

Add the W3C SSN namespace (http://www.w3.org/ns/ssn/) to featureType recognition in geojson.ts so that resources using SSN-prefixed featureTypes (e.g., ssn:Deployment) are correctly classified.

Origin: Smoke Test #18 Finding F83 — OSH server returns featureType: "http://www.w3.org/ns/ssn/Deployment" for some deployments. Our parser only checks SOSA (sosa:) and SensorML (sml:) namespaces, causing the SSN-namespaced Deployment to go unrecognized.


Files to Create or Modify

File Action Est. Lines Purpose
src/ogc-api/csapi/formats/geojson.ts Modify ~5 Add SSN_NS constant and extend toLocalName / namespace extraction logic
src/ogc-api/csapi/formats/geojson.spec.ts Modify ~10-15 Add test cases for SSN-namespaced featureTypes

Blueprint Reference

Follow the existing SOSA_NS / SENSORML_NS pattern in src/ogc-api/csapi/formats/geojson.ts (lines 28-39). The new constant follows the exact same structure.

Scope — What to Implement

SSN Namespace Constant

/** W3C SSN namespace URI. */
export const SSN_NS = 'http://www.w3.org/ns/ssn/';

Extended featureType Recognition

The getCSAPIResourceType() function (or its helper toSosaLocalName) currently strips the SOSA and SensorML namespace prefixes. It must also strip the SSN namespace prefix. The SSN ontology defines:

  • ssn:Deployment → maps to Deployment resource type
  • ssn:System → maps to System resource type

Both of these are already in the existing DEPLOYMENT_LOCAL_NAMES and SYSTEM_LOCAL_NAMES sets, so the only change is recognizing the namespace prefix itself.

Spec Context

Per OGC 23-001 §11.1:

The Deployment resource implements the ssn:Deployment concept.

The canonical URI is http://www.w3.org/ns/ssn/Deployment (SSN namespace), while the SOSA CURIE is sosa:Deployment. Both should be recognized. Similarly, ssn:System (from http://www.w3.org/ns/ssn/System) is the canonical URI referenced in §9.1.

Testing Requirements

  • Add test: ssn:Deployment featureType → recognized as 'Deployment'
  • Add test: http://www.w3.org/ns/ssn/Deployment featureType → recognized as 'Deployment'
  • Add test: http://www.w3.org/ns/ssn/System featureType → recognized as 'System'
  • Verify existing SOSA and SensorML tests still pass

Scope — What NOT to Touch

  • ❌ Do NOT modify model.ts — no interface changes needed
  • ❌ Do NOT modify classification.ts — hint-based fallback is unaffected
  • ❌ Do NOT modify response.ts — response parsing is unaffected
  • ❌ Do NOT add any new resource type names to the local name sets
  • ❌ Do NOT refactor existing namespace handling into a generic pattern (keep the focused change)

Acceptance Criteria

  • SSN_NS constant exported from geojson.ts
  • getCSAPIResourceType() correctly identifies http://www.w3.org/ns/ssn/Deployment as 'Deployment'
  • getCSAPIResourceType() correctly identifies http://www.w3.org/ns/ssn/System as 'System'
  • New tests in geojson.spec.ts cover SSN-namespaced featureTypes
  • All existing tests still pass (npm test)
  • No lint errors

Dependencies

Blocked by: Nothing
Blocks: Nothing


Operational Constraints

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

Also review docs/governance/phase-3-lessons-learned.md — Lessons 1-2 (audit upstream, Postel's Law) apply.

Key constraints:

  • Precedence: OGC specifications → AI Collaboration Agreement → This issue description → Existing code
  • No scope expansion: Only add SSN namespace support; do not restructure namespace handling
  • Minimal diffs: ~5 lines production code, ~10-15 lines test code

References

# Document Section What It Provides
1 OGC 23-001 §11.1 Deployment Overview Canonical ssn:Deployment URI
2 OGC 23-001 §9.1 System Overview Canonical ssn:System URI
3 W3C SSN Ontology Full spec SSN namespace definition
4 src/ogc-api/csapi/formats/geojson.ts lines 28-39 Constants Existing SOSA/SensorML pattern to match

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementgood first issue

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions