shacl-structural-model 6.3.0

Typed SHACL structural values for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//! IRI display helpers.

/// Return the local name after the final `#` or `/` in an IRI.
#[must_use]
pub fn local_name(iri: &(impl AsRef<str> + ?Sized)) -> String {
    let value = iri.as_ref();
    if let Some(position) = value.rfind('#') {
        value[position + 1..].to_owned()
    } else if let Some(position) = value.rfind('/') {
        value[position + 1..].to_owned()
    } else {
        value.to_owned()
    }
}