//! Utilities to read and write RDF graphs and datasets using [OxRDF I/O](https://crates.io/crates/oxrdfio). //! //! The entry points of this module are the two [`RdfParser`] and [`RdfSerializer`] structs. //! //! Usage example converting a Turtle file to a N-Triples file: //! ``` //! use oxigraph::io::{RdfFormat, RdfParser, RdfSerializer}; //! //! let turtle_file = b"@base . //! @prefix schema: . //! a schema:Person ; //! schema:name \"Foo\" . //! a schema:Person ; //! schema:name \"Bar\" ."; //! //! let ntriples_file = b" . //! \"Foo\" . //! . //! \"Bar\" . //! "; //! //! let mut writer = RdfSerializer::from_format(RdfFormat::NTriples).serialize_to_write(Vec::new()); //! for quad in RdfParser::from_format(RdfFormat::Turtle).parse_read(turtle_file.as_ref()) { //! writer.write_quad(&quad.unwrap()).unwrap(); //! } //! assert_eq!(writer.finish().unwrap(), ntriples_file); //! ``` mod format; pub mod read; pub mod write; #[allow(deprecated)] pub use self::format::{DatasetFormat, GraphFormat}; #[allow(deprecated)] pub use self::read::{DatasetParser, GraphParser}; #[allow(deprecated)] pub use self::write::{DatasetSerializer, GraphSerializer}; pub use oxrdfio::*;