#![warn(
clippy::doc_markdown,
missing_debug_implementations,
rust_2018_idioms,
missing_docs
)]
#![doc = include_str!("../README.md")]
pub mod event_log {
pub mod activity_projection;
pub mod constants;
pub mod event_log_struct;
pub mod export_xes;
pub mod import_xes;
pub mod stream_xes;
pub mod ocel {
pub mod ocel_struct;
#[allow(clippy::single_match)]
pub mod xml_ocel_import;
}
pub use event_log_struct::{
Attribute, AttributeValue, Attributes, Event, EventLog, Trace, XESEditableAttribute,
};
#[cfg(test)]
mod tests;
}
pub mod petri_net {
pub mod export_pnml;
#[cfg(feature = "graphviz-export")]
pub mod image_export;
pub mod import_pnml;
pub mod petri_net_struct;
#[doc(inline)]
pub use petri_net_struct::PetriNet;
}
use std::fs::File;
use std::io::BufReader;
#[doc(inline)]
pub use event_log::ocel;
#[doc(inline)]
pub use alphappp::full::alphappp_discover_petri_net;
#[doc(inline)]
pub use event_log::import_xes::import_xes_file;
#[doc(inline)]
pub use event_log::import_xes::import_xes_slice;
#[doc(inline)]
pub use event_log::stream_xes::stream_xes_from_path;
#[doc(inline)]
pub use event_log::stream_xes::stream_xes_slice;
#[doc(inline)]
pub use event_log::stream_xes::stream_xes_slice_gz;
#[doc(inline)]
pub use event_log::stream_xes::stream_xes_file;
#[doc(inline)]
pub use event_log::stream_xes::stream_xes_file_gz;
#[doc(inline)]
pub use event_log::export_xes::export_xes_trace_stream_to_file;
#[doc(inline)]
pub use event_log::export_xes::export_xes_event_log_to_file_path;
#[doc(inline)]
pub use event_log::stream_xes::StreamingXESParser;
#[doc(inline)]
pub use event_log::import_xes::XESImportOptions;
#[doc(inline)]
pub use event_log::event_log_struct::EventLog;
#[doc(inline)]
pub use event_log::ocel::ocel_struct::OCEL;
#[doc(inline)]
pub use event_log::ocel::xml_ocel_import::import_ocel_xml;
#[doc(inline)]
pub use event_log::ocel::xml_ocel_import::import_ocel_xml_file;
#[doc(inline)]
pub use event_log::ocel::xml_ocel_import::import_ocel_xml_slice;
#[doc(inline)]
pub use petri_net::petri_net_struct::PetriNet;
#[cfg(feature = "graphviz-export")]
#[doc(inline)]
pub use petri_net::image_export::export_petri_net_image_png;
#[cfg(feature = "graphviz-export")]
#[doc(inline)]
pub use petri_net::image_export::export_petri_net_image_svg;
#[doc(inline)]
pub use petri_net::export_pnml::export_petri_net_to_pnml;
#[doc(inline)]
pub use petri_net::import_pnml::import_pnml;
#[doc(inline)]
pub use event_log::activity_projection::EventLogActivityProjection;
pub mod alphappp {
pub mod auto_parameters;
pub mod candidate_building;
pub mod candidate_pruning;
pub mod full;
pub mod log_repair;
}
pub fn petrinet_to_json(net: &PetriNet) -> String {
serde_json::to_string(net).unwrap()
}
pub fn json_to_petrinet(net_json: &str) -> PetriNet {
serde_json::from_str(net_json).unwrap()
}
pub fn ocel_to_json(ocel: &OCEL) -> String {
serde_json::to_string(ocel).unwrap()
}
pub fn json_to_ocel(ocel_json: &str) -> OCEL {
serde_json::from_str(ocel_json).unwrap()
}
pub fn import_ocel_json_from_path(path: &str) -> Result<OCEL, std::io::Error> {
let reader: BufReader<File> = BufReader::new(File::open(path)?);
Ok(serde_json::from_reader(reader)?)
}
pub fn import_ocel_json_from_slice(slice: &[u8]) -> Result<OCEL, std::io::Error> {
Ok(serde_json::from_slice(slice)?)
}