Commit d3fed7a6 authored by Sam Thursfield's avatar Sam Thursfield

Merge branch 'sam/tracker-sparql-doc-cleanups' into 'master'

docs: Clean up some errors in libtracker-sparql-doc build

See merge request !82
parents 86b8ead9 ad5d4fe1
Pipeline #79573 passed with stage
in 2 minutes and 4 seconds
......@@ -79,20 +79,10 @@ int main (int argc, char **argv)
<title>Querying the Store</title>
<para>
In order to perform read-only queries to the store, a new
<type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
object must be acquired. In this case, as there is no intention of updating any
value in the store, both the general connection (with
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>)
or a specific direct-access connection (with
<function><link linkend="tracker-sparql-connection-get-direct">tracker_sparql_connection_get_direct</link></function>)
may be acquired. Note that in the latter case, every non read-only operation will result
in an error being thrown by the TrackerSparqlConnection.
</para>
<para>
Once a proper connection object has been acquired, the read-only query can be launched either
synchronously (<function><link linkend="tracker-sparql-connection-query">tracker_sparql_connection_query</link></function>)
First, a <type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
object must be acquired with
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>.
Then, a query can be launched either synchronously (<function><link linkend="tracker-sparql-connection-query">tracker_sparql_connection_query</link></function>)
or asynchronously (<function><link linkend="tracker-sparql-connection-query-async">tracker_sparql_connection_query_async</link></function>).
If launched asynchronously, the results of the query can be obtained with
<function><link linkend="tracker-sparql-connection-query-finish">tracker_sparql_connection_query_finish</link></function>.
......@@ -127,13 +117,9 @@ int main (int argc, const char **argv)
<type><link linkend="TrackerSparqlCursor-struct">TrackerSparqlCursor</link></type> *cursor;
const gchar *query = "SELECT nie:url(?u) WHERE { ?u a nfo:FileDataObject }";
/* As we know only read-only queries will be done, it's enough
* to use a connection with only direct-access setup. The NULL
* represents a possible GCancellable.
*/
connection = <function><link linkend="tracker-sparql-connection-get-direct">tracker_sparql_connection_get_direct</link></function> (NULL, &amp;error);
connection = <function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function> (NULL, &amp;error);
if (!connection) {
g_printerr ("Couldn't obtain a direct connection to the Tracker store: %s",
g_printerr ("Couldn't obtain a connection to the Tracker store: %s",
error ? error-&gt;message : "unknown error");
g_clear_error (&amp;error);
......@@ -189,11 +175,6 @@ int main (int argc, const char **argv)
<type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
object must be acquired with
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>.
Note that you MUST NOT use a specific direct-access connection obtained with
<function><link linkend="tracker-sparql-connection-get-direct">tracker_sparql_connection_get_direct</link></function>, as the direct-access method only supports read-only queries.
</para>
<para>
Once a proper connection object has been acquired, the update can be launched either
synchronously (<function><link linkend="tracker-sparql-connection-update">tracker_sparql_connection_update</link></function>)
or asynchronously (<function><link linkend="tracker-sparql-connection-update-async">tracker_sparql_connection_update_async</link></function>).
......@@ -228,10 +209,6 @@ int main (int argc, const char **argv)
"FILTER (!bound(?tag)) "
"}";
/* Do NOT get a direct connection if you're going to do some write
* operation in the Store. The NULL represents a possible
* GCancellable.
*/
connection = <function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function> (NULL, &amp;error);
if (!connection) {
g_printerr ("Couldn't obtain a connection to the Tracker store: %s",
......@@ -321,10 +298,6 @@ int main (int argc, const char **argv)
const gchar *query =
"INSERT { _:foo a nie:InformationElement } WHERE { ?x a rdfs:Class }";
/* Do NOT get a direct connection if you're going to do some write
* operation in the Store. The NULL represents a possible
* GCancellable.
*/
connection = <function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function> (NULL, &amp;error);
if (!connection) {
g_printerr ("Couldn't obtain a connection to the Tracker store: %s",
......
......@@ -16,45 +16,12 @@
<title>Connection methods</title>
<para>
The Tracker SPARQL library provides several underlying methods to perform
queries and updates to the Tracker Store.
<itemizedlist>
<listitem>
<emphasis>Direct Access:</emphasis>
<para>
All Read-Only operations done in a
<type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
will by default use this method, as it doesn't involve any D-Bus traffic,
and thus, it will perform much better. There is no real connection with
the Tracker Store in this case, as the access is direct to the underlying
SQLite database. Again, note that this method applies only to
<emphasis>Read-Only</emphasis> operations.
</para>
<para>
If you plan to only do Read-Only queries to the store, you can get the
<type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
object using <function><link linkend="tracker-sparql-connection-get-direct">tracker_sparql_connection_get_direct</link></function>. Otherwise, if you also plan to use the same connection object
for <emphasis>Write</emphasis> operations, you must get the connection object with
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>.
</para>
</listitem>
<listitem>
<emphasis>D-Bus FD passing:</emphasis>
<para>
The <type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
will use the File Descriptor passing method via D-Bus to connect to the Store for all non
Read-Only queries on
<type><link linkend="TrackerSparqlConnection-struct">TrackerSparqlConnection</link></type>
objects obtained with
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>.
</para>
<para>
See the <link linkend="tracker-overview-environment-variables">Environment Variables</link> section
to check how you can force also Read-Only queries to be done using D-Bus.
</para>
</listitem>
</itemizedlist>
To access the session-wide Tracker store, you should call
<function><link linkend="tracker-sparql-connection-get">tracker_sparql_connection_get</link></function>.
</para>
<para>
You can create and access a private store using
<function><link linkend="tracker-sparql-connection-local-new">tracker_sparql_connection_local_new</link></function>.
</para>
</chapter>
......
......@@ -950,7 +950,7 @@ tracker_notifier_event_get_id (TrackerNotifierEvent *event)
*
* Returns the RDF type that this notification event relates to, in their
* expanded forms (for example,
* http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio).
* <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#Audio>).
*
* A resource may have multiple RDF types. In the case of changes to a
* resource with multiple types, one event will be notified for each
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment