rudof_lib 0.3.10

RDF and Knowledge Graphs processing tool
1
2
3
4
5
6
7
8
9
10
11
12
use crate::{Result, Rudof, errors::PrefixesError};

pub fn remove_prefix(rudof: &mut Rudof, alias: &str) -> Result<()> {
    let removed = rudof.prefixes.as_mut().and_then(|pm| pm.remove_prefix(alias));
    match removed {
        Some(_) => Ok(()),
        None => Err(PrefixesError::AliasNotFound {
            alias: alias.to_string(),
        }
        .into()),
    }
}