<refentry id="libtracker-client-TrackerSparqlBuilder">
<refmeta>
<refentrytitle role="top_of_page" id="libtracker-client-TrackerSparqlBuilder.top_of_page">Sparql builder</refentrytitle>
<manvolnum>3</manvolnum>
<refmiscinfo>LIBTRACKER-CLIENT Library</refmiscinfo>
</refmeta>

<refnamediv>
<refname>Sparql builder</refname>
<refpurpose>Creating insertion/update SparQL queries.</refpurpose>
</refnamediv>

<refsynopsisdiv id="libtracker-client-TrackerSparqlBuilder.synopsis" role="synopsis">
<title role="synopsis.title">Synopsis</title>

<synopsis>
                    <link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>;
                    <link linkend="TrackerSparqlBuilderClass">TrackerSparqlBuilderClass</link>;
                    <link linkend="TrackerSparqlBuilderPrivate">TrackerSparqlBuilderPrivate</link>;
enum                <link linkend="TrackerSparqlBuilderState">TrackerSparqlBuilderState</link>;
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-new">tracker_sparql_builder_new</link>        (void);
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-new-embedded-insert">tracker_sparql_builder_new_embedded_insert</link>
                                                        (void);
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-new-update">tracker_sparql_builder_new_update</link> (void);
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-construct">tracker_sparql_builder_construct</link>  (<link linkend="GType">GType</link> object_type);
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-construct-embedded-insert">tracker_sparql_builder_construct_embedded_insert</link>
                                                        (<link linkend="GType">GType</link> object_type);
<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* <link linkend="tracker-sparql-builder-construct-update">tracker_sparql_builder_construct_update</link>
                                                        (<link linkend="GType">GType</link> object_type);
<link linkend="TrackerSparqlBuilderState">TrackerSparqlBuilderState</link>  <link linkend="tracker-sparql-builder-get-state">tracker_sparql_builder_get_state</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
const <link linkend="char">char</link>*         <link linkend="tracker-sparql-builder-get-result">tracker_sparql_builder_get_result</link>   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="gint">gint</link>                <link linkend="tracker-sparql-builder-get-length">tracker_sparql_builder_get_length</link>   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-append">tracker_sparql_builder_append</link>       (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *raw);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-prepend">tracker_sparql_builder_prepend</link>      (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *raw);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-insert-open">tracker_sparql_builder_insert_open</link>  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *graph);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-insert-close">tracker_sparql_builder_insert_close</link> (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-where-open">tracker_sparql_builder_where_open</link>   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-where-close">tracker_sparql_builder_where_close</link>  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-delete-open">tracker_sparql_builder_delete_open</link>  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *graph);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-delete-close">tracker_sparql_builder_delete_close</link> (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-drop-graph">tracker_sparql_builder_drop_graph</link>   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-subject-variable">tracker_sparql_builder_subject_variable</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *var_name);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-subject-iri">tracker_sparql_builder_subject_iri</link>  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-subject">tracker_sparql_builder_subject</link>      (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-predicate-iri">tracker_sparql_builder_predicate_iri</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-predicate">tracker_sparql_builder_predicate</link>    (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-iri">tracker_sparql_builder_object_iri</link>   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object">tracker_sparql_builder_object</link>       (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-string">tracker_sparql_builder_object_string</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *literal);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-boolean">tracker_sparql_builder_object_boolean</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="gboolean">gboolean</link> literal);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-int64">tracker_sparql_builder_object_int64</link> (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="gint64">gint64</link> literal);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-date">tracker_sparql_builder_object_date</link>  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="time-t">time_t</link> *literal);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-double">tracker_sparql_builder_object_double</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="double">double</link> literal);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-variable">tracker_sparql_builder_object_variable</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *var_name);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-blank-open">tracker_sparql_builder_object_blank_open</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-blank-close">tracker_sparql_builder_object_blank_close</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);
<link linkend="void">void</link>                <link linkend="tracker-sparql-builder-object-unvalidated">tracker_sparql_builder_object_unvalidated</link>
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *value);
</synopsis>
</refsynopsisdiv>









