<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Query</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.71.0">
<link rel="start" href="index.html" title="Rasqal RDF Query Library Manual">
<link rel="up" href="pt01.html" title="Part I. Reference Manual">
<link rel="prev" href="rasqal-section-prefix.html" title="Prefixes">
<link rel="next" href="rasqal-section-query-results.html" title="Query Results">
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
<link rel="chapter" href="rasqal.html" title="Rasqal Overview">
<link rel="part" href="pt01.html" title="Part I. Reference Manual">
<link rel="index" href="ix01.html" title="Index">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="rasqal-section-prefix.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="pt01.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">Rasqal RDF Query Library Manual</th>
<td><a accesskey="n" href="rasqal-section-query-results.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2581405" class="shortcut">Top</a>
 | 
<a href="#id2623792" class="shortcut">Description</a></nobr></td></tr>
</table>
<div class="refentry" lang="en">
<a name="rasqal-section-query"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2>
<a name="id2581405"></a><span class="refentrytitle">Query</span>
</h2>
<p>Query — Query object API, parsing and execution</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<h2>Synopsis</h2>
<pre class="synopsis">
enum <a href="rasqal-section-query.html#rasqal-query-verb">rasqal_query_verb</a>;
typedef <a href="rasqal-section-query.html#rasqal-query">rasqal_query</a>;
<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a>* <a href="rasqal-section-query.html#rasqal-new-query">rasqal_new_query</a> (const char *name,
unsigned char *uri);
void <a href="rasqal-section-query.html#rasqal-free-query">rasqal_free_query</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-add-data-graph">rasqal_query_add_data_graph</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *uri,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *name_uri,
int flags);
void <a href="rasqal-section-query.html#rasqal-query-add-prefix">rasqal_query_add_prefix</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-prefix.html#rasqal-prefix">rasqal_prefix</a> *prefix);
void <a href="rasqal-section-query.html#rasqal-query-add-variable">rasqal_query_add_variable</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-variable.html#rasqal-variable">rasqal_variable</a> *var);
<a href="rasqal-section-query-results.html#rasqal-query-results">rasqal_query_results</a>* <a href="rasqal-section-query.html#rasqal-query-execute">rasqal_query_execute</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-all-variable-sequence">rasqal_query_get_all_variable_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-anonymous-variable-sequence">rasqal_query_get_anonymous_variable_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-bound-variable-sequence">rasqal_query_get_bound_variable_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-triple.html#rasqal-triple">rasqal_triple</a>* <a href="rasqal-section-query.html#rasqal-query-get-construct-triple">rasqal_query_get_construct_triple</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-construct-triples-sequence">rasqal_query_get_construct_triples_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-data.html#rasqal-data-graph">rasqal_data_graph</a>* <a href="rasqal-section-query.html#rasqal-query-get-data-graph">rasqal_query_get_data_graph</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-data-graph-sequence">rasqal_query_get_data_graph_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-get-distinct">rasqal_query_get_distinct</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern">rasqal_graph_pattern</a>* <a href="rasqal-section-query.html#rasqal-query-get-graph-pattern">rasqal_query_get_graph_pattern</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-graph-pattern-sequence">rasqal_query_get_graph_pattern_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
const char* <a href="rasqal-section-query.html#rasqal-query-get-label">rasqal_query_get_label</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-get-limit">rasqal_query_get_limit</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
const char* <a href="rasqal-section-query.html#rasqal-query-get-name">rasqal_query_get_name</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-get-offset">rasqal_query_get_offset</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-expression.html#rasqal-expression">rasqal_expression</a>* <a href="rasqal-section-query.html#rasqal-query-get-order-condition">rasqal_query_get_order_condition</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-order-conditions-sequence">rasqal_query_get_order_conditions_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-prefix.html#rasqal-prefix">rasqal_prefix</a>* <a href="rasqal-section-query.html#rasqal-query-get-prefix">rasqal_query_get_prefix</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-prefix-sequence">rasqal_query_get_prefix_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern">rasqal_graph_pattern</a>* <a href="rasqal-section-query.html#rasqal-query-get-query-graph-pattern">rasqal_query_get_query_graph_pattern</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-triple.html#rasqal-triple">rasqal_triple</a>* <a href="rasqal-section-query.html#rasqal-query-get-triple">rasqal_query_get_triple</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* <a href="rasqal-section-query.html#rasqal-query-get-triple-sequence">rasqal_query_get_triple_sequence</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
void* <a href="rasqal-section-query.html#rasqal-query-get-user-data">rasqal_query_get_user_data</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
<a href="rasqal-section-variable.html#rasqal-variable">rasqal_variable</a>* <a href="rasqal-section-query.html#rasqal-query-get-variable">rasqal_query_get_variable</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);
<a href="rasqal-section-query.html#rasqal-query-verb">rasqal_query_verb</a> <a href="rasqal-section-query.html#rasqal-query-get-verb">rasqal_query_get_verb</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-get-wildcard">rasqal_query_get_wildcard</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);
int <a href="rasqal-section-query.html#rasqal-query-has-variable">rasqal_query_has_variable</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *name);
int <a href="rasqal-section-query.html#rasqal-query-prepare">rasqal_query_prepare</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *query_string,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *base_uri);
void <a href="rasqal-section-query.html#rasqal-query-print">rasqal_query_print</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
FILE *fh);
void <a href="rasqal-section-query.html#rasqal-query-graph-pattern-visit">rasqal_query_graph_pattern_visit</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern-visit-fn">rasqal_graph_pattern_visit_fn</a> visit_fn,
void *data);
void <a href="rasqal-section-query.html#rasqal-query-set-default-generate-bnodeid-parameters">rasqal_query_set_default_generate_bnodeid_parameters</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *rdf_query,
char *prefix,
int base);
void <a href="rasqal-section-query.html#rasqal-query-set-distinct">rasqal_query_set_distinct</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int is_distinct);
void <a href="rasqal-section-query.html#rasqal-query-set-error-handler">rasqal_query_set_error_handler</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);
void <a href="rasqal-section-query.html#rasqal-query-set-fatal-error-handler">rasqal_query_set_fatal_error_handler</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);
void <a href="rasqal-section-query.html#rasqal-query-set-generate-bnodeid-handler">rasqal_query_set_generate_bnodeid_handler</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
rasqal_generate_bnodeid_handler handler);
void <a href="rasqal-section-query.html#rasqal-query-set-limit">rasqal_query_set_limit</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int limit);
void <a href="rasqal-section-query.html#rasqal-query-set-offset">rasqal_query_set_offset</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int offset);
void <a href="rasqal-section-query.html#rasqal-query-set-user-data">rasqal_query_set_user_data</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data);
int <a href="rasqal-section-query.html#rasqal-query-set-variable">rasqal_query_set_variable</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *name,
<a href="rasqal-section-literal.html#rasqal-literal">rasqal_literal</a> *value);
void <a href="rasqal-section-query.html#rasqal-query-set-warning-handler">rasqal_query_set_warning_handler</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);
const char* <a href="rasqal-section-query.html#rasqal-query-verb-as-string">rasqal_query_verb_as_string</a> (<a href="rasqal-section-query.html#rasqal-query-verb">rasqal_query_verb</a> verb);
int <a href="rasqal-section-query.html#rasqal-query-write">rasqal_query_write</a> (<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
>raptor_iostream</a> *iostr,
<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *format_uri,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *base_uri);
int <a href="rasqal-section-query.html#rasqal-query-iostream-write-escaped-counted-string">rasqal_query_iostream_write_escaped_counted_string</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
>raptor_iostream</a> *iostr,
unsigned char *string,
size_t len);
unsigned char* <a href="rasqal-section-query.html#rasqal-query-escape-counted-string">rasqal_query_escape_counted_string</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *string,
size_t len,
size_t *output_len_p);
int <a href="rasqal-section-query.html#rasqal-query-set-feature">rasqal_query_set_feature</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature,
int value);
int <a href="rasqal-section-query.html#rasqal-query-set-feature-string">rasqal_query_set_feature_string</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature,
unsigned char *value);
int <a href="rasqal-section-query.html#rasqal-query-get-feature">rasqal_query_get_feature</a> (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature);
const unsigned char* <a href="rasqal-section-query.html#rasqal-query-get-feature-string">rasqal_query_get_feature_string</a>
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature);
</pre>
</div>
<div class="refsect1" lang="en">
<a name="id2623792"></a><h2>Description</h2>
<p>
This class provides the main interface to the library. A query
can be constructed by parsing a string, retrieving it from a URI
and/or constructing it via API methods to build the query expression.
</p>
<p>The query structures can be read via methods to return
the query verb <a href="rasqal-section-query.html#rasqal-query-get-verb"><code class="function">rasqal_query_get_verb()</code></a>,
the <a href="rasqal-section-data.html#rasqal-data-graph"><span class="type">rasqal_data_graph</span></a> RDF data sources with <a href="rasqal-section-query.html#rasqal-query-get-data-graph"><code class="function">rasqal_query_get_data_graph()</code></a> etc.,
the <a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern"><span class="type">rasqal_graph_pattern</span></a> tree with <a href="rasqal-section-query.html#rasqal-query-get-query-graph-pattern"><code class="function">rasqal_query_get_query_graph_pattern()</code></a>,
the sequence of order conditions with <a href="rasqal-section-query.html#rasqal-query-get-order-condition"><code class="function">rasqal_query_get_order_condition()</code></a> etc.,
the <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> selected to return with
<a href="rasqal-section-query.html#rasqal-query-get-bound-variable-sequence"><code class="function">rasqal_query_get_bound_variable_sequence()</code></a> or <a href="rasqal-section-query.html#rasqal-query-get-all-variable-sequence"><code class="function">rasqal_query_get_all_variable_sequence()</code></a>,
and so on.
</p>
<p>
To process a query string, the <a href="rasqal-section-query.html#rasqal-query-prepare"><code class="function">rasqal_query_prepare()</code></a> method
parses the query string in some query language and initialises
the <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> structures.
</p>
<p>
The query can be evaluated with the internal query engine against
some source of matches using <a href="rasqal-section-query.html#rasqal-query-execute"><code class="function">rasqal_query_execute()</code></a> to give an
<a href="rasqal-section-query-results.html#rasqal-query-results"><span class="type">rasqal_query_results</span></a>. There are multiple forms of results that
can include variable bindings, a boolean or an RDF graph that
can be tested for with methods on <a href="rasqal-section-query-results.html#rasqal-query-results"><span class="type">rasqal_query_results</span></a> and
then retrieved.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2623947"></a><h2>Details</h2>
<div class="refsect2" lang="en">
<a name="id2623958"></a><h3>
<a name="rasqal-query-verb"></a>enum rasqal_query_verb</h3>
<a class="indexterm" name="id2623970"></a><pre class="programlisting">typedef enum {
/* internal */
RASQAL_QUERY_VERB_UNKNOWN = 0,
RASQAL_QUERY_VERB_SELECT = 1,
RASQAL_QUERY_VERB_CONSTRUCT = 2,
RASQAL_QUERY_VERB_DESCRIBE = 3,
RASQAL_QUERY_VERB_ASK = 4,
/* internal */
RASQAL_QUERY_VERB_LAST=RASQAL_QUERY_VERB_ASK
} rasqal_query_verb;
</pre>
<p>
Query main operation verbs describing the major type of query
being performed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-UNKNOWN:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_UNKNOWN</code></span></td>
<td> Internal
</td>
</tr>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-SELECT:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_SELECT</code></span></td>
<td> RDQL/SPARQL query select verb.
</td>
</tr>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-CONSTRUCT:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_CONSTRUCT</code></span></td>
<td> SPARQL query construct verb.
</td>
</tr>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-DESCRIBE:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_DESCRIBE</code></span></td>
<td> SPARQL query describe verb.
</td>
</tr>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-ASK:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_ASK</code></span></td>
<td> SPARQL query ask verb.
</td>
</tr>
<tr>
<td><span class="term"><a name="RASQAL-QUERY-VERB-LAST:CAPS"></a><code class="literal">RASQAL_QUERY_VERB_LAST</code></span></td>
<td> Internal
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624130"></a><h3>
<a name="rasqal-query"></a>rasqal_query</h3>
<a class="indexterm" name="id2624143"></a><pre class="programlisting">rasqal_graph_query* query;
</pre>
<p>
Rasqal query class.</p>
<p>
</p>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624162"></a><h3>
<a name="rasqal-new-query"></a>rasqal_new_query ()</h3>
<a class="indexterm" name="id2594719"></a><pre class="programlisting"><a href="rasqal-section-query.html#rasqal-query">rasqal_query</a>* rasqal_new_query (const char *name,
unsigned char *uri);</pre>
<p>
Constructor - create a new rasqal_query object.
</p>
<p>
A query language can be named or identified by a URI, either
of which is optional. The default query language will be used
if both are NULL. rasqal_languages_enumerate returns
information on the known names, labels and URIs.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
<td> the query language name (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> language uri (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a new <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object or NULL on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624240"></a><h3>
<a name="rasqal-free-query"></a>rasqal_free_query ()</h3>
<a class="indexterm" name="id2624251"></a><pre class="programlisting">void rasqal_free_query (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Destructor - destroy a <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr></tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624307"></a><h3>
<a name="rasqal-query-add-data-graph"></a>rasqal_query_add_data_graph ()</h3>
<a class="indexterm" name="id2624318"></a><pre class="programlisting">int rasqal_query_add_data_graph (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *uri,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *name_uri,
int flags);</pre>
<p>
Add a data graph to the query.
</p>
<p>
named_uri must be given if flags RASQAL_DATA_GRAPH_NAMED is set.
It is the name of the graph and also used as the base URI
when resolving any relative URIs for the graph in uri.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>uri</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> source uri for retrieval
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>name_uri</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> name uri (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>flags</code></em> :</span></td>
<td> RASQAL_DATA_GRAPH_NAMED or RASQAL_DATA_GRAPH_BACKGROUND
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624455"></a><h3>
<a name="rasqal-query-add-prefix"></a>rasqal_query_add_prefix ()</h3>
<a class="indexterm" name="id2624466"></a><pre class="programlisting">void rasqal_query_add_prefix (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-prefix.html#rasqal-prefix">rasqal_prefix</a> *prefix);</pre>
<p>
Add a namespace prefix to the query.
</p>
<p>
If the prefix has already been used, the old URI will be overridden.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>prefix</code></em> :</span></td>
<td> <a href="rasqal-section-prefix.html#rasqal-prefix"><span class="type">rasqal_prefix</span></a> namespace prefix, URI
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624546"></a><h3>
<a name="rasqal-query-add-variable"></a>rasqal_query_add_variable ()</h3>
<a class="indexterm" name="id2624557"></a><pre class="programlisting">void rasqal_query_add_variable (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-variable.html#rasqal-variable">rasqal_variable</a> *var);</pre>
<p>
Add a binding variable to the query.
</p>
<p>
See also rasqal_query_set_variable which assigns or removes a value to
a previously added variable in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>var</code></em> :</span></td>
<td> <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> variable
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624638"></a><h3>
<a name="rasqal-query-execute"></a>rasqal_query_execute ()</h3>
<a class="indexterm" name="id2624649"></a><pre class="programlisting"><a href="rasqal-section-query-results.html#rasqal-query-results">rasqal_query_results</a>* rasqal_query_execute (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Excute a query - run and return results.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-query-results.html#rasqal-query-results"><span class="type">rasqal_query_results</span></a> structure or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624715"></a><h3>
<a name="rasqal-query-get-all-variable-sequence"></a>rasqal_query_get_all_variable_sequence ()</h3>
<a class="indexterm" name="id2624728"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_all_variable_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of all variables mentioned in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624803"></a><h3>
<a name="rasqal-query-get-anonymous-variable-sequence"></a>rasqal_query_get_anonymous_variable_sequence ()</h3>
<a class="indexterm" name="id2624816"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_anonymous_variable_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of anonymous variables mentioned in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624891"></a><h3>
<a name="rasqal-query-get-bound-variable-sequence"></a>rasqal_query_get_bound_variable_sequence ()</h3>
<a class="indexterm" name="id2624904"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_bound_variable_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of variables to bind in the query.
</p>
<p>
This returns the sequence of variables that are explicitly chosen
via SELECT in RDQL, SPARQL. Or all variables mentioned with SELECT *</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2624984"></a><h3>
<a name="rasqal-query-get-construct-triple"></a>rasqal_query_get_construct_triple ()</h3>
<a class="indexterm" name="id2624998"></a><pre class="programlisting"><a href="rasqal-section-triple.html#rasqal-triple">rasqal_triple</a>* rasqal_query_get_construct_triple
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a triple in the sequence of construct triples.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-triple.html#rasqal-triple"><span class="type">rasqal_triple</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625086"></a><h3>
<a name="rasqal-query-get-construct-triples-sequence"></a>rasqal_query_get_construct_triples_sequence ()</h3>
<a class="indexterm" name="id2625100"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_construct_triples_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of triples for a construct.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-triple.html#rasqal-triple"><span class="type">rasqal_triple</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625173"></a><h3>
<a name="rasqal-query-get-data-graph"></a>rasqal_query_get_data_graph ()</h3>
<a class="indexterm" name="id2625184"></a><pre class="programlisting"><a href="rasqal-section-data.html#rasqal-data-graph">rasqal_data_graph</a>* rasqal_query_get_data_graph
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a rasqal_data_graph* in the sequence of data_graphs.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-data.html#rasqal-data-graph"><span class="type">rasqal_data_graph</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625273"></a><h3>
<a name="rasqal-query-get-data-graph-sequence"></a>rasqal_query_get_data_graph_sequence ()</h3>
<a class="indexterm" name="id2625285"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_data_graph_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of data_graph URIs.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625360"></a><h3>
<a name="rasqal-query-get-distinct"></a>rasqal_query_get_distinct ()</h3>
<a class="indexterm" name="id2625371"></a><pre class="programlisting">int rasqal_query_get_distinct (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the query distinct results flag.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 if the results should be distinct
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625432"></a><h3>
<a name="rasqal-query-get-graph-pattern"></a>rasqal_query_get_graph_pattern ()</h3>
<a class="indexterm" name="id2625445"></a><pre class="programlisting"><a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern">rasqal_graph_pattern</a>* rasqal_query_get_graph_pattern
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a graph_pattern in the sequence of graph_pattern expressions in the top query graph pattern.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern"><span class="type">rasqal_graph_pattern</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625534"></a><h3>
<a name="rasqal-query-get-graph-pattern-sequence"></a>rasqal_query_get_graph_pattern_sequence ()</h3>
<a class="indexterm" name="id2625547"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_graph_pattern_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of graph_patterns expressions inside the top query graph pattern.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern"><span class="type">rasqal_graph_pattern</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625622"></a><h3>
<a name="rasqal-query-get-label"></a>rasqal_query_get_label ()</h3>
<a class="indexterm" name="id2625633"></a><pre class="programlisting">const char* rasqal_query_get_label (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get a readable label for the query language.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> shared string label value
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625694"></a><h3>
<a name="rasqal-query-get-limit"></a>rasqal_query_get_limit ()</h3>
<a class="indexterm" name="id2625704"></a><pre class="programlisting">int rasqal_query_get_limit (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the query-specified limit on results.
</p>
<p>
This is the limit given in the query on the number of results allowed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> integer >=0 if a limit is given, otherwise <0
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625770"></a><h3>
<a name="rasqal-query-get-name"></a>rasqal_query_get_name ()</h3>
<a class="indexterm" name="id2625781"></a><pre class="programlisting">const char* rasqal_query_get_name (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get a short name for the query language.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> shared string label value
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625842"></a><h3>
<a name="rasqal-query-get-offset"></a>rasqal_query_get_offset ()</h3>
<a class="indexterm" name="id2625852"></a><pre class="programlisting">int rasqal_query_get_offset (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the query-specified offset on results.
</p>
<p>
This is the offset given in the query on the number of results allowed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> integer >=0 if a offset is given, otherwise <0
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2625918"></a><h3>
<a name="rasqal-query-get-order-condition"></a>rasqal_query_get_order_condition ()</h3>
<a class="indexterm" name="id2625931"></a><pre class="programlisting"><a href="rasqal-section-expression.html#rasqal-expression">rasqal_expression</a>* rasqal_query_get_order_condition
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a query ordering expression in the sequence of query ordering conditions.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-expression.html#rasqal-expression"><span class="type">rasqal_expression</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626020"></a><h3>
<a name="rasqal-query-get-order-conditions-sequence"></a>rasqal_query_get_order_conditions_sequence ()</h3>
<a class="indexterm" name="id2626034"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_order_conditions_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of query ordering conditions.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-expression.html#rasqal-expression"><span class="type">rasqal_expression</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626108"></a><h3>
<a name="rasqal-query-get-prefix"></a>rasqal_query_get_prefix ()</h3>
<a class="indexterm" name="id2626118"></a><pre class="programlisting"><a href="rasqal-section-prefix.html#rasqal-prefix">rasqal_prefix</a>* rasqal_query_get_prefix (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a prefix in the sequence of namespsace prefixes in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-prefix.html#rasqal-prefix"><span class="type">rasqal_prefix</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626206"></a><h3>
<a name="rasqal-query-get-prefix-sequence"></a>rasqal_query_get_prefix_sequence ()</h3>
<a class="indexterm" name="id2626218"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_prefix_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of namespace prefixes in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-prefix.html#rasqal-prefix"><span class="type">rasqal_prefix</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626293"></a><h3>
<a name="rasqal-query-get-query-graph-pattern"></a>rasqal_query_get_query_graph_pattern ()</h3>
<a class="indexterm" name="id2626306"></a><pre class="programlisting"><a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern">rasqal_graph_pattern</a>* rasqal_query_get_query_graph_pattern
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the top query graph pattern.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern"><span class="type">rasqal_graph_pattern</span></a> of the top query graph pattern
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626374"></a><h3>
<a name="rasqal-query-get-triple"></a>rasqal_query_get_triple ()</h3>
<a class="indexterm" name="id2626385"></a><pre class="programlisting"><a href="rasqal-section-triple.html#rasqal-triple">rasqal_triple</a>* rasqal_query_get_triple (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a triple in the sequence of matching triples in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-triple.html#rasqal-triple"><span class="type">rasqal_triple</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626472"></a><h3>
<a name="rasqal-query-get-triple-sequence"></a>rasqal_query_get_triple_sequence ()</h3>
<a class="indexterm" name="id2626485"></a><pre class="programlisting"><a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
>raptor_sequence</a>* rasqal_query_get_triple_sequence
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the sequence of matching triples in the query.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-sequence.html#raptor-sequence"
><span class="type">raptor_sequence</span></a> of <a href="rasqal-section-triple.html#rasqal-triple"><span class="type">rasqal_triple</span></a> pointers.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626559"></a><h3>
<a name="rasqal-query-get-user-data"></a>rasqal_query_get_user_data ()</h3>
<a class="indexterm" name="id2626570"></a><pre class="programlisting">void* rasqal_query_get_user_data (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get query user data.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> user data as set by rasqal_query_set_user_data
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626631"></a><h3>
<a name="rasqal-query-get-variable"></a>rasqal_query_get_variable ()</h3>
<a class="indexterm" name="id2626642"></a><pre class="programlisting"><a href="rasqal-section-variable.html#rasqal-variable">rasqal_variable</a>* rasqal_query_get_variable (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int idx);</pre>
<p>
Get a variable in the sequence of variables to bind.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>idx</code></em> :</span></td>
<td> index into the sequence (0 or larger)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> a <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> pointer or NULL if out of the sequence range
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626729"></a><h3>
<a name="rasqal-query-get-verb"></a>rasqal_query_get_verb ()</h3>
<a class="indexterm" name="id2626740"></a><pre class="programlisting"><a href="rasqal-section-query.html#rasqal-query-verb">rasqal_query_verb</a> rasqal_query_get_verb (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the query verb.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the operating verb of the query of type rasqal_query_verb
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626800"></a><h3>
<a name="rasqal-query-get-wildcard"></a>rasqal_query_get_wildcard ()</h3>
<a class="indexterm" name="id2626811"></a><pre class="programlisting">int rasqal_query_get_wildcard (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query);</pre>
<p>
Get the query verb is wildcard flag.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a>
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 if the query verb was a wildcard (such as SELECT *)
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626873"></a><h3>
<a name="rasqal-query-has-variable"></a>rasqal_query_has_variable ()</h3>
<a class="indexterm" name="id2626884"></a><pre class="programlisting">int rasqal_query_has_variable (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *name);</pre>
<p>
Find if the named variable is in the sequence of variables to bind.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
<td> variable name
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 if the variable name was found.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2626965"></a><h3>
<a name="rasqal-query-prepare"></a>rasqal_query_prepare ()</h3>
<a class="indexterm" name="id2626975"></a><pre class="programlisting">int rasqal_query_prepare (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *query_string,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *base_uri);</pre>
<p>
Prepare a query - typically parse it.
</p>
<p>
Some query languages may require a base URI to resolve any
relative URIs in the query string. If this is not given,
the current directory in the filesystem is used as the base URI.
</p>
<p>
The query string may be NULL in which case it is not parsed
and the query parts may be created by API calls such as
rasqal_query_add_source etc.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>query_string</code></em> :</span></td>
<td> the query string (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></td>
<td> base URI of query string (optional)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627087"></a><h3>
<a name="rasqal-query-print"></a>rasqal_query_print ()</h3>
<a class="indexterm" name="id2627098"></a><pre class="programlisting">void rasqal_query_print (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
FILE *fh);</pre>
<p>
Print a query in a debug format.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>fh</code></em> :</span></td>
<td> the <span class="type">FILE</span>* handle to print to.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627173"></a><h3>
<a name="rasqal-query-graph-pattern-visit"></a>rasqal_query_graph_pattern_visit ()</h3>
<a class="indexterm" name="id2627186"></a><pre class="programlisting">void rasqal_query_graph_pattern_visit
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern-visit-fn">rasqal_graph_pattern_visit_fn</a> visit_fn,
void *data);</pre>
<p>
Visit all graph patterns in a query with a user function <em class="parameter"><code>visit_fn</code></em>.
</p>
<p>
See also <a href="rasqal-section-graph-pattern.html#rasqal-graph-pattern-visit"><code class="function">rasqal_graph_pattern_visit()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> query
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>visit_fn</code></em> :</span></td>
<td> user function to operate on
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>data</code></em> :</span></td>
<td> user data to pass to function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627290"></a><h3>
<a name="rasqal-query-set-default-generate-bnodeid-parameters"></a>rasqal_query_set_default_generate_bnodeid_parameters ()</h3>
<a class="indexterm" name="id2627304"></a><pre class="programlisting">void rasqal_query_set_default_generate_bnodeid_parameters
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *rdf_query,
char *prefix,
int base);</pre>
<p>
Sets the parameters for the default algorithm used to generate
blank node IDs. The default algorithm uses both <em class="parameter"><code>prefix</code></em> and <em class="parameter"><code>base</code></em>
to generate a new identifier. The exact identifier generated is
not guaranteed to be a strict concatenation of <em class="parameter"><code>prefix</code></em> and <em class="parameter"><code>base</code></em>
but will use both parts.
</p>
<p>
For finer control of the generated identifiers, use
<code class="function">rasqal_set_default_generate_bnodeid_handler()</code>
</p>
<p>
If prefix is NULL, the default prefix is used (currently "bnodeid")
If base is less than 1, it is initialised to 1.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>rdf_query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>prefix</code></em> :</span></td>
<td> prefix string
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>base</code></em> :</span></td>
<td> integer base identifier
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627438"></a><h3>
<a name="rasqal-query-set-distinct"></a>rasqal_query_set_distinct ()</h3>
<a class="indexterm" name="id2627449"></a><pre class="programlisting">void rasqal_query_set_distinct (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int is_distinct);</pre>
<p>
Set the query distinct results flag.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>is_distinct</code></em> :</span></td>
<td> non-0 if distinct
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627519"></a><h3>
<a name="rasqal-query-set-error-handler"></a>rasqal_query_set_error_handler ()</h3>
<a class="indexterm" name="id2627531"></a><pre class="programlisting">void rasqal_query_set_error_handler (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);</pre>
<p>
Set the query error handling function.
</p>
<p>
The function will receive callbacks when the query fails.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the query
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> user data to pass to function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em> :</span></td>
<td> pointer to the function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627619"></a><h3>
<a name="rasqal-query-set-fatal-error-handler"></a>rasqal_query_set_fatal_error_handler ()</h3>
<a class="indexterm" name="id2627632"></a><pre class="programlisting">void rasqal_query_set_fatal_error_handler
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);</pre>
<p>
Set the query error handling function.
</p>
<p>
The function will receive callbacks when the query fails.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the query
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> user data to pass to function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em> :</span></td>
<td> pointer to the function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627721"></a><h3>
<a name="rasqal-query-set-generate-bnodeid-handler"></a>rasqal_query_set_generate_bnodeid_handler ()</h3>
<a class="indexterm" name="id2627735"></a><pre class="programlisting">void rasqal_query_set_generate_bnodeid_handler
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
rasqal_generate_bnodeid_handler handler);</pre>
<p>
Set the generate blank node ID handler function for the query.
</p>
<p>
Sets the function to generate blank node IDs for the query.
The handler is called with a pointer to the rasqal_query, the
<em class="parameter"><code>user_data</code></em> pointer and a user_bnodeid which is the value of
a user-provided blank node identifier (may be NULL).
It can either be returned directly as the generated value when present or
modified. The passed in value must be <code class="function">free()</code>d if it is not used.
</p>
<p>
If handler is NULL, the default method is used</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> user data pointer for callback
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em> :</span></td>
<td> generate blank ID callback function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627854"></a><h3>
<a name="rasqal-query-set-limit"></a>rasqal_query_set_limit ()</h3>
<a class="indexterm" name="id2627864"></a><pre class="programlisting">void rasqal_query_set_limit (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int limit);</pre>
<p>
Set the query-specified limit on results.
</p>
<p>
This is the limit given in the query on the number of results allowed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>limit</code></em> :</span></td>
<td> the limit on results, >=0 to set a limit, <0 to have no limit
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2627940"></a><h3>
<a name="rasqal-query-set-offset"></a>rasqal_query_set_offset ()</h3>
<a class="indexterm" name="id2627950"></a><pre class="programlisting">void rasqal_query_set_offset (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
int offset);</pre>
<p>
Set the query-specified offset on results.
</p>
<p>
This is the offset given in the query on the number of results allowed.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>offset</code></em> :</span></td>
<td> offset for results, >=0 to set an offset, <0 to have no offset
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628035"></a><h3>
<a name="rasqal-query-set-user-data"></a>rasqal_query_set_user_data ()</h3>
<a class="indexterm" name="id2628050"></a><pre class="programlisting">void rasqal_query_set_user_data (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data);</pre>
<p>
Set the query user data.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a>
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> some user data to associate with the query
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628128"></a><h3>
<a name="rasqal-query-set-variable"></a>rasqal_query_set_variable ()</h3>
<a class="indexterm" name="id2628143"></a><pre class="programlisting">int rasqal_query_set_variable (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *name,
<a href="rasqal-section-literal.html#rasqal-literal">rasqal_literal</a> *value);</pre>
<p>
Add a binding variable to the query.
</p>
<p>
See also rasqal_query_add_variable which adds a new binding variable
and must be called before this method is invoked.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
<td> <a href="rasqal-section-variable.html#rasqal-variable"><span class="type">rasqal_variable</span></a> variable
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
<td> <a href="rasqal-section-literal.html#rasqal-literal"><span class="type">rasqal_literal</span></a> value to set or NULL
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628274"></a><h3>
<a name="rasqal-query-set-warning-handler"></a>rasqal_query_set_warning_handler ()</h3>
<a class="indexterm" name="id2628289"></a><pre class="programlisting">void rasqal_query_set_warning_handler
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
void *user_data,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-general.html#raptor-message-handler"
>raptor_message_handler</a> handler);</pre>
<p>
Set the query warning handling function.
</p>
<p>
The function will receive callbacks when the query gives a warning.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> the query
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
<td> user data to pass to function
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>handler</code></em> :</span></td>
<td> pointer to the function
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628388"></a><h3>
<a name="rasqal-query-verb-as-string"></a>rasqal_query_verb_as_string ()</h3>
<a class="indexterm" name="id2628402"></a><pre class="programlisting">const char* rasqal_query_verb_as_string (<a href="rasqal-section-query.html#rasqal-query-verb">rasqal_query_verb</a> verb);</pre>
<p>
Get a string for the query verb.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>verb</code></em> :</span></td>
<td> the <a href="rasqal-section-query.html#rasqal-query-verb"><span class="type">rasqal_query_verb</span></a> verb of the query
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> pointer to a shared string label for the query verb
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628472"></a><h3>
<a name="rasqal-query-write"></a>rasqal_query_write ()</h3>
<a class="indexterm" name="id2628486"></a><pre class="programlisting">int rasqal_query_write (<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
>raptor_iostream</a> *iostr,
<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *format_uri,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
>raptor_uri</a> *base_uri);</pre>
<p>
Write a query to an iostream in a specified format.
</p>
<p>
The supported URIs for the format_uri are:
</p>
<p>
Default: SPARQL Query Language 2006-04-06
http://www.w3.org/TR/2006/CR-rdf-sparql-query-20060406/</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>iostr</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
><span class="type">raptor_iostream</span></a> to write the query to
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> pointer.
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>format_uri</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> describing the format to write (or NULL for default)
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>base_uri</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-uri.html#raptor-uri"
><span class="type">raptor_uri</span></a> base URI of the output format
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628651"></a><h3>
<a name="rasqal-query-iostream-write-escaped-counted-string"></a>rasqal_query_iostream_write_escaped_counted_string ()</h3>
<a class="indexterm" name="id2628666"></a><pre class="programlisting">int rasqal_query_iostream_write_escaped_counted_string
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
>raptor_iostream</a> *iostr,
unsigned char *string,
size_t len);</pre>
<p>
Write a string to an iostream in escaped form suitable for the query string.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>iostr</code></em> :</span></td>
<td> <a
href="/usr/share/gtk-doc/html/raptor/raptor-section-iostream.html#raptor-iostream"
><span class="type">raptor_iostream</span></a> to write the escaped string to
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>string</code></em> :</span></td>
<td> string to escape
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>len</code></em> :</span></td>
<td> Length of string to escape
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non-0 on failure
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628809"></a><h3>
<a name="rasqal-query-escape-counted-string"></a>rasqal_query_escape_counted_string ()</h3>
<a class="indexterm" name="id2628823"></a><pre class="programlisting">unsigned char* rasqal_query_escape_counted_string
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
unsigned char *string,
size_t len,
size_t *output_len_p);</pre>
<p>
Convert a string into an escaped form suitable for the query string.
</p>
<p>
The returned string must be freed by the caller with
<a href="rasqal-section-general.html#rasqal-free-memory"><code class="function">rasqal_free_memory()</code></a></p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>string</code></em> :</span></td>
<td> string to escape
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>len</code></em> :</span></td>
<td> Length of string to escape
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>output_len_p</code></em> :</span></td>
<td> Pointer to store length of output string (or NULL)
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> the escaped string or NULL on failure.
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2628972"></a><h3>
<a name="rasqal-query-set-feature"></a>rasqal_query_set_feature ()</h3>
<a class="indexterm" name="id2628986"></a><pre class="programlisting">int rasqal_query_set_feature (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature,
int value);</pre>
<p>
Set various query features.
</p>
<p>
The allowed features are available via <a href="rasqal-section-general.html#rasqal-features-enumerate"><code class="function">rasqal_features_enumerate()</code></a>.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>feature</code></em> :</span></td>
<td> feature to set from enumerated <a href="rasqal-section-general.html#rasqal-feature"><span class="type">rasqal_feature</span></a> values
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
<td> integer feature value
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non 0 on failure or if the feature is unknown
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2629120"></a><h3>
<a name="rasqal-query-set-feature-string"></a>rasqal_query_set_feature_string ()</h3>
<a class="indexterm" name="id2629134"></a><pre class="programlisting">int rasqal_query_set_feature_string (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature,
unsigned char *value);</pre>
<p>
Set query features with string values.
</p>
<p>
The allowed features are available via <a href="rasqal-section-general.html#rasqal-features-enumerate"><code class="function">rasqal_features_enumerate()</code></a>.
If the feature type is integer, the value is interpreted as an integer.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>feature</code></em> :</span></td>
<td> feature to set from enumerated <a href="rasqal-section-general.html#rasqal-feature"><span class="type">rasqal_feature</span></a> values
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
<td> feature value
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> non 0 on failure or if the feature is unknown
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2629269"></a><h3>
<a name="rasqal-query-get-feature"></a>rasqal_query_get_feature ()</h3>
<a class="indexterm" name="id2629282"></a><pre class="programlisting">int rasqal_query_get_feature (<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature);</pre>
<p>
Get various query features.
</p>
<p>
The allowed features are available via <a href="rasqal-section-general.html#rasqal-features-enumerate"><code class="function">rasqal_features_enumerate()</code></a>.
</p>
<p>
Note: no feature value is negative</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>feature</code></em> :</span></td>
<td> feature to get value
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> feature value or < 0 for an illegal feature
</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2" lang="en">
<a name="id2629391"></a><h3>
<a name="rasqal-query-get-feature-string"></a>rasqal_query_get_feature_string ()</h3>
<a class="indexterm" name="id2629406"></a><pre class="programlisting">const unsigned char* rasqal_query_get_feature_string
(<a href="rasqal-section-query.html#rasqal-query">rasqal_query</a> *query,
<a href="rasqal-section-general.html#rasqal-feature">rasqal_feature</a> feature);</pre>
<p>
Get query features with string values.
</p>
<p>
The allowed features are available via <a href="rasqal-section-general.html#rasqal-features-enumerate"><code class="function">rasqal_features_enumerate()</code></a>.
If a string is returned, it must be freed by the caller.</p>
<p>
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><span class="term"><em class="parameter"><code>query</code></em> :</span></td>
<td> <a href="rasqal-section-query.html#rasqal-query"><span class="type">rasqal_query</span></a> query object
</td>
</tr>
<tr>
<td><span class="term"><em class="parameter"><code>feature</code></em> :</span></td>
<td> feature to get value
</td>
</tr>
<tr>
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
<td> feature value or NULL for an illegal feature or no value
</td>
</tr>
</tbody>
</table></div>
</div>
</div>
</div>
</body>
</html>