Trait rdftk_core::graph::mapping::PrefixMappings[][src]

pub trait PrefixMappings: Debug {
Show methods fn is_empty(&self) -> bool;
fn len(&self) -> usize;
fn set_default_namespace(&mut self, iri: IRIRef) -> &mut Self
    where
        Self: Sized
;
fn get_namespace(&self, prefix: &Prefix) -> Option<&IRIRef>;
fn get_prefix(&self, namespace: &IRIRef) -> Option<&Prefix>;
fn prefixes(&self) -> Vec<&Prefix>;
fn insert(&mut self, prefix: &str, iri: IRIRef) -> &mut Self
    where
        Self: Sized
;
fn remove(&mut self, prefix: &Prefix);
fn clear(&mut self);
fn expand(&self, qname: &QName) -> Option<IRIRef>;
fn compress(&self, iri: &IRIRef) -> Option<QName>; fn get_default_namespace(&self) -> Option<&IRIRef> { ... }
fn include_xsd(&mut self) -> &mut Self
    where
        Self: Sized
, { ... }
fn include_rdf(&mut self) -> &mut Self
    where
        Self: Sized
, { ... }
fn include_rdfs(&mut self) -> &mut Self
    where
        Self: Sized
, { ... }
}
Expand description

Prefix mappings are used in the serialization of graphs.

Required methods

fn is_empty(&self) -> bool[src]

Expand description

Returns true if there are no mappings in this instance, else false.

fn len(&self) -> usize[src]

Expand description

Return the number of mappings in this instance.

fn set_default_namespace(&mut self, iri: IRIRef) -> &mut Self where
    Self: Sized
[src]

Expand description

Set the default namespace mapping.

fn get_namespace(&self, prefix: &Prefix) -> Option<&IRIRef>[src]

Expand description

Get the namespace IRI associated with this provided prefix, if present.

fn get_prefix(&self, namespace: &IRIRef) -> Option<&Prefix>[src]

Expand description

Get the prefix associated with this provided namespace URI, if present.

fn prefixes(&self) -> Vec<&Prefix>[src]

Expand description

Return the set of prefixes in this mapping instance.

fn insert(&mut self, prefix: &str, iri: IRIRef) -> &mut Self where
    Self: Sized
[src]

Expand description

Insert a mapping from the prefix string to the namespace IRI.

fn remove(&mut self, prefix: &Prefix)[src]

Expand description

Remove a mapping for the provided prefix. This operation has no effect if no mapping is present.

fn clear(&mut self)[src]

Expand description

Remove all mappings from this instance.

fn expand(&self, qname: &QName) -> Option<IRIRef>[src]

Expand description

Expand a qname into an IRI, if possible.

fn compress(&self, iri: &IRIRef) -> Option<QName>[src]

Expand description

Compress an IRI into a qname, if possible.

Loading content...

Provided methods

fn get_default_namespace(&self) -> Option<&IRIRef>[src]

Expand description

Get the default namespace mapping, if present.

fn include_xsd(&mut self) -> &mut Self where
    Self: Sized
[src]

Expand description

Include the common “xsd” (XML Schema Data types) mapping.

fn include_rdf(&mut self) -> &mut Self where
    Self: Sized
[src]

Expand description

Include the common “rdf” mapping.

fn include_rdfs(&mut self) -> &mut Self where
    Self: Sized
[src]

Expand description

Include the common “rdfs” mapping.

Loading content...

Implementors

Loading content...