<refsect1 id="libtracker-client-TrackerSparqlBuilder.description" role="desc">
<title role="desc.title">Description</title>
<para>
<link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link> is an object what will gather a set of
subject/predicate/object triples, together with an optional WHERE clause,
in order to create a query that may be issued to tracker-store.
</para>
<para>
When using <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>, note that you may append several predicates
for the same subject, and several objects for the same predicate.
</para>
<example id="example-sparql-builder">
  <title>Using TrackerSparqlBuilder</title>
  <programlisting>
  TrackerSparqlBuilder *builder;
  const gchar *iri = "urn:example:0001";
  gchar *query_str;
&nbsp;&nbsp;
  /* Create builder */
  builder = tracker_sparql_builder_new_update ();
&nbsp;&nbsp;
  /* Drop previous data */
  tracker_sparql_builder_drop_graph (builder, iri);
&nbsp;&nbsp;
  /* Insert new data */
  tracker_sparql_builder_insert_open (builder, iri);
&nbsp;&nbsp;
  tracker_sparql_builder_subject_iri (builder, iri);
&nbsp;&nbsp;
  tracker_sparql_builder_predicate (builder, "a");
  tracker_sparql_builder_object (builder, "nie:DataObject");
  tracker_sparql_builder_object (builder, "nfo:FileDataObject");
&nbsp;&nbsp;
  tracker_sparql_builder_predicate (builder, "nfo:fileLastModified");
  tracker_sparql_builder_object_date (builder, time (NULL));
&nbsp;&nbsp;
  tracker_sparql_builder_insert_close (builder);
&nbsp;&nbsp;
  /* Get query as string */
  query_str = tracker_sparql_builder_get_result (builder);
  </programlisting>
</example>
</refsect1>

<refsect1 id="libtracker-client-TrackerSparqlBuilder.details" role="details">
<title role="details.title">Details</title>
<refsect2 id="TrackerSparqlBuilder" role="struct">
<title>TrackerSparqlBuilder</title>
<indexterm zone="TrackerSparqlBuilder"><primary sortas="TrackerSparqlBuilder">TrackerSparqlBuilder</primary></indexterm><programlisting>typedef struct {
	GObject parent_instance;
	TrackerSparqlBuilderPrivate * priv;
} TrackerSparqlBuilder;
</programlisting>
<para>
The <structname>TrackerSparqlBuilder</structname> object represents an
insertion/update SparQL query.
</para></refsect2>
<refsect2 id="TrackerSparqlBuilderClass" role="struct">
<title>TrackerSparqlBuilderClass</title>
<indexterm zone="TrackerSparqlBuilderClass"><primary sortas="TrackerSparqlBuilderClass">TrackerSparqlBuilderClass</primary></indexterm><programlisting>typedef struct {
	GObjectClass parent_class;
} TrackerSparqlBuilderClass;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="TrackerSparqlBuilderPrivate" role="struct">
<title>TrackerSparqlBuilderPrivate</title>
<indexterm zone="TrackerSparqlBuilderPrivate"><primary sortas="TrackerSparqlBuilderPrivate">TrackerSparqlBuilderPrivate</primary></indexterm><programlisting>typedef struct _TrackerSparqlBuilderPrivate TrackerSparqlBuilderPrivate;</programlisting>
<para>
</para></refsect2>
<refsect2 id="TrackerSparqlBuilderState" role="enum">
<title>enum TrackerSparqlBuilderState</title>
<indexterm zone="TrackerSparqlBuilderState"><primary sortas="TrackerSparqlBuilderState">TrackerSparqlBuilderState</primary></indexterm><programlisting>typedef enum  {
	TRACKER_SPARQL_BUILDER_STATE_UPDATE,
	TRACKER_SPARQL_BUILDER_STATE_INSERT,
	TRACKER_SPARQL_BUILDER_STATE_DELETE,
	TRACKER_SPARQL_BUILDER_STATE_SUBJECT,
	TRACKER_SPARQL_BUILDER_STATE_PREDICATE,
	TRACKER_SPARQL_BUILDER_STATE_OBJECT,
	TRACKER_SPARQL_BUILDER_STATE_BLANK,
	TRACKER_SPARQL_BUILDER_STATE_WHERE,
	TRACKER_SPARQL_BUILDER_STATE_EMBEDDED_INSERT
} TrackerSparqlBuilderState;
</programlisting>
<para>
</para></refsect2>
<refsect2 id="tracker-sparql-builder-new" role="function">
<title>tracker_sparql_builder_new ()</title>
<indexterm zone="tracker-sparql-builder-new"><primary sortas="tracker_sparql_builder_new">tracker_sparql_builder_new</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_new        (void);</programlisting>
<para>
Creates a stateless <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a newly created <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>. Free with <link linkend="g-object-unref"><function>g_object_unref()</function></link> when done
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-new-embedded-insert" role="function">
<title>tracker_sparql_builder_new_embedded_insert ()</title>
<indexterm zone="tracker-sparql-builder-new-embedded-insert"><primary sortas="tracker_sparql_builder_new_embedded_insert">tracker_sparql_builder_new_embedded_insert</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_new_embedded_insert
                                                        (void);</programlisting>
