Skip to content

Port SysML→GDS prototype from unity-GDS-experiments to gds-core #190

@rororowyourboat

Description

@rororowyourboat

Summary

Port the working SysML v2 → GDS pipeline from unity-GDS-experiments into gds-core as the foundation for the gds-sysml package (#188).

What exists in unity-GDS-experiments

File Lines What it does
sysml_parser.py 649 Regex-based SysML v2 parser with @gds* annotation extraction
sysml_to_rdf.py 387 SysMLModel → rdflib.Graph using gds-core ontology
spec_builder.py 839 End-to-end lifecycle: parse → RDF → GDSSpec → compile → verify
sysml_validator.py 250+ Structural validation for parsed SysML models
simple_satellite.sysml 589 Reference model: 19 part defs, 80+ @gds* annotations
test_rdf_roundtrip.py 146 37 tests: RDF graph structure, roundtrip fidelity, 29+6 verification
test_spec_builder.py 216 21 tests: block structure, semantic checks, structural annotations

Total: 194 tests passing, pipeline produces a GDSSpec with 7 blocks, 20 state variables, 14 parameters.

What needs to change during port

  1. Namespace: gds_lifecycle.sysml_parsergds_sysml.parser.regex
  2. RDF construction: Replace imperative triple building in sysml_to_rdf.py with SPARQL CONSTRUCT queries (Research spike: OSLC SysML v2 → GDS ontology SPARQL CONSTRUCT mapping #189) — or keep as initial implementation and refactor later
  3. Remove satellite-specific hardcoding: sysml_to_rdf.py has canonical state variable and parameter lists (lines 54-67) specific to the satellite model. The generic pipeline should derive these from @gds* metadata only.
  4. Unit mapping table: The unit→TypeDef mapping (lines 34-51 in sysml_to_rdf.py) should be configurable, not hardcoded
  5. Package structure: Follow gds-owl's structure (export.py, import_.py, _namespace.py)
  6. Test fixtures: Extract simple_satellite.sysml as a test fixture, add at least one non-satellite model

Acceptance Criteria

  • All 37 RDF roundtrip tests pass in new location
  • All 21 spec builder tests pass
  • simple_satellite.sysml produces identical GDSSpec (29/29 + 6/6 checks)
  • No satellite-specific hardcoding in the generic pipeline
  • Package installable as gds-sysml in workspace

Dependencies

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestroadmapImprovement roadmap itemtier-3Tier 3: Research Frontier

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions