Exemplo n.º 1
0
static void
rasqal_query_results_update_bindings(rasqal_query_results* query_results)
{
  int i;
  int size;

  RASQAL_ASSERT_OBJECT_POINTER_RETURN(query_results, rasqal_query_results);

  /* bind the construct variables again if running through a sequence */
  size = rasqal_variables_table_get_named_variables_count(query_results->vars_table);
  for(i = 0; i< size; i++) {
    rasqal_variable* v;
    rasqal_row* row;
    rasqal_literal* value = NULL;

    v = rasqal_variables_table_get(query_results->vars_table, i);

    rasqal_query_results_ensure_have_row_internal(query_results);
    row = query_results->row;
    if(row) {
      if (i >= row->size)
        continue;
      value = row->values[i];
    } else
      query_results->finished = 1;

    rasqal_variable_set_value(v, rasqal_new_literal_from_literal(value));
  }
}
Exemplo n.º 2
0
/**
 * rasqal_triple_set_origin:
 * @t: The triple object. 
 * @l: The #rasqal_literal object to set as origin.
 * 
 * Set the origin field of a #rasqal_triple.
 **/
void
rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal* l)
{
  RASQAL_ASSERT_OBJECT_POINTER_RETURN(t, rasqal_triple);

  t->origin = l;
}
Exemplo n.º 3
0
/**
 * rasqal_world_set_log_handler:
 * @world: rasqal_world object
 * @user_data: user data for log handler function
 * @handler: log handler function
 *
 * Set the log handler for this rasqal_world.
 **/
void
rasqal_world_set_log_handler(rasqal_world* world, void *user_data,
                             raptor_log_handler handler)
{
  RASQAL_ASSERT_OBJECT_POINTER_RETURN(world, rasqal_world);

  world->log_handler = handler;
  world->log_handler_user_data = user_data;
}
Exemplo n.º 4
0
/**
 * rasqal_triple_write:
 * @t: #rasqal_triple object.
 * @iostr: The #raptor_iostream handle to write to.
 * 
 * Write a Rasqal triple to an iostream in a debug format.
 * 
 * The print debug format may change in any release.
 **/
void
rasqal_triple_write(rasqal_triple* t, raptor_iostream* iostr)
{
  RASQAL_ASSERT_OBJECT_POINTER_RETURN(t, rasqal_triple);
  RASQAL_ASSERT_OBJECT_POINTER_RETURN(iostr, raptor_iostream);
  
  raptor_iostream_counted_string_write("triple(", 7, iostr);
  rasqal_literal_write(t->subject, iostr);
  raptor_iostream_counted_string_write(", ", 2, iostr);
  rasqal_literal_write(t->predicate, iostr);
  raptor_iostream_counted_string_write(", ", 2, iostr);
  rasqal_literal_write(t->object, iostr);
  raptor_iostream_write_byte(')', iostr);
  if(t->origin) {
    raptor_iostream_counted_string_write(" with origin(", 13, iostr);
    rasqal_literal_write(t->origin, iostr);
    raptor_iostream_write_byte(')', iostr);
  }
}
Exemplo n.º 5
0
void
rasqal_query_results_remove_query_reference(rasqal_query_results* query_results)
{
  rasqal_query* query;

  RASQAL_ASSERT_OBJECT_POINTER_RETURN(query_results, rasqal_query_results);

  query = query_results->query;
  query_results->query = NULL;

  rasqal_free_query(query);
}
Exemplo n.º 6
0
/**
 * rasqal_world_set_raptor:
 * @world: rasqal_world object
 * @raptor_world_ptr: raptor_world object
 * 
 * Set the #raptor_world instance to be used with this #rasqal_world.
 *
 * If no raptor_world instance is set with this function,
 * rasqal_world_open() creates a new instance.
 *
 * Ownership of the raptor_world is not taken. If the raptor library
 * instance is set with this function, rasqal_free_world() will not
 * free it.
 *
 **/
void
rasqal_world_set_raptor(rasqal_world* world, raptor_world* raptor_world_ptr)
{
  RASQAL_ASSERT_OBJECT_POINTER_RETURN(world, rasqal_world);
  world->raptor_world_ptr = raptor_world_ptr;
}