curieosa 0.1.0

Parse parsing Internationalized Resource Identifiers (IRIs) into Compact Uniform Resource Identifiers (CURIEs)
Documentation
  • Coverage
  • 80%
    8 out of 10 items documented4 out of 4 items with examples
  • Size
  • Source code size: 52.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.54 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 28s Average build duration of successful builds.
  • all releases: 28s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • ielis/curieosa
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ielis

curieosa

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.

Examples

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 tests

Run all tests by running:

cargo test

Run benches

We use criterion to benchmark IRI parsing.

Run the following to run the bench suite:

cargo bench