1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! A library for parsing and validating CURIEs.
//!
//! CURIEs provide a compact syntax for representing URIs by using a prefix that maps
//! to a namespace IRI. For example, `HP:0000738`.
//!
//! # Examples
//!
//! Parsing a CURIE ensures that whenever the [`Curie`] type is encountered in your code,
//! it has been validated. The [`Curie`] type cannot be constructed directly—only through parsing.
//!
//! ```
//! use securiety::{Curie, CurieParser, CurieParsing, CurieParsingError};
//! # fn main() -> Result<(), CurieParsingError> {
//! // Using a general parser
//! let parser = CurieParser::general();
//! let curie = parser.parse("HP:0000738")?;
//!
//! // Using a specific parser
//! let mondo_parser = CurieParser::mondo();
//! let mondo_curie = mondo_parser.parse("MONDO:0006007")?;
//! # Ok(())
//! # }
//! ```
//! ## Dynamic parser instantiation
//!
//! When the ontology is only known at runtime, a parser can be instantiated via a prefix:
//!
//! ```
//! use securiety::{CurieParser, CurieParsing, CurieParsingError};
//! # fn main() -> Result<(), CurieParsingError> {
//! let parser = CurieParser::from_prefix("HP").unwrap();
//! let curie = parser.parse("HP:0000738")?;
//! # Ok(())
//! # }
//! ```
//!
//! # Features
//!
//! - Parse CURIE strings into structured [`Curie`] objects
//! - Validate CURIEs against various formats
//! - Support for specific ontology parsers (HP, MONDO, etc.)
//!
//! # Modules
//!
//! - [`curie`] - Core CURIE data structure
//! - [`curie_parser`] - Parsing and expansion logic
//! - [`validators`] - CURIE validation implementations
//! - [`traits`] - Common traits for extensibility
//! - [`error`] - Error types
pub use Curie;
pub use CurieParser;
pub use *;
pub use *;
pub use CurieRegexValidator;