Skip to content

SysML v2 · KerML 1.1 · written in Go

A SysML v2 toolchain that runs the model, not just reads it.

OpenSysML materializes the instances a model describes, evaluates their features with units carried and checked, performs actions and advances state machines on a clock, and decides requirements and analysis objectives against what it finds — so it reports what a validator or expression evaluator cannot reach: the rollup with an unvalued leaf, the result in the wrong dimension, the action with no step to start at. It also parses, validates, serves an editor over LSP and exports RDF, with Go, Python, Node, Java and Rust clients for the same runtime.

Apache-2.0 · Linux, macOS and Windows binaries · loads the Apollo 11 model in 0.43 s, and finds what running it turns up

sysml — REPL
$ sysml -quiet -analysis DeltaVBudget::saturnIBAscent delta-v-budget.sysml
✓ package DeltaVBudget
✓ DeltaVBudget::saturnIBAscent
  stage1DeltaV = 3037.6966629706967 [SI::'m/s']
  stage2DeltaV = 6432.955324716369 [SI::'m/s']
  margin = 70.65198768706614 [SI::'m/s']
  objective reachesOrbit: satisfied
  standing: value (observed: 1 run under reverse)

$ sysml -quiet -analysis "DeltaVBudget::saturnIBAscent(required = 9800 ['m/s'])" delta-v-budget.sysml
✓ package DeltaVBudget
✗ DeltaVBudget::saturnIBAscent(required = 9800 ['m/s'])
  
  margin = -329.34801231293386 [SI::'m/s']
  objective reachesOrbit: not satisfied: margin > 0 ['m/s']
  standing: value (observed: 1 run under reverse)
The runtime showcase, with this model
$ sysml -quiet -validate mass-rollup.sysml
✓ package MassRollup
✓ mass-rollup.sysml: no errors

$ sysml -quiet -e MassRollup::saturnVWithIU.totalMass mass-rollup.sysml
✓ package MassRollup
sysml: evaluation failed: feature value saturnVWithIU.totalMass: feature value InstrumentUnit.totalMass: no value for feature mass

$ sysml -quiet -calc "DeltaVBudget::InjectionDeltaV(3.986E14 [SI::N], 6563000 [SI::m], 384400000 [SI::m])" delta-v-budget.sysml
✓ package DeltaVBudget
sysml: calc invocation failed: calc DeltaVBudget::InjectionDeltaV: result: type mismatch: cannot write 3135.1638390999387 [kg**0.5/s] (dimension M^0.5·T^-1) to a feature typed by SpeedValue (dimension L·T^-1)
  standing: not covered (…)
Every one of these, reproduced
sysml> part def Wheel { attribute diameter = 16.0; }
✓ part def Wheel

sysml> %instantiate Wheel
✓ Created instance of Wheel
  ID: 1

sysml> %features Wheel
Instance: Wheel (ID: 1)
Features:
  diameter = 16.0
  

sysml> calc add { in x; in y; x + y }
✓ calc add

sysml> %calc add 10 20
✓ add(10, 20)
  = 30
  standing: value (observed: 1 run under reverse)
The REPL, in the guide
$ sysml rover.sysml -render-document Hello::RoverReport
✓ package Hello
# Rover Parts

The rover's top-level parts, from the model:

<!-- caption -->
*Top-level parts*

| name |
| --- |
| arm |
| chassis |
| mast |

$ sysml rover.sysml -render-document Hello::RoverReport -doc-form html -o rover.html
✓ package Hello
wrote rover.html (html, 4983 bytes)   # or -doc-form pdf
The document generation manual
$ sysml -validate vehicles.sysml
vehicles.sysml:6:16: error: unresolved reference: Whel — did you mean Wheel?
        part spare : Whel;
                     ^~~~
sysml: vehicles.sysml did not analyse cleanly; no check was made

$ echo $?
2

$ sed -i 's/Whel/Wheel/' vehicles.sysml && sysml -validate vehicles.sysml
✓ package Vehicles
✓ vehicles.sysml: no errors
Checking a model, in the guide
sysml> state def TrafficLight {
  ...>     entry; then green;
  ...>     state green;  accept after 25 [SI::s] then yellow;
  ...>     state yellow; accept after 5 [SI::s] then red;
  ...>     state red;    accept after 30 [SI::s] then done;
  ...> }
✓ state def TrafficLight

sysml> %state TrafficLight
✓ Started state machine executor for "TrafficLight"
  Current state: green

sysml> %advance 25
✓ Advanced to 25.0 (1 event(s) processed)
  Current state: yellow

sysml> %advance 35
✓ Advanced to 60.0 (2 event(s) processed)
✓ State machine completed (a transition reached `done`)
Executing behavior, in the guide
$ sysml vehicles.sysml -convert ttl -o vehicles.ttl
note: RDF conversion is experimental: the mapping covers model structure and the behavior its bodies state, refuses what it cannot write back, …
wrote vehicles.ttl (ttl, 5562 bytes)
$ grep -A5 '^elmt:Vehicles__Wheel$' vehicles.ttl
elmt:Vehicles__Wheel
    a sysml:PartDefinition ;
    sysml:qualifiedName "Vehicles::Wheel" ;
    sysml:elementId "Vehicles__Wheel" ;
    sysx:memberIndex "1"^^xsd:integer ;
    sysml:owningNamespace elmt:Vehicles ;

