Skip to main content

oxirs_physics/sync/
mod.rs

1//! Bidirectional synchronization between physics state and RDF.
2//!
3//! The existing parameter-extraction pipeline (`crate::simulation::ParameterExtractor`)
4//! handles the **RDF → physics** direction: pull entity properties from an
5//! RDF graph, parse typed literals, run a simulation. This module adds the
6//! reverse direction:
7//!
8//! 1. [`state_to_rdf`] — render a physics state vector as RDF triples in a
9//!    dedicated "state graph".
10//! 2. [`rdf_to_state`] — re-extract parameters from the RDF graph and rebuild
11//!    a physics state vector (used after an external update).
12//! 3. [`bidirectional`] — orchestrates periodic, snapshot-isolated round
13//!    trips between the two halves.
14//!
15//! State diffs use an in-house comparison (HashMap<String, f64>); we do not
16//! pull in the SAMM aspect-differ for scalar diffs.
17
18pub mod bidirectional;
19pub mod rdf_to_state;
20pub mod state_to_rdf;
21
22pub use bidirectional::{
23    BidirectionalSync, BidirectionalSyncConfig, BidirectionalSyncReport, SyncDirection,
24};
25pub use rdf_to_state::{RdfToStateExtractor, RdfToStateOutput};
26pub use state_to_rdf::{
27    state_diff, PhysicsState, PhysicsStateValue, StateDiff, StateGraphConfig, StateToRdfWriter,
28};