
sbol-rs is a Rust implementation of the Synthetic Biology Open Language
(SBOL 3.1.0). SBOL is the community standard for the exchange of
synthetic biology designs across registries, design-automation tools,
and laboratory automation pipelines. sbol-rs exposes a typed API for
reading, building, and rewriting SBOL documents, plus a validator that
covers the 109 machine-checkable rules from SBOL 3.1.0 Appendix B.
New to the codebase? Start with the crate guide.
Installation
Add the library to your Cargo.toml:
[]
= "0.2"
Or with cargo add:
The CLI ships as a separate crate. cargo install sbol-cli installs a
binary named sbol:
Example
use ;
use *;
Reading documents, traversing references across documents, expanding
combinatorial derivations, and inspecting validation reports are covered
in crates/sbol/examples/. Run any of them with
cargo run -p sbol --example <name>.
Validation
SBOL 3.1.0 Appendix B defines
149 validation rules; 40 are marked as not-to-be-machine-reported.
sbol implements an algorithm for each of the remaining 109, with
configurable scope (offline by default, or resolver-backed for
cross-document references), per-rule severity overrides, and text /
JSON / SARIF output. docs/validation.md covers
what's checked and the trust boundaries;
docs/conformance.md carries the per-rule
status grid.
Ontology Extensions
EDAM, SBO, SO, GO, ChEBI, and Cell Ontology ship bundled. NCIT and
lab-specific ontologies install on demand into a local cache; see
docs/ontology-extensions.md.
Performance
Round-trip cost (parse → serialize in the same format) on
toggle_switch_v2.ttl (~30 KB), median microseconds across 100
measured iterations (20 warmup); lower is better. Every
implementation runs in its own pinned Docker image so the rows are
apples-to-apples. Rows sorted by rdfxml p50 ascending; fastest first:
| Impl | turtle | rdfxml | jsonld | ntriples |
|---|---|---|---|---|
| sbol-rs | 352 | 368 | 750 | 393 |
| libSBOLj3 1.0.5.2 | 1,976 | 2,264 | 4,418 | 2,096 |
| sboljs 3.0.2 | n/a | 2,543 | n/a | n/a |
| pySBOL3 1.2 | 7,566 | 9,864 | 6,489 | 7,234 |
Apple M4 Max (12 performance and 4 efficiency cores), 128 GB RAM, macOS 26.3.1, Docker Desktop
29.0.1. sboljs's underlying rdfoo only emits RDF/XML and its parser
stack is too fragile to reach the other format rows on real SBOL 3
fixtures; the bench README documents
the specific failure modes. The
crates/sbol-bench crate runs the comparison
end-to-end; see benches/cross-impl/README.md
for results across smaller fixtures, full methodology, and per-row
caveats.