$ sysml vehicles.ttl -convert sysml   # and back again
note: RDF conversion is experimental: …
package Vehicles {
    part def Wheel;
  

$ sysml -query 'oslc.where=sysml:name="wheels"' vehicles.sysml
✓ package Vehicles
Vehicles::Car::wheels  PartUsage
Saving and RDF, in the guide
$ pip install opensysml
$ python
>>> import opensysml
>>> model = opensysml.load("vehicle.sysml")
>>> model.ok
True
>>> model.eval("mass", subject="Demo::sedan")
1800.0
>>> vehicle = model.get("Demo::Vehicle")
>>> vehicle.kind, vehicle.id
('partDef', 'Demo::Vehicle')
>>> built = model.instantiate("Demo::Vehicle")
>>> built.mass
1500.0
The clients, in the guide

Refereed against the OMG pilot implementation

Not self-assessed — measured against the reference implementation.

OpenSysML is run beside a pinned build of the OMG pilot implementation over the same models, and the two are compared wherever they can be: the diagnostics each reports, the diagnostics the reference's own test suites declare, how names resolve, and whether an invalid model is turned away. Each comparison has a committed baseline that anyone can reproduce, and the results are kept in the records rather than restated here.

What this is not: the comparison is of what two implementations report on the same files, not an official conformance suite, and no certification or percentage of the specification is claimed. The reference evaluates expressions but executes neither actions nor state machines, so behavior is beyond what it can referee. Read how each comparison is measured and what it currently reports, or which rules are faithful, approximate or missing.

8 ms to parse the Apollo 11 model — 28 files, 7,200 lines — on one core. 0.43 s to load it with the standard library, resolve every name and validate it. 42 MB/s of SysML v2 through the parser — 880 lines a millisecond.

Measured on the public Apollo 11 SysML v2 model (Airbus, MPL-2.0); the commands to repeat it are on the performance page.

Speed is the smaller point. The pinned OMG pilot validator passes all 28 files without a finding and OpenSysML's own validation reports 37 warnings and no error; asked to run the model, the runtime stops its delta-v, reliability and injection calculations and the instantiation of the mission itself at defects only execution reaches — an e that resolves to a valueless ISO 80000 quantity, a gravitational parameter typed as a force, three mission phases with no succession between them. Each is reproduced in the showcase's Apollo 11 section.

What it does

Install

# macOS
brew install Open-MBEE/tap/opensysml

# with a Go toolchain
go install github.com/Open-MBEE/OpenSysML/cmd/sysml@latest

Linux and Windows archives are on the releases page; the install page covers every route, checksums, and macOS Gatekeeper.

Compliance, stated plainly

Every construct is recorded as faithful, approximate or not implemented. No conformance certification is claimed.

Defects, declared

Where the published reference material is itself defective, the correction is declared and the corpus left as published.

Known gaps

The roadmap lists what is missing, in the order it should be picked up.

OpenSysML documentation

Using OpenSysML

The guide — a handbook, in reading order: install, your first model, the command line, the REPL, checks, behavior, saving and RDF, editors, from your own program, troubleshooting.

Runnable models live in examples/, with a catalog describing what each one demonstrates.

Document generation manual — how to generate documents from your models using the built-in document queries: concepts, getting started, a query cookbook, document authoring, outputs (Markdown, HTML and PDF), interfaces, a complete worked example and limitations and troubleshooting.

Reference

  • CLI — every sysml flag, the modes, and the exit codes
  • REPL commands — every % command and its arguments
  • LSP extensions — the custom render requests sysml-lsp offers diagram clients
  • Environment variables — resource limits for a single run, and file paths
  • Client libraries — the Go, Python, Node, Java and Rust libraries, and how to choose between them
  • Go packagesclient/opensysml and the packages behind it, type by type
  • Python API — the opensysml package, its generated typed classes, and what calls cost
  • Service transports — what sysml-grpc serves on its single port, and what happens when a capability is missing
  • RDF mapping — the triples a model becomes, which constructs are not mapped, and why the mapping is experimental
  • Grammar — how grammar productions map to the parser

Internals

  • Architecture — the pipeline, the validation tiers, and the test contracts
  • Testing — the tests each kind of change must satisfy
  • Performance — profiling, and what a large model costs
  • Design notes and plans — maintainer material

Project status

  • Spec compliance — each rule marked faithful, approximate or not implemented
  • Training examples — the OMG corpus, 100/100 clean
  • Pilot corpora gate — OpenSysML's diagnostics on the three pinned OMG pilot corpora, with CI preventing regressions
  • Pilot differential — OpenSysML's diagnostics compared against the OMG pilot implementation's
  • Grammar coverage — which OMG grammar productions the project's inputs exercise
  • Roadmap — the known gaps, in the order we plan to address them
  • Releasing — the pre-tag gate, tagging, artifacts and Homebrew
  • macOS distribution — Gatekeeper and the signing decision
  • Demo — a scripted walkthrough of the full surface

For contribution guidance, including where a new page belongs, see CONTRIBUTING.md.