Struct curie::PrefixMapping
[−]
[src]
pub struct PrefixMapping { /* fields omitted */ }
Maps prefixes to base URIs and allows for the expansion of CURIEs (Compact URIs).
Methods
impl PrefixMapping
[src]
pub fn set_default(&mut self, default: &str)
[src]
Set a default prefix.
This is used during CURIE expansion when there is no prefix, just a reference value.
pub fn add_prefix(
&mut self,
prefix: &str,
value: &str
) -> Result<(), InvalidPrefixError>
[src]
&mut self,
prefix: &str,
value: &str
) -> Result<(), InvalidPrefixError>
Add a prefix to the mapping.
This allows this prefix to be resolved when a CURIE is expanded.
pub fn remove_prefix(&mut self, prefix: &str)
[src]
Remove a prefix from the mapping.
Future calls to expand_curie_string
or expand_curie
that use
this prefix
will result in a ExpansionError::Invalid
error.
pub fn expand_curie_string(&self, curie: &str) -> Result<String, ExpansionError>
[src]
Expand a CURIE, returning a complete IRI.
pub fn expand_curie(&self, curie: &Curie) -> Result<String, ExpansionError>
[src]
Expand a parsed Curie
, returning a complete IRI.
Trait Implementations
impl Default for PrefixMapping
[src]
fn default() -> PrefixMapping
[src]
Returns the "default value" for a type. Read more