NamespaceManager
Object Hierarchy:
Description:
[
CCode ( type_id =
"tracker_namespace_manager_get_type ()" ) ]
public class NamespaceManager :
Object
`TrackerNamespaceManager` object represents a mapping between namespaces and their shortened prefixes.
This object keeps track of namespaces, and allows you to assign short prefixes for them to avoid frequent use of full namespace IRIs. The
syntax used is that of Compact URIs (CURIEs).
Usually you will want to use a namespace manager obtained through [method@SparqlConnection.get_namespace_manager] from the [
class@SparqlConnection] that manages the RDF data, as that will contain all prefixes and namespaces that are pre-defined by its ontology.
Content:
Static methods:
- public static unowned NamespaceManager get_default ()
Returns the global `TrackerNamespaceManager` that contains a set of
well-known namespaces and prefixes, such as `rdf:`, `rdfs:`, `nie:`, `tracker:`, etc.
Creation methods:
Methods:
- public void @foreach (HFunc func)
Calls func for each known prefix / URI pair.
- public void add_prefix (string prefix, string ns)
Adds prefix as the recognised abbreviation of
namespace.
- public string compress_uri (string uri)
If uri begins with one of the namespaces known to this
`TrackerNamespaceManager`, then the return value will be the compressed URI.
- public string expand_uri (string compact_uri)
If compact_uri begins with one of the prefixes known to
this `TrackerNamespaceManager`, then the return value will be the expanded URI.
- public bool has_prefix (string prefix)
Returns whether prefix is known.
- public unowned string? lookup_prefix (string prefix)
Looks up the namespace URI corresponding to prefix, or
null if the prefix is not known.
- public string print_turtle ()
Writes out all namespaces as `prefix` statements in the
Turtle RDF format.
Inherited Members:
All known members inherited from class GLib.Object