Skip to main content

rdf_reader_jsonld/
lib.rs

1// This is free and unencumbered software released into the public domain.
2
3//! A JSON-LD file reader for RDF.rs, a Rust framework for RDF
4//! knowledge graphs.
5//!
6//! # Examples
7//!
8//! ```rust,no_run
9//! # #[tokio::main]
10//! # async fn main() -> Result<(), Box<dyn std::error::Error>> {
11//! use tokio::fs::File;
12//! let file = File::open("example.jsonld").await?;
13//!
14//! use rdf_reader_jsonld::JsonldReader;
15//! let reader = JsonldReader::from(file);
16//!
17//! use futures::StreamExt;
18//! reader
19//!     .into_stream()
20//!     .for_each(|triple| async move {
21//!         eprintln!("{:?}", triple);
22//!     })
23//!     .await;
24//! # Ok(())
25//! # }
26//! ```
27
28#![no_std]
29#![deny(unsafe_code)]
30
31#[cfg(feature = "alloc")]
32extern crate alloc;
33
34#[cfg(feature = "oxrdf")]
35mod oxrdf {
36    mod error;
37    pub use error::*;
38
39    mod reader;
40    pub use reader::*;
41
42    mod triple;
43    pub use triple::*;
44}
45#[cfg(feature = "oxrdf")]
46pub use oxrdf::*;