oxiland 0.5.0

Safe Redland-shaped RDF models, SPARQL, RDF I/O, durable Fjall storage, and utilities on Oxigraph
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//! Parse Turtle and serialize N-Triples with the Oxiland I/O facade.

use oxiland::Model;
use oxiland::io::{Parser, Serializer, Syntax};

fn main() -> oxiland::Result<()> {
    let model = Model::new()?;
    Parser::for_syntax(Syntax::Turtle)
        .base_iri("https://example.com/")?
        .load_collecting(&model, b"<alice> <name> \"Alice\" .".as_slice())?;

    let ntriples = Serializer::for_syntax(Syntax::NTriples).serialize_model_to_string(&model)?;
    println!("{ntriples}");
    Ok(())
}