## Changes between Rasqal 0.9.21 and 0.9.22

### New functions, types and enums

Functions

- void `rasqal_free_xsd_datetime`(rasqal_xsd_datetime* dt)

- const unsigned char* `rasqal_literal_as_counted_string`(rasqal_literal* l, size_t *len_p, int flags, int *error)

- rasqal_literal* `rasqal_new_datetime_literal_from_datetime`(rasqal_world* world, rasqal_xsd_datetime* dt)

- rasqal_xsd_datetime* `rasqal_new_xsd_datetime`(rasqal_world* world, const char *datetime_string)

- rasqal_xsd_datetime* `rasqal_new_xsd_datetime_from_timeval`(rasqal_world* world, struct timeval *tv)

- rasqal_xsd_datetime* `rasqal_new_xsd_datetime_from_unixtime`(rasqal_world* world, time_t secs)

- rasqal_query_results_type `rasqal_query_get_result_type`(rasqal_query* query)

- rasqal_row* `rasqal_query_results_get_row_by_offset`(rasqal_query_results* query_results, int result_offset)

- rasqal_query_results_type `rasqal_query_results_get_type`(rasqal_query_results* query_results)

- int `rasqal_query_results_rewind`(rasqal_query_results* query_results)

- int `rasqal_query_set_store_results`(rasqal_query* query, int store_results)

- const char* `rasqal_world_guess_query_results_format_name`(rasqal_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier)

- void `rasqal_world_set_log_handler`(rasqal_world* world, void *user_data, raptor_log_handler handler)

- int `rasqal_xsd_datetime_compare`(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2)

- int `rasqal_xsd_datetime_equals`(const rasqal_xsd_datetime *dt1, const rasqal_xsd_datetime *dt2)

- struct timeval* `rasqal_xsd_datetime_get_as_timeval`(rasqal_xsd_datetime *dt)

- time_t `rasqal_xsd_datetime_get_as_unixtime`(rasqal_xsd_datetime* dt)

- rasqal_xsd_decimal* `rasqal_xsd_datetime_get_seconds_as_decimal`(rasqal_world* world, rasqal_xsd_datetime* dt)

- char* `rasqal_xsd_datetime_get_timezone_as_counted_string`(rasqal_xsd_datetime *dt, size_t *len_p)

- int `rasqal_xsd_datetime_set_from_timeval`(rasqal_xsd_datetime *dt, struct timeval *tv)

- int `rasqal_xsd_datetime_set_from_unixtime`(rasqal_xsd_datetime* dt, time_t clock)

- char* `rasqal_xsd_datetime_to_counted_string`(const rasqal_xsd_datetime *dt, size_t *len_p)

- char* `rasqal_xsd_datetime_to_string`(const rasqal_xsd_datetime *dt)

Types

- rasqal_xsd_datetime

Enums

- `RASQAL_EXPR_CONCAT` - Expression for SPARQL 1.1 CONCAT(strings)

- `RASQAL_EXPR_CONTAINS` - Expression for SPARQL 1.1 CONTAINS(str, str)

- `RASQAL_EXPR_CURRENT_DATETIME` - Expression for LAQRS CURRENT_DATETIME( void )

- `RASQAL_EXPR_DAY` - Expression for SPARQL 1.1 DAY(datetime)

- `RASQAL_EXPR_ENCODE_FOR_URI` - Expression for SPARQL 1.1 ENCODE_FOR_URI(str)

- `RASQAL_EXPR_FROM_UNIXTIME` - Expression for LAQRS FROM_UNIXTIME(int)

- `RASQAL_EXPR_HOURS` - Expression for SPARQL 1.1 HOURS(datetime)

- `RASQAL_EXPR_LCASE` - Expression for SPARQL 1.1 LCASE(str)

- `RASQAL_EXPR_MINUTES` - Expression for SPARQL 1.1 MINUTES(datetime)

- `RASQAL_EXPR_MONTH` - Expression for SPARQL 1.1 MONTH(datetime)

- `RASQAL_EXPR_NOW` - Expression for LAQRS NOW( void )

- `RASQAL_EXPR_SECONDS` - Expression for SPARQL 1.1 SECONDS(datetime)

- `RASQAL_EXPR_STRENDS` - Expression for SPARQL 1.1 STRENDS(str, str)

- `RASQAL_EXPR_STRLEN` - Expression for SPARQL 1.1 STRLEN(str)

- `RASQAL_EXPR_STRSTARTS` - Expression for SPARQL 1.1 STRSTARTS(str, str)

- `RASQAL_EXPR_SUBSTR` - Expression for SPARQL 1.1 SUBSTR(str, start[,offset])

- `RASQAL_EXPR_TIMEZONE` - Expression for SPARQL 1.1 TIMEZONE(datetime)

- `RASQAL_EXPR_TO_UNIXTIME` - Expression for LAQRS TO_UNIXTIME(datetime)

- `RASQAL_EXPR_UCASE` - Expression for SPARQL 1.1 UCASE(str)

- `RASQAL_EXPR_YEAR` - Expression for SPARQL 1.1 YEAR(datetime)

- `RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER` - Bitflag for `rasqal_query_results_formats_check`() to request formats that can be read.

- `RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER` - Bitflag for `rasqal_query_results_formats_check`() to request formats that can be written.

- `RASQAL_QUERY_RESULTS_UNKNOWN` - Unknown result format type

- `RASQAL_XSD_DATETIME_NO_TZ` - Sentinel XSD Decimal timezone value indicating no timezone is present.

### Deleted functions, types and enums

Functions