<para>
Creates a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link> ready to be embedded in another query. In embedded
inserts, the subject is implied (responsibility of the embedder), so only calls to
append predicates and objects for the given subject are allowed.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a newly created <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>. Free with <link linkend="g-object-unref"><function>g_object_unref()</function></link> when done
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-new-update" role="function">
<title>tracker_sparql_builder_new_update ()</title>
<indexterm zone="tracker-sparql-builder-new-update"><primary sortas="tracker_sparql_builder_new_update">tracker_sparql_builder_new_update</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_new_update (void);</programlisting>
<para>
Creates an empty <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link> for an update query.
</para><variablelist role="params">
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>a newly created <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>. Free with <link linkend="g-object-unref"><function>g_object_unref()</function></link> when done
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-construct" role="function">
<title>tracker_sparql_builder_construct ()</title>
<indexterm zone="tracker-sparql-builder-construct"><primary sortas="tracker_sparql_builder_construct">tracker_sparql_builder_construct</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_construct  (<link linkend="GType">GType</link> object_type);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-construct-embedded-insert" role="function">
<title>tracker_sparql_builder_construct_embedded_insert ()</title>
<indexterm zone="tracker-sparql-builder-construct-embedded-insert"><primary sortas="tracker_sparql_builder_construct_embedded_insert">tracker_sparql_builder_construct_embedded_insert</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_construct_embedded_insert
                                                        (<link linkend="GType">GType</link> object_type);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-construct-update" role="function">
<title>tracker_sparql_builder_construct_update ()</title>
<indexterm zone="tracker-sparql-builder-construct-update"><primary sortas="tracker_sparql_builder_construct_update">tracker_sparql_builder_construct_update</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link>* tracker_sparql_builder_construct_update
                                                        (<link linkend="GType">GType</link> object_type);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>object_type</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-get-state" role="function">
