Struct rdf_store_rs::Namespace
source · pub struct Namespace {
pub name: String,
pub iri: IriBuf,
}
Expand description
A Namespace
represents a namespace IRI that can also be shown
in abbreviated format, also known as “prefix”.
For instance, the namespace IRI http://www.w3.org/1999/02/22-rdf-syntax-ns#
can also be shown (in RDF Turtle
or SPARQL for instance) as rdf:
.
A “local name” such as “type” in such a namespace would look
like http://www.w3.org/1999/02/22-rdf-syntax-ns#type or like rdf:type
.
Fields§
§name: String
assumed to end with ‘:’
iri: IriBuf
assumed to end with either ‘/’ or ‘#’
Implementations§
source§impl Namespace
impl Namespace
pub fn declare<'a, Base: Into<Iri<'a>>>(name: &str, iri: Base) -> Self
pub fn declare_from_str(name: &str, iri: &str) -> Self
sourcepub fn with_local_name(&self, name: &str) -> Result<IriBuf, Error>
pub fn with_local_name(&self, name: &str) -> Result<IriBuf, Error>
Return an identifier based on the current namespace IRI and the given local name within that namespace.
Trait Implementations§
source§impl PartialEq for Namespace
impl PartialEq for Namespace
impl Eq for Namespace
impl StructuralEq for Namespace
impl StructuralPartialEq for Namespace
Auto Trait Implementations§
impl RefUnwindSafe for Namespace
impl Send for Namespace
impl Sync for Namespace
impl Unpin for Namespace
impl UnwindSafe for Namespace
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string
, but without panic on OOM.