motion-spec-dsl¶
motion-spec-dsl is a textX language for writing
guarded robot motion specifications in .robmot files and generating RDF motion-spec
graphs for the rest of the motion-spec toolchain.
Tutorial — the
.robmotlanguage, section by section.
Setup¶
Use Python 3.10 or newer.
python -m venv .venv
source .venv/bin/activate
pip install -e .
Graph generation needs METAMODELS_PATH so the generated application manifest can map
ontology IRIs to local metamodel files:
export METAMODELS_PATH=/path/to/secorolab/metamodels
Pipeline¶
You author a .robmot file; the DSL validates it and emits an RDF graph plus an
application manifest, which the downstream motion-spec toolchain lowers to C++.
textx generate models/ex.robmot --target jsonld -o build/
This writes:
build/ex.jsonld— the motion-spec graph as JSON-LDbuild/ex-app.jsonld— an application manifest listing the graph, its SHACL/ontology constraints, and local IRI mappings
The DSL stops at graph generation; code generation consumes the JSON-LD and manifest.
Validate without keeping output¶
python - <<'PY'
from motion_spec_dsl.registration import motion_spec_metamodel
motion_spec_metamodel().model_from_file("models/ex.robmot")
print("ok")
PY