TrackerNamespaceManager
TrackerNamespaceManager keeps track of namespaces. It allows you to assign short prefixes for them to avoid typing full URLs all the time.
The syntax used is that of Compact URIs (CURIEs) as defined here: (https://www.w3.org/TR/2010/NOTE-curie-20101216)
Usually you will want to use the default namespace manager, as returned by tracker_namespace_manager_get_default. This has a set of well-known prefixes predefined.
TrackerNamespaceManager
GObject
╰──TrackerNamespaceManager
The
Class structure
TrackerNamespaceManagerClass
Fields
parent_class
(GObjectClass)
–
Tracker.NamespaceManagerClass
Attributes
parent_class
(GObject.ObjectClass)
–
Tracker.NamespaceManagerClass
Attributes
parent_class
(GObject.ObjectClass)
–
Tracker.NamespaceManager
GObject.Object
╰──Tracker.NamespaceManager
The
Tracker.NamespaceManager
GObject.Object
╰──Tracker.NamespaceManager
The
Constructors
tracker_namespace_manager_new
TrackerNamespaceManager * tracker_namespace_manager_new ()
Creates a new TrackerNamespaceManager instance.
a new TrackerNamespaceManager instance
Tracker.NamespaceManager.prototype.new
function Tracker.NamespaceManager.prototype.new(): {
// javascript wrapper for 'tracker_namespace_manager_new'
}
Creates a new Tracker.NamespaceManager instance.
a new Tracker.NamespaceManager instance
Tracker.NamespaceManager.new
def Tracker.NamespaceManager.new ():
#python wrapper for 'tracker_namespace_manager_new'
Creates a new Tracker.NamespaceManager instance.
a new Tracker.NamespaceManager instance
Methods
tracker_namespace_manager_add_prefix
tracker_namespace_manager_add_prefix (TrackerNamespaceManager * self, const char* prefix, const char* ns)
Adds prefix as the recognised abbreviaton of namespace.
Only one prefix is allowed for a given namespace, and all prefixes must be unique.
Since 3.3, This function may not be used on TrackerNamespaceManager instances that were obtained through tracker_sparql_connection_get_namespace_manager.
Parameters:
self
–
prefix
–
a short, unique prefix to identify namespace
ns
–
the URL of the given namespace
Tracker.NamespaceManager.prototype.add_prefix
function Tracker.NamespaceManager.prototype.add_prefix(prefix: String, ns: String): {
// javascript wrapper for 'tracker_namespace_manager_add_prefix'
}
Adds prefix as the recognised abbreviaton of namespace.
Only one prefix is allowed for a given namespace, and all prefixes must be unique.
Since 3.3, This function may not be used on Tracker.NamespaceManager instances that were obtained through Tracker.SparqlConnection.prototype.get_namespace_manager.
Parameters:
a short, unique prefix to identify namespace
the URL of the given namespace
Tracker.NamespaceManager.add_prefix
def Tracker.NamespaceManager.add_prefix (self, prefix, ns):
#python wrapper for 'tracker_namespace_manager_add_prefix'
Adds prefix as the recognised abbreviaton of namespace.
Only one prefix is allowed for a given namespace, and all prefixes must be unique.
Since 3.3, This function may not be used on Tracker.NamespaceManager instances that were obtained through Tracker.SparqlConnection.get_namespace_manager.
Parameters:
a short, unique prefix to identify namespace
the URL of the given namespace
tracker_namespace_manager_compress_uri
char* tracker_namespace_manager_compress_uri (TrackerNamespaceManager * self, const char* uri)
If uri begins with one of the namespaces known to this TrackerNamespaceManager, then the return value will be the compressed URI. Otherwise, NULL will be returned.
(nullable): the compressed URI
Since : 3.3
Tracker.NamespaceManager.prototype.compress_uri
function Tracker.NamespaceManager.prototype.compress_uri(uri: String): {
// javascript wrapper for 'tracker_namespace_manager_compress_uri'
}
If uri begins with one of the namespaces known to this Tracker.NamespaceManager, then the return value will be the compressed URI. Otherwise, NULL will be returned.
Parameters:
a URI or compact URI
(nullable): the compressed URI
Since : 3.3
Tracker.NamespaceManager.compress_uri
def Tracker.NamespaceManager.compress_uri (self, uri):
#python wrapper for 'tracker_namespace_manager_compress_uri'
If uri begins with one of the namespaces known to this Tracker.NamespaceManager, then the return value will be the compressed URI. Otherwise, NULL will be returned.
Parameters:
a URI or compact URI
(nullable): the compressed URI
Since : 3.3
tracker_namespace_manager_expand_uri
char* tracker_namespace_manager_expand_uri (TrackerNamespaceManager * self, const char* compact_uri)
If compact_uri begins with one of the prefixes known to this TrackerNamespaceManager, then the return value will be the expanded URI. Otherwise, a copy of compact_uri will be returned.
a newly-allocated string
Tracker.NamespaceManager.prototype.expand_uri
function Tracker.NamespaceManager.prototype.expand_uri(compact_uri: String): {
// javascript wrapper for 'tracker_namespace_manager_expand_uri'
}
If compact_uri begins with one of the prefixes known to this Tracker.NamespaceManager, then the return value will be the expanded URI. Otherwise, a copy of compact_uri will be returned.
Parameters:
a URI or compact URI
a newly-allocated string
Tracker.NamespaceManager.expand_uri
def Tracker.NamespaceManager.expand_uri (self, compact_uri):
#python wrapper for 'tracker_namespace_manager_expand_uri'
If compact_uri begins with one of the prefixes known to this Tracker.NamespaceManager, then the return value will be the expanded URI. Otherwise, a copy of compact_uri will be returned.
Parameters:
a URI or compact URI
a newly-allocated string
tracker_namespace_manager_foreach
tracker_namespace_manager_foreach (TrackerNamespaceManager * self, GHFunc func, gpointer user_data)
Calls func for each known prefix / URI pair.
Parameters:
self
–
func
(
[scope call])
–
the function to call for each prefix / URI pair
user_data
–
user data to pass to the function
Tracker.NamespaceManager.prototype.foreach
function Tracker.NamespaceManager.prototype.foreach(func: GLib.HFunc, user_data: Object): {
// javascript wrapper for 'tracker_namespace_manager_foreach'
}
Calls func for each known prefix / URI pair.
Parameters:
func
(GLib.HFunc)
–
the function to call for each prefix / URI pair
user data to pass to the function
Tracker.NamespaceManager.foreach
def Tracker.NamespaceManager.foreach (self, func, *user_data):
#python wrapper for 'tracker_namespace_manager_foreach'
Calls func for each known prefix / URI pair.
Parameters:
func
(GLib.HFunc)
–
the function to call for each prefix / URI pair
user data to pass to the function
tracker_namespace_manager_has_prefix
gboolean tracker_namespace_manager_has_prefix (TrackerNamespaceManager * self, const char* prefix)
Returns whether prefix is known.
TRUE if the TrackerNamespaceManager knows about prefix, FALSE otherwise
Tracker.NamespaceManager.prototype.has_prefix
function Tracker.NamespaceManager.prototype.has_prefix(prefix: String): {
// javascript wrapper for 'tracker_namespace_manager_has_prefix'
}
Returns whether prefix is known.
TRUE if the Tracker.NamespaceManager knows about prefix, FALSE otherwise
Tracker.NamespaceManager.has_prefix
def Tracker.NamespaceManager.has_prefix (self, prefix):
#python wrapper for 'tracker_namespace_manager_has_prefix'
Returns whether prefix is known.
TRUE if the Tracker.NamespaceManager knows about prefix, FALSE otherwise
tracker_namespace_manager_lookup_prefix
const char* tracker_namespace_manager_lookup_prefix (TrackerNamespaceManager * self, const char* prefix)
Looks up the namespace URI corresponding to prefix, or NULL if the prefix is not known.
a string owned by the TrackerNamespaceManager, or NULL
Tracker.NamespaceManager.prototype.lookup_prefix
function Tracker.NamespaceManager.prototype.lookup_prefix(prefix: String): {
// javascript wrapper for 'tracker_namespace_manager_lookup_prefix'
}
Looks up the namespace URI corresponding to prefix, or NULL if the prefix is not known.
a string owned by the Tracker.NamespaceManager, or NULL
Tracker.NamespaceManager.lookup_prefix
def Tracker.NamespaceManager.lookup_prefix (self, prefix):
#python wrapper for 'tracker_namespace_manager_lookup_prefix'
Looks up the namespace URI corresponding to prefix, or NULL if the prefix is not known.
a string owned by the Tracker.NamespaceManager, or NULL
tracker_namespace_manager_print_turtle
char* tracker_namespace_manager_print_turtle (TrackerNamespaceManager * self)
Writes out all namespaces as Turtle prefix statements.
Parameters:
self
–
a newly-allocated string
Tracker.NamespaceManager.prototype.print_turtle
function Tracker.NamespaceManager.prototype.print_turtle(): {
// javascript wrapper for 'tracker_namespace_manager_print_turtle'
}
Writes out all namespaces as Turtle prefix statements.
Parameters:
a newly-allocated string
Tracker.NamespaceManager.print_turtle
def Tracker.NamespaceManager.print_turtle (self):
#python wrapper for 'tracker_namespace_manager_print_turtle'
Writes out all namespaces as Turtle prefix statements.
Parameters:
a newly-allocated string
Functions
tracker_namespace_manager_get_default
TrackerNamespaceManager * tracker_namespace_manager_get_default ()
Returns the global TrackerNamespaceManager 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.
a global, shared TrackerNamespaceManager instance
deprecated : 3.3: Use tracker_sparql_connection_get_namespace_manager() instead.
Tracker.NamespaceManager.prototype.get_default
function Tracker.NamespaceManager.prototype.get_default(): {
// javascript wrapper for 'tracker_namespace_manager_get_default'
}
Returns the global Tracker.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.
a global, shared Tracker.NamespaceManager instance
deprecated : 3.3: Use tracker_sparql_connection_get_namespace_manager() instead.
Tracker.NamespaceManager.get_default
def Tracker.NamespaceManager.get_default ():
#python wrapper for 'tracker_namespace_manager_get_default'
Returns the global Tracker.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.
a global, shared Tracker.NamespaceManager instance
deprecated : 3.3: Use tracker_sparql_connection_get_namespace_manager() instead.
The results of the search are