Top |
TrackerNamespaceManagerTrackerNamespaceManager — A set of well-known namespaces, and known abbreviations for them |
Functions
void | tracker_namespace_manager_add_prefix () |
char * | tracker_namespace_manager_expand_uri () |
TrackerNamespaceManager * | tracker_namespace_manager_get_default () |
gboolean | tracker_namespace_manager_has_prefix () |
const char * | tracker_namespace_manager_lookup_prefix () |
TrackerNamespaceManager * | tracker_namespace_manager_new () |
char * | tracker_namespace_manager_print_turtle () |
Description
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.
Functions
tracker_namespace_manager_add_prefix ()
void tracker_namespace_manager_add_prefix (TrackerNamespaceManager *self
,const char *prefix
,const char *namespace
);
Adds prefix
as the recognised abbreviaton of namespace
.
Only one prefix is allowed for a given namespace, and all prefixes must be unique.
Parameters
self |
a TrackerNamespaceManager |
|
prefix |
a short, unique prefix to identify |
|
namespace |
the URL of the given namespace |
Since: 1.10
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.
Since: 1.10
tracker_namespace_manager_get_default ()
TrackerNamespaceManager *
tracker_namespace_manager_get_default (void
);
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.
Since: 1.10
tracker_namespace_manager_has_prefix ()
gboolean tracker_namespace_manager_has_prefix (TrackerNamespaceManager *self
,const char *prefix
);
Since: 1.10
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.
Since: 1.10
tracker_namespace_manager_new ()
TrackerNamespaceManager *
tracker_namespace_manager_new (void
);
Creates a new TrackerNamespaceManager instance.
Since: 1.10