Struct tracker::NamespaceManager[][src]

pub struct NamespaceManager(_);

The <structname>TrackerNamespaceManager</structname> object represents a mapping of prefixes and namespaces.

Implementations

impl NamespaceManager[src]

pub fn new() -> NamespaceManager[src]

Creates a new NamespaceManager instance.

Returns

a new NamespaceManager instance

pub fn add_prefix(&self, prefix: &str, ns: &str)[src]

Adds prefix as the recognised abbreviaton of namespace.

Only one prefix is allowed for a given namespace, and all prefixes must be unique.

prefix

a short, unique prefix to identify namespace

ns

the URL of the given namespace

pub fn expand_uri(&self, compact_uri: &str) -> Option<GString>[src]

If compact_uri begins with one of the prefixes known to this NamespaceManager, then the return value will be the expanded URI. Otherwise, a copy of compact_uri will be returned.

compact_uri

a URI or compact URI

Returns

a newly-allocated string

pub fn has_prefix(&self, prefix: &str) -> bool[src]

Returns whether prefix is known.

prefix

a string

Returns

true if the NamespaceManager knows about prefix, false otherwise

pub fn lookup_prefix(&self, prefix: &str) -> Option<GString>[src]

Looks up the namespace URI corresponding to prefix, or None if the prefix is not known.

prefix

a string

Returns

a string owned by the NamespaceManager, or None

pub fn print_turtle(&self) -> Option<GString>[src]

Writes out all namespaces as Turtle prefix statements.

Returns

a newly-allocated string

pub fn default() -> Option<NamespaceManager>[src]

Returns the global NamespaceManager that contains a set of well-known namespaces and prefixes, such as rdf:, rdfs:, nie:, tracker:, etc.

Note that the list of prefixes and namespaces is hardcoded in libtracker-sparql. It may not correspond with the installed set of ontologies, if they have been modified since they were installed.

Returns

a global, shared NamespaceManager instance

Trait Implementations

impl Clone for NamespaceManager[src]

impl Debug for NamespaceManager[src]

impl Default for NamespaceManager[src]

impl Display for NamespaceManager[src]

impl Hash for NamespaceManager[src]

impl Ord for NamespaceManager[src]

impl ParentClassIs for NamespaceManager[src]

type Parent = Object

impl<T: ObjectType> PartialEq<T> for NamespaceManager[src]

impl<T: ObjectType> PartialOrd<T> for NamespaceManager[src]

impl StaticType for NamespaceManager[src]

impl Eq for NamespaceManager[src]

impl StructuralEq for NamespaceManager[src]

Auto Trait Implementations

impl RefUnwindSafe for NamespaceManager

impl !Send for NamespaceManager

impl !Sync for NamespaceManager

impl Unpin for NamespaceManager

impl UnwindSafe for NamespaceManager

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Cast for T where
    T: ObjectType, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ObjectExt for T where
    T: ObjectType, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToSendValue for T where
    T: Send + ToValue + ?Sized

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<Super, Sub> CanDowncast<Sub> for Super where
    Sub: IsA<Super>,
    Super: IsA<Super>, 

impl<'a, T, C> FromValueOptional<'a> for T where
    C: ValueTypeChecker<Error = ValueTypeMismatchOrNoneError>,
    T: FromValue<'a, Checker = C>,