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
Implement a sub-parser for SensorML 3.0 PhysicalSystem and PhysicalComponent descriptors that parses the AbstractPhysicalProcess-level properties (attachedTo, localReferenceFrames, localTimeFrames, position) and the type-specific properties: components/connections for PhysicalSystem, method for PhysicalComponent. This covers both concrete physical process types in one file since they share the AbstractPhysicalProcess base.
Follow the EDR parser/helper patterns in src/ogc-api/edr/model.ts (126 lines) for function structure and JSDoc style. For test patterns, follow src/ogc-api/edr/model.spec.ts (42 lines). The SimpleProcess sub-parser from Issue #19 and AggregateProcess sub-parser from Issue #20 are sibling sub-parsers — follow their structure for shared AbstractProcess-level parsing.
Scope — What to Implement
Parser Functions
/** * Parse a raw SensorML 3.0 PhysicalSystem JSON object into a typed PhysicalSystem. * * PhysicalSystem is a composite physical system with position, nested * components, and data flow connections. Extends AbstractPhysicalProcess. * * @param json - Raw JSON object with `type: 'PhysicalSystem'` * @returns Parsed PhysicalSystem object * @throws {SensorMLParseError} If the input is not a valid PhysicalSystem * @see https://docs.ogc.org/is/23-000/23-000.html — OGC SensorML 3.0 */exportfunctionparsePhysicalSystem(json: unknown): PhysicalSystem/** * Parse a raw SensorML 3.0 PhysicalComponent JSON object into a typed PhysicalComponent. * * PhysicalComponent is a single physical sensor or actuator with position * and method description. Extends AbstractPhysicalProcess. * * @param json - Raw JSON object with `type: 'PhysicalComponent'` * @returns Parsed PhysicalComponent object * @throws {SensorMLParseError} If the input is not a valid PhysicalComponent * @see https://docs.ogc.org/is/23-000/23-000.html — OGC SensorML 3.0 */exportfunctionparsePhysicalComponent(json: unknown): PhysicalComponent
Both PhysicalSystem and PhysicalComponent share AbstractPhysicalProcess-level properties. Shared parsing logic for both should be factored into a helper function (e.g., parseAbstractPhysicalProcessProps).
AbstractPhysicalProcess Properties (Part 1 L4020)
These properties are unique to the physical process types and must be parsed by this sub-parser:
Property
Type
Required
OGC Spec
Description
attachedTo
link-2
No
Part 1 L4027
Reference to host platform/system this is attached to
localReferenceFrames
SpatialFrame[]
No
Part 1 L4030
Local spatial reference frames attached to the physical component
localTimeFrames
TemporalFrame[]
No
Part 1 L4035
Local temporal reference frames (e.g., "time past mission start")
position
Position
No
Part 1 L4040
Positional information (location and/or orientation)
Position Union Type (Part 1 L4089)
Position is a oneOf with 8 variants (3 deprecated):
Variant
Type
Description
by Text
Text (SWE Common)
Textual description of location (building, room)
by Point
GeoJSON Point
Geographic coordinates (WGS84)
by Pose
Pose
Full 6DOF position + orientation
by Process
AbstractProcess
Dynamic position from a process
by Datastream
link-2
Link to a datastream providing position
by Location Vector
Vector (deprecated)
SWE Common Vector
by Position DataRecord
DataRecord (deprecated)
SWE Common DataRecord
by Trajectory DataArray
DataArray (deprecated)
SWE Common DataArray
The parser must handle at minimum: Text, Point, Pose, and link-2 variants. Deprecated variants may be handled as passthrough.
Pose Structure (Part 1 L3825)
Pose is a oneOf of 4 variants:
GeoPose YPR: { type: 'GeoPose', position: { lat, lon, h }, angles: { yaw, pitch, roll } }
GeoPose Quaternion: { type: 'GeoPose', position: { lat, lon, h }, quaternion: { x, y, z, w } }
Relative Pose YPR: { type: 'RelativePose', referenceFrame: URI, position: { x, y, z }, angles: { yaw, pitch, roll } }
Relative Pose Quaternion: { type: 'RelativePose', referenceFrame: URI, position: { x, y, z }, quaternion: { x, y, z, w } }
{label?: string;
description?: string;
origin: string;// Required: context of time start}
PhysicalSystem-Specific Properties (Part 1 L4140)
Property
Type
Required
OGC Spec
Description
type
'PhysicalSystem' (const)
Yes
Part 1 L4148
Type discriminator
components
ComponentList
No
Part 1 L4150
Array of named sub-components
connections
ConnectionList
No
Part 1 L4153
Data flow connections between components
ComponentList and ConnectionList are the same structures as in AggregateProcess (Issue #20). The parser can reuse/import the same component/connection parsing logic.
Same inherited properties as Issues #19/#20 (definition, typeOf, configuration, featuresOfInterest, inputs, outputs, parameters, modes). The DescribedObject-level properties may be parsed by shared helpers in the main parser (Issue #22).
Error Handling
Throw a descriptive error if type is not 'PhysicalSystem' or 'PhysicalComponent' (depending on which function is called)
Throw if position is present but has an unrecognizable variant
Throw if localReferenceFrames entries are missing required origin or axes
❌ Do NOT modify files outside the "Files to Create or Modify" table above
❌ Do NOT refactor existing code unless required to complete this task
Acceptance Criteria
src/ogc-api/csapi/formats/sensorml/physical-system.ts exists with both parsePhysicalSystem and parsePhysicalComponent functions
Parser handles all AbstractPhysicalProcess-level properties (attachedTo, localReferenceFrames, localTimeFrames, position)
Position parsing handles Text, Point, Pose (all 4 variants), link, and deprecated variants
SpatialFrame and TemporalFrame parsing validates required fields
PhysicalSystem handles components (ComponentList) and connections (ConnectionList)
PhysicalComponent handles method (ProcessMethod)
Shared AbstractPhysicalProcess parsing logic factored into reusable helper
Descriptive errors thrown for invalid documents
All new code has complete JSDoc documentation with @see links
physical-system.spec.ts exists with tests for both types, position parsing, frame parsing, component hierarchy, and edge cases
Existing tests still pass (npm test)
No lint errors
Dependencies
Blocked by:
Issue Phase 3, Task 5: SensorML Types #18 — SensorML Types (provides PhysicalSystem, PhysicalComponent, Position, Pose, SpatialFrame, TemporalFrame, and related type definitions)
Issue Phase 3.4: SWE Common Types #17 — SWE Common Types (provides SWEDataComponent, AnyComponent, Text, Vector, DataRecord, DataArray types used in Position union)
Task
Implement a sub-parser for SensorML 3.0
PhysicalSystemandPhysicalComponentdescriptors that parses theAbstractPhysicalProcess-level properties (attachedTo,localReferenceFrames,localTimeFrames,position) and the type-specific properties:components/connectionsfor PhysicalSystem,methodfor PhysicalComponent. This covers both concrete physical process types in one file since they share theAbstractPhysicalProcessbase.ROADMAP Reference: Phase 3, Task 8 — SensorML Physical System Parser (~2-3 hours, Medium-High complexity)
Files to Create or Modify
src/ogc-api/csapi/formats/sensorml/physical-system.tssrc/ogc-api/csapi/formats/sensorml/physical-system.spec.tsBlueprint Reference
Follow the EDR parser/helper patterns in
src/ogc-api/edr/model.ts(126 lines) for function structure and JSDoc style. For test patterns, followsrc/ogc-api/edr/model.spec.ts(42 lines). TheSimpleProcesssub-parser from Issue #19 andAggregateProcesssub-parser from Issue #20 are sibling sub-parsers — follow their structure for sharedAbstractProcess-level parsing.Scope — What to Implement
Parser Functions
Inheritance Chain
Both
PhysicalSystemandPhysicalComponentshareAbstractPhysicalProcess-level properties. Shared parsing logic for both should be factored into a helper function (e.g.,parseAbstractPhysicalProcessProps).AbstractPhysicalProcess Properties (Part 1 L4020)
These properties are unique to the physical process types and must be parsed by this sub-parser:
attachedTolink-2localReferenceFramesSpatialFrame[]localTimeFramesTemporalFrame[]positionPositionPosition Union Type (Part 1 L4089)
Positionis aoneOfwith 8 variants (3 deprecated):Text(SWE Common)PointPoseAbstractProcesslink-2by Location VectorVector(deprecated)by Position DataRecordDataRecord(deprecated)by Trajectory DataArrayDataArray(deprecated)The parser must handle at minimum: Text, Point, Pose, and link-2 variants. Deprecated variants may be handled as passthrough.
Pose Structure (Part 1 L3825)
Poseis aoneOfof 4 variants:{ type: 'GeoPose', position: { lat, lon, h }, angles: { yaw, pitch, roll } }{ type: 'GeoPose', position: { lat, lon, h }, quaternion: { x, y, z, w } }{ type: 'RelativePose', referenceFrame: URI, position: { x, y, z }, angles: { yaw, pitch, roll } }{ type: 'RelativePose', referenceFrame: URI, position: { x, y, z }, quaternion: { x, y, z, w } }SpatialFrame Structure (Part 1 L4048)
TemporalFrame Structure (Part 1 L4078)
PhysicalSystem-Specific Properties (Part 1 L4140)
type'PhysicalSystem'(const)componentsComponentListconnectionsConnectionListComponentListandConnectionListare the same structures as inAggregateProcess(Issue #20). The parser can reuse/import the same component/connection parsing logic.PhysicalComponent-Specific Properties (Part 1 L4102)
type'PhysicalComponent'(const)methodProcessMethodAbstractProcess-Level Properties
Same inherited properties as Issues #19/#20 (definition, typeOf, configuration, featuresOfInterest, inputs, outputs, parameters, modes). The
DescribedObject-level properties may be parsed by shared helpers in the main parser (Issue #22).Error Handling
typeis not'PhysicalSystem'or'PhysicalComponent'(depending on which function is called)positionis present but has an unrecognizable variantlocalReferenceFramesentries are missing requiredoriginoraxesundefined)JSDoc Requirements
parsePhysicalSystemandparsePhysicalComponentwith@param,@returns,@throws,@see@seelinks to OGC SensorML 3.0 (23-000) and Part 1 spec line numbersparsePosition,parsePose,parseSpatialFrame,parseAbstractPhysicalProcessProps)src/ogc-api/edr/model.tsTesting Requirements
src/ogc-api/csapi/formats/sensorml/physical-system.spec.ts(~150-200 lines)src/ogc-api/edr/model.spec.tsScope — What NOT to Touch
SimpleProcessparsing — that belongs to Issue Phase 3, Task 6: SensorML Simple Process Parser #19AggregateProcessparsing — that belongs to Issue Phase 3, Task 7: SensorML Aggregate Process Parser #20formats/sensorml/parser.ts(main parser) — that belongs to Issue Phase 3, Task 9: SensorML Main Parser #22 (SensorML Main Parser)formats/sensorml/index.tsbarrel file — that belongs to Issue Phase 3, Task 10: SensorML Index #23 (SensorML Index)import typeDescribedObject-level properties independently — shared parsing helpers belong to Issue Phase 3, Task 9: SensorML Main Parser #22Acceptance Criteria
src/ogc-api/csapi/formats/sensorml/physical-system.tsexists with bothparsePhysicalSystemandparsePhysicalComponentfunctionsAbstractPhysicalProcess-level properties (attachedTo, localReferenceFrames, localTimeFrames, position)components(ComponentList) andconnections(ConnectionList)method(ProcessMethod)AbstractPhysicalProcessparsing logic factored into reusable helper@seelinksphysical-system.spec.tsexists with tests for both types, position parsing, frame parsing, component hierarchy, and edge casesnpm test)Dependencies
Blocked by:
PhysicalSystem,PhysicalComponent,Position,Pose,SpatialFrame,TemporalFrame, and related type definitions)SWEDataComponent,AnyComponent,Text,Vector,DataRecord,DataArraytypes used in Position union)Blocks:
Operational Constraints
Key constraints for this task:
References
Read these documents before starting implementation. They are ordered by priority.
Primary References (must read)
docs/planning/csapi-implementation-guide.mddocs/planning/csapi-implementation-guide.mdPhysicalSystem,PhysicalComponentinterfaces and Position/Component structuressrc/ogc-api/edr/model.tssrc/ogc-api/edr/model.spec.tsUpstream Type/Import References (files this task imports from)
src/ogc-api/csapi/formats/sensorml/types.ts(Issue #18)PhysicalSystem,PhysicalComponent,Position,Pose,SpatialFrame,TemporalFrame,ComponentList,ConnectionList,ProcessMethodsrc/ogc-api/csapi/formats/swecommon/types.ts(Issue #17)Text,Vector,DataRecord,DataArray(viaimport typefor Position variants)Sibling References (same pattern)
src/ogc-api/csapi/formats/sensorml/simple-process.ts(Issue #19)src/ogc-api/csapi/formats/sensorml/aggregate-process.ts(Issue #20)Research References (context, not required reading)
docs/planning/ROADMAP.md(Lines 427-435)Specification References (for
@seelinks and field accuracy)@seetargetdocs/research/standards/ogcapi-connectedsystems-1.bundled.oas31.yamlPhysicalSystem(L4140),PhysicalComponent(L4102),AbstractPhysicalProcess(L4020),Position(L4089),Pose(L3825),SpatialFrame(L4048),TemporalFrame(L4078),ComponentList(L4112),ConnectionList(L4127)Convention Quick Reference
.jsextension for relative importsimport type { PhysicalSystem } from './types.js'import typefor interfaces/typesimport type { PhysicalSystem, Position } from './types.js'export function parsePhysicalSystem(json: unknown): PhysicalSystemglobalThis.fetch = jest.fn()