- rasqal_new_variable - Replaced by `rasqal_variables_table_add`()

- rasqal_new_variable_typed - Replaced by `rasqal_variables_table_add`()

- rasqal_query_results_formatter_get_mime_type - Use `rasqal_world_get_query_results_format_description`() to get list of mime types.

- rasqal_query_set_error_handler - Replaced by `rasqal_world_set_log_handler`()

- rasqal_query_set_fatal_error_handler - Replaced by `rasqal_world_set_log_handler`()

- rasqal_query_set_warning_handler - Replaced by `rasqal_world_set_log_handler`()

### Renamed function and enums

0.9.21 function | 0.9.22 function | Notes
--- | --- | ---
rasqal_new_function_expression2 | `rasqal_new_function_expression` |
rasqal_query_add_data_graph2 | `rasqal_query_add_data_graph` |
rasqal_query_results_read2 | `rasqal_query_results_read` |
rasqal_query_results_write2 | `rasqal_query_results_write` |

### Changed functions and types

0.9.21 function | 0.9.22 function | Notes
--- | --- | ---
int rasqal_world_set_generate_bnodeid_handler(rasqal_world* world, void *user_data, rasqal_generate_bnodeid_handler2 handler) | int `rasqal_world_set_generate_bnodeid_handler`(rasqal_world* world, void *user_data, rasqal_generate_bnodeid_handler handler) |
int rasqal_query_results_formats_enumerate(rasqal_world* world, unsigned int counter, const char **name, const char **label, const unsigned char **uri_string, const char **mime_type, int* flags) | const raptor_syntax_description* `rasqal_world_get_query_results_format_description`(rasqal_world* world, unsigned int counter) |
void rasqal_query_set_default_generate_bnodeid_parameters(rasqal_query* rdf_query, char *prefix, int base) | int `rasqal_world_set_default_generate_bnodeid_parameters`(rasqal_world* world, char *prefix, int base) |
void rasqal_query_set_generate_bnodeid_handler(rasqal_query* query, void *user_data, rasqal_generate_bnodeid_handler handler) | int `rasqal_world_set_generate_bnodeid_handler`(rasqal_world* world, void *user_data, rasqal_generate_bnodeid_handler handler) |
int rasqal_query_add_data_graph(rasqal_query* query, raptor_uri* uri, raptor_uri* name_uri, int flags) | int `rasqal_query_add_data_graph`(rasqal_query* query, rasqal_data_graph* data_graph) |
int rasqal_query_results_write(raptor_iostream *iostr, rasqal_query_results *results, raptor_uri *format_uri, raptor_uri *base_uri) | 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) |
int rasqal_query_results_read(raptor_iostream *iostr, rasqal_query_results *results, raptor_uri *format_uri, raptor_uri *base_uri) | 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) |
int rasqal_query_results_formats_check(rasqal_world* world, const char *name, raptor_uri* uri, const char *mime_type, int flags) | int `rasqal_query_results_formats_check`(rasqal_world* world, const char *name, raptor_uri* uri, const char *mime_type) |
int rasqal_query_results_formats_check2(rasqal_world* world, const char *name, raptor_uri* uri, const char *mime_type, int flags) | int `rasqal_query_results_formats_check`(rasqal_world* world, const char *name, raptor_uri* uri, const char *mime_type) |
rasqal_query_results_formatter* rasqal_new_query_results_formatter(rasqal_world* world, const char *name, const char *mime_type, raptor_uri* format_uri) | rasqal_query_results_formatter* `rasqal_new_query_results_formatter`(rasqal_world* world, const char *name, raptor_uri* format_uri) |
rasqal_query_results_formatter* rasqal_new_query_results_formatter2(rasqal_world* world, const char *name, const char *mime_type, raptor_uri* format_uri) | rasqal_query_results_formatter* `rasqal_new_query_results_formatter`(rasqal_world* world, const char *name, raptor_uri* format_uri) |
rasqal_query_results_formatter* rasqal_new_query_results_formatter_by_mime_type(rasqal_world* world, const char *mime_type) | rasqal_query_results_formatter* `rasqal_new_query_results_formatter_for_content`(rasqal_world* world, raptor_uri *uri, const char *mime_type, const unsigned char *buffer, size_t len, const unsigned char *identifier) |
rasqal_data_graph* rasqal_new_data_graph(rasqal_world* world, raptor_uri* uri, raptor_uri* name_uri, int flags) | rasqal_data_graph* `rasqal_new_data_graph_from_uri`(rasqal_world* world, raptor_uri* uri, raptor_uri* name_uri, int flags, const char* format_type, const char* format_name, raptor_uri* format_uri) |
rasqal_expression* rasqal_new_function_expression(rasqal_world* world, raptor_uri* name, raptor_sequence* args) | rasqal_expression* `rasqal_new_function_expression`(rasqal_world* world, raptor_uri* name, raptor_sequence* args, raptor_sequence* params, unsigned int flags) |
rasqal_expression* rasqal_new_coalesce_expression(rasqal_world* world, raptor_sequence* args) | rasqal_expression* `rasqal_new_expr_seq_expression`(rasqal_world* world, rasqal_op op, raptor_sequence* args) | Call it with op `RASQAL_EXPR_COALESCE`

0.9.21 type | 0.9.22 type | Notes
--- | --- | ---
rasqal_data_graph | rasqal_data_graph | Added const for format_type and format_name fields.
rasqal_generate_bnodeid_handler2 | rasqal_generate_bnodeid_handler | Handler now takes a pointer to the rasqal_world object not rasqal_query.
rasqal_literal | rasqal_literal | Added datetime to value union.