sbol_convert/lib.rs
1//! SBOL version conversion for the sbol-rs ecosystem.
2//!
3//! This crate converts between SBOL 2 and SBOL 3 at the RDF triple level.
4//! [`upgrade`] converts a parsed [`sbol2::Document`] in memory, and
5//! [`upgrade_from_sbol2`] and friends read SBOL 2 RDF text or files; both
6//! build an [`sbol3::Document`]. [`downgrade`] takes an [`sbol3::Document`]
7//! and emits the equivalent SBOL 2 RDF graph. Every conversion also returns
8//! a report of any non-fatal issues encountered along the way.
9#![forbid(unsafe_code)]
10// Conversion errors carry the full context needed to diagnose a failed
11// pipeline; boxing the large error arms would split that surface.
12#![allow(clippy::result_large_err)]
13
14mod downgrade;
15mod sbol2_vocab;
16mod upgrade;
17mod uri;
18
19pub use downgrade::{
20 DowngradeCounts, DowngradeError, DowngradeOptions, DowngradeReport, DowngradeWarning,
21 downgrade, downgrade_with, sbol3_to_sbol2,
22};
23pub use upgrade::{
24 MapsToSide, NamespaceSource, UpgradeCounts, UpgradeError, UpgradeFromPathError, UpgradeOptions,
25 UpgradeReport, UpgradeWarning, canonical_nt_line, parse_and_upgrade, sbol2_to_sbol3, upgrade,
26 upgrade_from_sbol2, upgrade_from_sbol2_path, upgrade_from_sbol2_with, upgrade_with,
27};