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 SimpleProcess descriptors that parses the AbstractProcess-level properties (definition, typeOf, configuration, featuresOfInterest, inputs, outputs, parameters, modes) and the SimpleProcess-specific method property, converting raw JSON into typed SimpleProcess objects.
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) — fixture-based tests with descriptive names.
Scope — What to Implement
Parser Function
/** * Parse a raw SensorML 3.0 SimpleProcess JSON object into a typed SimpleProcess. * * @param json - Raw JSON object with `type: 'SimpleProcess'` * @returns Parsed SimpleProcess object * @throws {SensorMLParseError} If the input is not a valid SimpleProcess * @see https://docs.ogc.org/is/23-000/23-000.html — OGC SensorML 3.0 */exportfunctionparseSimpleProcess(json: unknown): SimpleProcess
Properties to Parse
From AbstractProcess (inherited via DescribedObject → AbstractProcess → SimpleProcess):
The SimpleProcess sub-parser is responsible for parsing AbstractProcess-level properties that go beyond the base DescribedObject metadata. The DescribedObject-level properties (id, uniqueId, label, description, identifiers, classifiers, validTime, capabilities, characteristics, contacts, documents, history, securityConstraints, legalConstraints) may be parsed by shared helper functions that the main parser (Issue #22) coordinates, but this sub-parser must at minimum handle the AbstractProcess additions:
Property
Type
Required
OGC Spec
Description
type
'SimpleProcess' (const)
Yes
Part 1 L3681
Type discriminator
definition
string (URI)
No
Part 1 L3608
Process type as URI to ontology concept
typeOf
link-2
No
Part 1 L3612
Reference to base process this inherits from
configuration
Settings
No
Part 1 L3616
Value settings constraining base process properties
featuresOfInterest
FeatureList (link-2[])
No
Part 1 L3619
Sampling/domain features relevant to process
inputs
InputList (IOComponentChoice[])
No
Part 1 L3623
Process input specifications
outputs
OutputList (IOComponentChoice[])
No
Part 1 L3626
Process output specifications
parameters
ParameterList (IOComponentChoice[])
No
Part 1 L3629
Configuration parameters
modes
Mode[]
No
Part 1 L3632
Operating modes with configurations
SimpleProcess-specific property:
Property
Type
Required
OGC Spec
Description
method
ProcessMethod
No
Part 1 L3686
Algorithm description (machine-readable or natural language)
ProcessMethod structure (Part 1 L3671):
interfaceProcessMethod{algorithm?: unknown;// Machine-readable algorithm (inline or by reference)description?: string;// Natural language description}
IOComponentChoice structure (Part 1 L3662):
Each input/output/parameter entry is a SoftNamedProperty combined with either:
A SWE Common AnyComponent (DataComponent) — for typed data descriptions
An ObservableProperty ({ type: 'ObservableProperty', definition: string }) — for observable property references
Error Handling
Throw a descriptive error if type is not 'SimpleProcess'
Throw if inputs/outputs/parameters items have invalid IOComponentChoice structure
Spec example fixtures: Test parsing a minimal valid SimpleProcess (type + required DescribedObject props)
Full document parsing: Test with all optional properties populated (inputs, outputs, parameters, method, modes, etc.)
Method parsing: Test ProcessMethod with algorithm only, description only, and both
I/O parsing: Test inputs/outputs/parameters with both AnyComponent and ObservableProperty variants
Invalid document handling: Test with missing type, wrong type value, malformed inputs
Edge cases: Test with empty arrays, null optional fields, unknown extra properties
Follow test patterns from src/ogc-api/edr/model.spec.ts
Scope — What NOT to Touch
❌ Do NOT parse DescribedObject-level properties independently — shared parsing helpers belong to Issue Phase 3, Task 9: SensorML Main Parser #22 (SensorML Main Parser); this sub-parser should accept already-parsed base properties or provide a function the main parser calls
Task
Implement a sub-parser for SensorML 3.0
SimpleProcessdescriptors that parses theAbstractProcess-level properties (definition,typeOf,configuration,featuresOfInterest,inputs,outputs,parameters,modes) and theSimpleProcess-specificmethodproperty, converting raw JSON into typedSimpleProcessobjects.ROADMAP Reference: Phase 3, Task 6 — SensorML Simple Process Parser (~2-3 hours, Medium-High complexity)
Files to Create or Modify
src/ogc-api/csapi/formats/sensorml/simple-process.tssrc/ogc-api/csapi/formats/sensorml/simple-process.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) — fixture-based tests with descriptive names.Scope — What to Implement
Parser Function
Properties to Parse
From
AbstractProcess(inherited viaDescribedObject → AbstractProcess → SimpleProcess):The SimpleProcess sub-parser is responsible for parsing
AbstractProcess-level properties that go beyond the baseDescribedObjectmetadata. TheDescribedObject-level properties (id, uniqueId, label, description, identifiers, classifiers, validTime, capabilities, characteristics, contacts, documents, history, securityConstraints, legalConstraints) may be parsed by shared helper functions that the main parser (Issue #22) coordinates, but this sub-parser must at minimum handle theAbstractProcessadditions:type'SimpleProcess'(const)definitionstring(URI)typeOflink-2configurationSettingsfeaturesOfInterestFeatureList(link-2[])inputsInputList(IOComponentChoice[])outputsOutputList(IOComponentChoice[])parametersParameterList(IOComponentChoice[])modesMode[]SimpleProcess-specific property:methodProcessMethodProcessMethodstructure (Part 1 L3671):IOComponentChoicestructure (Part 1 L3662):Each input/output/parameter entry is a
SoftNamedPropertycombined with either:AnyComponent(DataComponent) — for typed data descriptionsObservableProperty({ type: 'ObservableProperty', definition: string }) — for observable property referencesError Handling
typeis not'SimpleProcess'inputs/outputs/parametersitems have invalidIOComponentChoicestructureundefined)definitionproperty if presentJSDoc Requirements
parseSimpleProcessfunction with@param,@returns,@throws,@see@seelinks to OGC SensorML 3.0 (23-000) and Part 1 spec line numbersparseProcessMethod,parseIOComponentChoice)src/ogc-api/edr/model.tsTesting Requirements
src/ogc-api/csapi/formats/sensorml/simple-process.spec.ts(~100-150 lines)ProcessMethodwithalgorithmonly,descriptiononly, and bothinputs/outputs/parameterswith bothAnyComponentandObservablePropertyvariantstype, wrongtypevalue, malformed inputssrc/ogc-api/edr/model.spec.tsScope — What NOT to Touch
DescribedObject-level properties independently — shared parsing helpers belong to Issue Phase 3, Task 9: SensorML Main Parser #22 (SensorML Main Parser); this sub-parser should accept already-parsed base properties or provide a function the main parser callsAggregateProcessparsing — that belongs to Issue Phase 3, Task 7: SensorML Aggregate Process Parser #20 (SensorML Aggregate Process Parser)PhysicalSystemorPhysicalComponentparsing — those belong to Issues Phase 3, Task 8: SensorML Physical System Parser #21 (Physical System Parser)formats/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 typeAcceptance Criteria
src/ogc-api/csapi/formats/sensorml/simple-process.tsexists withparseSimpleProcessfunctionAbstractProcess-level properties (definition, typeOf, configuration, featuresOfInterest, inputs, outputs, parameters, modes)SimpleProcess-specificmethodproperty withProcessMethodstructureIOComponentChoiceentries in inputs/outputs/parameters (both AnyComponent and ObservableProperty variants)@seelinkssimple-process.spec.tsexists with tests for valid parsing, method parsing, I/O parsing, invalid documents, and edge casesnpm test)Dependencies
Blocked by:
SimpleProcess,ProcessMethod,IOComponentChoice, and related type definitions)SWEDataComponent,AnyComponenttypes used in IOComponentChoice)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.mdSimpleProcessinterface andSensorMLProcessunionsrc/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)SimpleProcess,ProcessMethod,IOComponentChoice,Mode,Settings,ObservablePropertysrc/ogc-api/csapi/formats/swecommon/types.ts(Issue #17)SWEDataComponent/AnyComponent(viaimport typeonly)Research References (context, not required reading)
docs/planning/ROADMAP.md(Lines 407-415)Specification References (for
@seelinks and field accuracy)@seetargetdocs/research/standards/ogcapi-connectedsystems-1.bundled.oas31.yamlSimpleProcessschema (L3679),AbstractProcess(L3599),ProcessMethod(L3671),IOComponentChoice(L3662),InputList/OutputList/ParameterList(L3584-3596)Convention Quick Reference
.jsextension for relative importsimport type { SimpleProcess } from './types.js'import typefor interfaces/typesimport type { SimpleProcess } from './types.js'export function parseSimpleProcess(json: unknown): SimpleProcessglobalThis.fetch = jest.fn()