Query Results

## Query Results Query Results — Query results as variable bindings, boolean or RDF graphs. |

## Functions

rasqal_query_results * | rasqal_new_query_results ()
rasqal_query_results * | rasqal_new_query_results2 ()
rasqal_query_results * | rasqal_new_query_results_from_string ()
void | rasqal_free_query_results ()
int | rasqal_query_results_add_row ()
int | rasqal_query_results_finished ()
const unsigned char * | rasqal_query_results_get_binding_name ()
rasqal_literal * | rasqal_query_results_get_binding_value ()
rasqal_literal * | rasqal_query_results_get_binding_value_by_name ()
int | rasqal_query_results_get_bindings ()
int | rasqal_query_results_get_bindings_count ()
int | rasqal_query_results_get_boolean ()
int | rasqal_query_results_get_count ()
rasqal_query * | rasqal_query_results_get_query ()
raptor_statement * | rasqal_query_results_get_triple ()
rasqal_row * | rasqal_query_results_get_row_by_offset ()
rasqal_query_results_type | rasqal_query_results_get_type ()
int | rasqal_query_results_is_bindings ()
int | rasqal_query_results_is_boolean ()
int | rasqal_query_results_is_graph ()
int | rasqal_query_results_is_syntax ()
int | rasqal_query_results_next ()
int | rasqal_query_results_next_triple ()
int | rasqal_query_results_read ()
int | rasqal_query_results_write ()
const char * | rasqal_query_results_type_label ()
int | rasqal_query_results_rewind ()

## Types and Values

typedef | rasqal_query_results
enum | rasqal_query_results_type

## Description

A query results object is only ever constructed by the internal query engine evaluating a rasqal_query with `rasqal_query_execute()`. It provides interface to the multiple types of result supported.

There are a large set of methods for returning all or parts of a variable binding query result including the names, values or individuals. A boolean result is straightforward to get with `rasqal_query_results_get_boolean()` and an RDF graph returns a sequence of raptor triples than can be easily passed to the Raptor library for serializing to a syntax.

## Functions

### rasqal_new_query_results ()

    rasqal_query_results *
    rasqal_new_query_results (rasqal_world *world,
                              rasqal_query *query,
                              rasqal_query_results_type type,
                              rasqal_variables_table *vars_table);

`rasqal_new_query_results` is deprecated and should not be used in newly-written code.

#### Returns

### rasqal_new_query_results2 ()

    rasqal_query_results *
    rasqal_new_query_results2 (rasqal_world *world,
                               rasqal_query *query,
                               rasqal_query_results_type type);

#### Returns

### rasqal_new_query_results_from_string ()

    rasqal_query_results *
    rasqal_new_query_results_from_string (rasqal_world *world,
                                          rasqal_query_results_type type,
                                          raptor_uri *base_uri,
                                          const char *string,
                                          size_t string_len);

#### Returns

### rasqal_free_query_results ()

    void
    rasqal_free_query_results (rasqal_query_results *query_results);

### rasqal_query_results_add_row ()

    int
    rasqal_query_results_add_row (rasqal_query_results *query_results,
                                  rasqal_row *row);

#### Returns

### rasqal_query_results_finished ()

    int
    rasqal_query_results_finished (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_binding_name ()

    const unsigned char *
    rasqal_query_results_get_binding_name (rasqal_query_results *query_results,
                                           int offset);

#### Returns

### rasqal_query_results_get_binding_value ()

    rasqal_literal *
    rasqal_query_results_get_binding_value
                                   (rasqal_query_results *query_results,
                                    int offset);

#### Returns

### rasqal_query_results_get_binding_value_by_name ()

    rasqal_literal *
    rasqal_query_results_get_binding_value_by_name
                                   (rasqal_query_results *query_results,
                                    const char *name);

#### Returns

### rasqal_query_results_get_bindings ()

    int
    rasqal_query_results_get_bindings (rasqal_query_results *query_results,
                                       const unsigned char ***names,
                                       rasqal_literal ***values);

#### Returns

### rasqal_query_results_get_bindings_count ()

    int
    rasqal_query_results_get_bindings_count
                                   (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_boolean ()

    int
    rasqal_query_results_get_boolean (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_count ()

    int
    rasqal_query_results_get_count (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_query ()

    rasqal_query *
    rasqal_query_results_get_query (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_triple ()

    raptor_statement *
    rasqal_query_results_get_triple (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_get_row_by_offset ()

    rasqal_row *
    rasqal_query_results_get_row_by_offset
                                   (rasqal_query_results *query_results,
                                    int result_offset);

#### Returns

### rasqal_query_results_get_type ()

    rasqal_query_results_type
    rasqal_query_results_get_type (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_is_bindings ()

    int
    rasqal_query_results_is_bindings (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_is_boolean ()

    int
    rasqal_query_results_is_boolean (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_is_graph ()

    int
    rasqal_query_results_is_graph (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_is_syntax ()

    int
    rasqal_query_results_is_syntax (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_next ()

    int
    rasqal_query_results_next (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_next_triple ()

    int
    rasqal_query_results_next_triple (rasqal_query_results *query_results);

#### Returns

### rasqal_query_results_read ()

    int
    rasqal_query_results_read (raptor_iostream *iostr,
                               rasqal_query_results *results,
                               const char *name,
                               const char *mime_type,
                               raptor_uri *format_uri,
                               raptor_uri *base_uri);

#### Returns

### rasqal_query_results_write ()

    int
    rasqal_query_results_write (raptor_iostream *iostr,
                                rasqal_query_results *results,
                                const char *name,
                                const char *mime_type,
                                raptor_uri *format_uri,
                                raptor_uri *base_uri);

#### Returns

### rasqal_query_results_type_label ()

    const char *
    rasqal_query_results_type_label (rasqal_query_results_type type);

#### Returns

### rasqal_query_results_rewind ()

    int
    rasqal_query_results_rewind (rasqal_query_results *query_results);

#### Returns

## Types and Values

### rasqal_query_results

    rasqal_graph_query_results* query_results;

Rasqal query results class.

### enum rasqal_query_results_type

Query result type.

#### Members

RASQAL_QUERY_RESULTS_BINDINGS | variable binding |
RASQAL_QUERY_RESULTS_BOOLEAN | a single boolean |
RASQAL_QUERY_RESULTS_GRAPH | an RDF graph |
RASQAL_QUERY_RESULTS_SYNTAX | a syntax |
RASQAL_QUERY_RESULTS_UNKNOWN | unknown type |
RASQAL_QUERY_RESULTS_LAST | internal |