<title>tracker_sparql_builder_get_state ()</title>
<indexterm zone="tracker-sparql-builder-get-state"><primary sortas="tracker_sparql_builder_get_state">tracker_sparql_builder_get_state</primary></indexterm><programlisting><link linkend="TrackerSparqlBuilderState">TrackerSparqlBuilderState</link>  tracker_sparql_builder_get_state
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-get-result" role="function">
<title>tracker_sparql_builder_get_result ()</title>
<indexterm zone="tracker-sparql-builder-get-result"><primary sortas="tracker_sparql_builder_get_result">tracker_sparql_builder_get_result</primary></indexterm><programlisting>const <link linkend="char">char</link>*         tracker_sparql_builder_get_result   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Returns the constructed SparQL query as a string.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>The created SparQL query.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-get-length" role="function">
<title>tracker_sparql_builder_get_length ()</title>
<indexterm zone="tracker-sparql-builder-get-length"><primary sortas="tracker_sparql_builder_get_length">tracker_sparql_builder_get_length</primary></indexterm><programlisting><link linkend="gint">gint</link>                tracker_sparql_builder_get_length   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Returns the number of objects added to <parameter>self</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><emphasis>Returns</emphasis>&#160;:</term><listitem><simpara>The number of objects contained.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-append" role="function">
<title>tracker_sparql_builder_append ()</title>
<indexterm zone="tracker-sparql-builder-append"><primary sortas="tracker_sparql_builder_append">tracker_sparql_builder_append</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_append       (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *raw);</programlisting>
<para>
Appends raw, unvalidated content to <parameter>self</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>raw</parameter>&#160;:</term>
<listitem><simpara>raw content to append.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-prepend" role="function">
<title>tracker_sparql_builder_prepend ()</title>
<indexterm zone="tracker-sparql-builder-prepend"><primary sortas="tracker_sparql_builder_prepend">tracker_sparql_builder_prepend</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_prepend      (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *raw);</programlisting>
<para>
Prepends raw, unvalidated content to <parameter>self</parameter>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>raw</parameter>&#160;:</term>
<listitem><simpara>raw content to prepend.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-insert-open" role="function">
<title>tracker_sparql_builder_insert_open ()</title>
<indexterm zone="tracker-sparql-builder-insert-open"><primary sortas="tracker_sparql_builder_insert_open">tracker_sparql_builder_insert_open</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_insert_open  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *graph);</programlisting>
<para>
Opens an insertion statement.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>graph</parameter>&#160;:</term>
<listitem><simpara>Graph name, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-insert-close" role="function">
<title>tracker_sparql_builder_insert_close ()</title>
<indexterm zone="tracker-sparql-builder-insert-close"><primary sortas="tracker_sparql_builder_insert_close">tracker_sparql_builder_insert_close</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_insert_close (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Closes an insertion statement opened with <link linkend="tracker-sparql-builder-insert-open"><function>tracker_sparql_builder_insert_open()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-where-open" role="function">
<title>tracker_sparql_builder_where_open ()</title>
<indexterm zone="tracker-sparql-builder-where-open"><primary sortas="tracker_sparql_builder_where_open">tracker_sparql_builder_where_open</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_where_open   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Opens a WHERE clause. Data triples may be appended then to narrow the scope
to which the update query applies.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-where-close" role="function">
<title>tracker_sparql_builder_where_close ()</title>
<indexterm zone="tracker-sparql-builder-where-close"><primary sortas="tracker_sparql_builder_where_close">tracker_sparql_builder_where_close</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_where_close  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Closes a WHERE clause opened through <link linkend="tracker-sparql-builder-where-open"><function>tracker_sparql_builder_where_open()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-delete-open" role="function">
<title>tracker_sparql_builder_delete_open ()</title>
<indexterm zone="tracker-sparql-builder-delete-open"><primary sortas="tracker_sparql_builder_delete_open">tracker_sparql_builder_delete_open</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_delete_open  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *graph);</programlisting>
<para>
Opens a DELETE clause. Data triples may be appended in order to prepare
a query to delete them.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>graph</parameter>&#160;:</term>
<listitem><simpara>Graph name, or <link linkend="NULL--CAPS"><literal>NULL</literal></link>.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-delete-close" role="function">
<title>tracker_sparql_builder_delete_close ()</title>
<indexterm zone="tracker-sparql-builder-delete-close"><primary sortas="tracker_sparql_builder_delete_close">tracker_sparql_builder_delete_close</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_delete_close (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Closes a DELETE clause opened through <link linkend="tracker-sparql-builder-delete-close"><function>tracker_sparql_builder_delete_close()</function></link>.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-drop-graph" role="function">
<title>tracker_sparql_builder_drop_graph ()</title>
<indexterm zone="tracker-sparql-builder-drop-graph"><primary sortas="tracker_sparql_builder_drop_graph">tracker_sparql_builder_drop_graph</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_drop_graph   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);</programlisting>
<para>
Appends a DROP GRAPH clause.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iri</parameter>&#160;:</term>
<listitem><simpara>a graph name.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-subject-variable" role="function">
<title>tracker_sparql_builder_subject_variable ()</title>
<indexterm zone="tracker-sparql-builder-subject-variable"><primary sortas="tracker_sparql_builder_subject_variable">tracker_sparql_builder_subject_variable</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_subject_variable
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *var_name);</programlisting>
<para>
Appends a subject as a SparQL variable, such as "?urn".
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_name</parameter>&#160;:</term>
<listitem><simpara>Variable name, without leading '?'
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-subject-iri" role="function">
<title>tracker_sparql_builder_subject_iri ()</title>
<indexterm zone="tracker-sparql-builder-subject-iri"><primary sortas="tracker_sparql_builder_subject_iri">tracker_sparql_builder_subject_iri</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_subject_iri  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);</programlisting>
<para>
Appends a subject as an IRI, such as "&lt;urn:file:1234-5678&gt;". IRIs
univocally identify a resource in tracker-store.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iri</parameter>&#160;:</term>
<listitem><simpara>IRI name, without leading and trailing greater/less than symbols.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-subject" role="function">
<title>tracker_sparql_builder_subject ()</title>
<indexterm zone="tracker-sparql-builder-subject"><primary sortas="tracker_sparql_builder_subject">tracker_sparql_builder_subject</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_subject      (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);</programlisting>
<para>
Appends a subject.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>s</parameter>&#160;:</term>
<listitem><simpara>subject string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-predicate-iri" role="function">
<title>tracker_sparql_builder_predicate_iri ()</title>
<indexterm zone="tracker-sparql-builder-predicate-iri"><primary sortas="tracker_sparql_builder_predicate_iri">tracker_sparql_builder_predicate_iri</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_predicate_iri
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);</programlisting>
<para>
Appends a predicate as an IRI.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iri</parameter>&#160;:</term>
<listitem><simpara>IRI name, without leading and trailing greater/less than symbols.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-predicate" role="function">
<title>tracker_sparql_builder_predicate ()</title>
<indexterm zone="tracker-sparql-builder-predicate"><primary sortas="tracker_sparql_builder_predicate">tracker_sparql_builder_predicate</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_predicate    (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);</programlisting>
<para>
Appends a predicate for the previously appended subject.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>s</parameter>&#160;:</term>
<listitem><simpara>predicate string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-iri" role="function">
<title>tracker_sparql_builder_object_iri ()</title>
<indexterm zone="tracker-sparql-builder-object-iri"><primary sortas="tracker_sparql_builder_object_iri">tracker_sparql_builder_object_iri</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_iri   (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *iri);</programlisting>
<para>
Appends an object as an IRI.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>iri</parameter>&#160;:</term>
<listitem><simpara>IRI name, without leading and trailing greater/less than symbols.
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object" role="function">
<title>tracker_sparql_builder_object ()</title>
<indexterm zone="tracker-sparql-builder-object"><primary sortas="tracker_sparql_builder_object">tracker_sparql_builder_object</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object       (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *s);</programlisting>
<para>
Appends a free-form object for the previously appended subject and predicate.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>s</parameter>&#160;:</term>
<listitem><simpara>object string
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-string" role="function">
<title>tracker_sparql_builder_object_string ()</title>
<indexterm zone="tracker-sparql-builder-object-string"><primary sortas="tracker_sparql_builder_object_string">tracker_sparql_builder_object_string</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_string
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *literal);</programlisting>
<para>
Appends an object formatted as an string. <parameter>literal</parameter> will be escaped and surrounded
by double quotes.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>literal</parameter>&#160;:</term>
<listitem><simpara>string object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-boolean" role="function">
<title>tracker_sparql_builder_object_boolean ()</title>
<indexterm zone="tracker-sparql-builder-object-boolean"><primary sortas="tracker_sparql_builder_object_boolean">tracker_sparql_builder_object_boolean</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_boolean
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="gboolean">gboolean</link> literal);</programlisting>
<para>
Appends a <link linkend="gboolean"><type>gboolean</type></link> value as an object.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>literal</parameter>&#160;:</term>
<listitem><simpara>boolean object
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-int64" role="function">
<title>tracker_sparql_builder_object_int64 ()</title>
<indexterm zone="tracker-sparql-builder-object-int64"><primary sortas="tracker_sparql_builder_object_int64">tracker_sparql_builder_object_int64</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_int64 (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="gint64">gint64</link> literal);</programlisting>
<para>
Appends a <link linkend="gint64"><type>gint64</type></link> as an object.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>literal</parameter>&#160;:</term>
<listitem><simpara>object as gint64
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-date" role="function">
<title>tracker_sparql_builder_object_date ()</title>
<indexterm zone="tracker-sparql-builder-object-date"><primary sortas="tracker_sparql_builder_object_date">tracker_sparql_builder_object_date</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_date  (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="time-t">time_t</link> *literal);</programlisting>
<para>
Appends a time_t as an object. <parameter>literal</parameter> will be converted to a
string in the date format used by tracker-store.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>literal</parameter>&#160;:</term>
<listitem><simpara>object as time_t
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-double" role="function">
<title>tracker_sparql_builder_object_double ()</title>
<indexterm zone="tracker-sparql-builder-object-double"><primary sortas="tracker_sparql_builder_object_double">tracker_sparql_builder_object_double</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_double
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         <link linkend="double">double</link> literal);</programlisting>
<para>
Appends a <link linkend="gdouble"><type>gdouble</type></link> as an object.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a TrackerSparqlBuilder
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>literal</parameter>&#160;:</term>
<listitem><simpara>object as <link linkend="gdouble"><type>gdouble</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-variable" role="function">
<title>tracker_sparql_builder_object_variable ()</title>
<indexterm zone="tracker-sparql-builder-object-variable"><primary sortas="tracker_sparql_builder_object_variable">tracker_sparql_builder_object_variable</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_variable
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *var_name);</programlisting>
<para>
Appends an object as a SparQL variable, such as "?urn".
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>var_name</parameter>&#160;:</term>
<listitem><simpara>variable name, without leading '?'
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-blank-open" role="function">
<title>tracker_sparql_builder_object_blank_open ()</title>
<indexterm zone="tracker-sparql-builder-object-blank-open"><primary sortas="tracker_sparql_builder_object_blank_open">tracker_sparql_builder_object_blank_open</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_blank_open
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Opens an anonymous blank node. In insertions this can be used to create
anonymous nodes for not previously known data without the need of a
separate insertion.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-blank-close" role="function">
<title>tracker_sparql_builder_object_blank_close ()</title>
<indexterm zone="tracker-sparql-builder-object-blank-close"><primary sortas="tracker_sparql_builder_object_blank_close">tracker_sparql_builder_object_blank_close</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_blank_close
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self);</programlisting>
<para>
Closes an anomymous blank node opened with <link linkend="tracker-sparql-builder-object-blank-open"><function>tracker_sparql_builder_object_blank_open()</function></link>
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
</variablelist></refsect2>
<refsect2 id="tracker-sparql-builder-object-unvalidated" role="function">
<title>tracker_sparql_builder_object_unvalidated ()</title>
<indexterm zone="tracker-sparql-builder-object-unvalidated"><primary sortas="tracker_sparql_builder_object_unvalidated">tracker_sparql_builder_object_unvalidated</primary></indexterm><programlisting><link linkend="void">void</link>                tracker_sparql_builder_object_unvalidated
                                                        (<link linkend="TrackerSparqlBuilder">TrackerSparqlBuilder</link> *self,
                                                         const <link linkend="char">char</link> *value);</programlisting>
<para>
Appends a string not validated as UTF-8 as an object.
</para><variablelist role="params">
<varlistentry><term><parameter>self</parameter>&#160;:</term>
<listitem><simpara>a <link linkend="TrackerSparqlBuilder"><type>TrackerSparqlBuilder</type></link>
</simpara></listitem></varlistentry>
<varlistentry><term><parameter>value</parameter>&#160;:</term>
<listitem><simpara>possibly UTF-8 invalid string.
</simpara></listitem></varlistentry>
</variablelist></refsect2>

</refsect1>




</refentry>
