prefixmap/lib.rs
1//! Prefix map implementation
2//!
3//! Implements prefix maps, which are used in TURTLE, SPARQL and ShEx
4//!
5//! A prefix map is a list of alias declarations associated with IRIs:
6//!
7//! ```turtle
8//! prefix schema: <https://schema.org/>
9//! prefix : <https://example.org/>
10//! ```
11//!
12//! Example
13//!
14//! ```
15//! # use std::str::FromStr;
16//! # use iri_s::{IriS, error::IriSError};
17//! # use prefixmap::PrefixMap;
18//!
19//! # fn main() -> Result<(), IriSError> {
20//! let schema_iri = IriS::from_str("https://schema.org/")?;
21//! let example_iri = IriS::from_str("https://example.org/")?;
22//! let mut pm = PrefixMap::new();
23//! pm.add_prefix("schema", schema_iri);
24//! pm.add_prefix("", example_iri);
25//! # Ok(())
26//! # }
27//! ```
28
29pub mod error;
30pub mod iri;
31pub mod map;
32
33#[cfg(all(test, not(target_family = "wasm")))]
34mod test;
35
36pub use crate::error::*;
37pub use crate::iri::Deref;
38pub use crate::iri::IriRef;
39pub use crate::map::PrefixMap;