#![cfg(feature = "nq")] use objio::ObjectWriter; use rdftk_core::model::data_set::DataSet; use rdftk_io::nq::NQuadWriter; mod common; #[test] fn write_to_nquads() { let graph = common::tony_benn_named_graph(common::TonyBennType::OneType); let data_set = DataSet::from(graph); let writer = NQuadWriter::default(); let result = writer.write_to_string(&data_set); assert!(result.is_ok()); let output = result.unwrap(); println!("# format: N-Quads\n{}", output); assert!(output.contains(" \"Tony Benn\" .\n")); assert!(output.contains(" \"Wikipedia\" .\n")); assert!(output.contains(" _:B1 .\n")); assert!(output.contains("_:B1 \"Tony Benn\" .\n")); assert!(output.contains("_:B1 .\n")); }