| Crates.io | curieosa |
| lib.rs | curieosa |
| version | 0.1.0 |
| created_at | 2024-07-17 07:49:40.075204+00 |
| updated_at | 2024-07-17 07:49:40.075204+00 |
| description | Parse parsing Internationalized Resource Identifiers (IRIs) into Compact Uniform Resource Identifiers (CURIEs) |
| homepage | https://github.com/ielis/curieosa |
| repository | https://github.com/ielis/curieosa |
| max_upload_size | |
| id | 1305951 |
| size | 37,427 |
A crate for parsing Internationalized Resource Identifiers (IRIs) into Compact Uniform Resource Identifiers (CURIEs).
Add the following into your Cargo.toml file to use curieosa in your code:
curieosa = "0.1.0"
CREDIT
The curieosa is heavily inspired by the curie-util library
written by Chris Mungall in Java.
The Rust port is intentionally very similar to the Java library, to simplify its usage.
Get an implementation of [CurieUtil] backed by a trie with default prefix -> expansion mappings.
use curieosa::{TrieCurieUtil, CurieUtil, CurieParts};
let cu = TrieCurieUtil::default();
// Get curie parts from an IRI
let iri = "http://purl.obolibrary.org/obo/HP_0001250";
let cp: CurieParts<'_, '_> = cu.get_curie_data(iri).unwrap();
assert_eq!(cp.get_prefix(), "HP");
assert_eq!(cp.get_id(), "0001250");
Run all tests by running:
cargo test
We use criterion to benchmark IRI parsing.
Run the following to run the bench suite:
cargo bench