Struct rio_turtle::TriGFormatter
source · pub struct TriGFormatter<W: Write> { /* private fields */ }
Expand description
A TriG formatter.
It implements the QuadsFormatter
trait.
Write some triples using the QuadsFormatter
API into a Vec
buffer:
use rio_turtle::TriGFormatter;
use rio_api::formatter::QuadsFormatter;
use rio_api::model::{NamedNode, Quad};
let mut formatter = TriGFormatter::new(Vec::default());
formatter.format(&Quad {
subject: NamedNode { iri: "http://example.com/foo" }.into(),
predicate: NamedNode { iri: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type" }.into(),
object: NamedNode { iri: "http://schema.org/Person" }.into(),
graph_name: Some(NamedNode { iri: "http://example.com/" }.into())
})?;
let _trig = formatter.finish()?;