rasqal.h | rasqal.h | |||
---|---|---|---|---|
skipping to change at line 38 | skipping to change at line 38 | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
/** | /** | |||
* RASQAL_VERSION: | * RASQAL_VERSION: | |||
* | * | |||
* Rasqal library version number | * Rasqal library version number | |||
* | * | |||
* Format: major * 10000 + minor * 100 + release | * Format: major * 10000 + minor * 100 + release | |||
*/ | */ | |||
#define RASQAL_VERSION 920 | #define RASQAL_VERSION 921 | |||
/** | /** | |||
* RASQAL_VERSION_STRING: | * RASQAL_VERSION_STRING: | |||
* | * | |||
* Rasqal library version string | * Rasqal library version string | |||
*/ | */ | |||
#define RASQAL_VERSION_STRING "0.9.20" | #define RASQAL_VERSION_STRING "0.9.21" | |||
/** | /** | |||
* RASQAL_VERSION_MAJOR: | * RASQAL_VERSION_MAJOR: | |||
* | * | |||
* Rasqal library major version | * Rasqal library major version | |||
*/ | */ | |||
#define RASQAL_VERSION_MAJOR 0 | #define RASQAL_VERSION_MAJOR 0 | |||
/** | /** | |||
* RASQAL_VERSION_MINOR: | * RASQAL_VERSION_MINOR: | |||
* | * | |||
* Rasqal library minor version | * Rasqal library minor version | |||
*/ | */ | |||
#define RASQAL_VERSION_MINOR 9 | #define RASQAL_VERSION_MINOR 9 | |||
/** | /** | |||
* RASQAL_VERSION_RELEASE: | * RASQAL_VERSION_RELEASE: | |||
* | * | |||
* Rasqal library release | * Rasqal library release | |||
*/ | */ | |||
#define RASQAL_VERSION_RELEASE 20 | #define RASQAL_VERSION_RELEASE 21 | |||
/** | /** | |||
* RASQAL_API: | * RASQAL_API: | |||
* | * | |||
* Macro for wrapping API function call declarations. | * Macro for wrapping API function call declarations. | |||
* | * | |||
*/ | */ | |||
#ifndef RASQAL_API | #ifndef RASQAL_API | |||
# ifdef WIN32 | # ifdef WIN32 | |||
# ifdef __GNUC__ | # ifdef __GNUC__ | |||
skipping to change at line 98 | skipping to change at line 98 | |||
# endif | # endif | |||
# else | # else | |||
# define RASQAL_API | # define RASQAL_API | |||
# endif | # endif | |||
#endif | #endif | |||
/* Use gcc 3.1+ feature to allow marking of deprecated API calls. | /* Use gcc 3.1+ feature to allow marking of deprecated API calls. | |||
* This gives a warning during compiling. | * This gives a warning during compiling. | |||
*/ | */ | |||
#if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | #if ( __GNUC__ == 3 && __GNUC_MINOR__ > 0 ) || __GNUC__ > 3 | |||
#ifdef __APPLE_CC__ | ||||
/* OSX gcc cpp-precomp is broken */ | ||||
#define RASQAL_DEPRECATED | ||||
#else | ||||
#define RASQAL_DEPRECATED __attribute__((deprecated)) | #define RASQAL_DEPRECATED __attribute__((deprecated)) | |||
#endif | ||||
#else | #else | |||
#define RASQAL_DEPRECATED | #define RASQAL_DEPRECATED | |||
#endif | #endif | |||
#ifndef LIBRDF_OBJC_FRAMEWORK | #ifndef LIBRDF_OBJC_FRAMEWORK | |||
#include <raptor.h> | #include <raptor.h> | |||
#else | #else | |||
#include <Redland/raptor.h> | #include <Redland/raptor.h> | |||
#endif | #endif | |||
skipping to change at line 134 | skipping to change at line 129 | |||
extern const unsigned int rasqal_version_minor; | extern const unsigned int rasqal_version_minor; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_release; | extern const unsigned int rasqal_version_release; | |||
RASQAL_API | RASQAL_API | |||
extern const unsigned int rasqal_version_decimal; | extern const unsigned int rasqal_version_decimal; | |||
RASQAL_API | RASQAL_API | |||
extern const char * const rasqal_license_string; | extern const char * const rasqal_license_string; | |||
RASQAL_API | RASQAL_API | |||
extern const char * const rasqal_home_url_string; | extern const char * const rasqal_home_url_string; | |||
/** | ||||
* RASQAL_RAPTOR_VERSION: | ||||
* | ||||
* Version of Raptor that Rasqal was configured against. | ||||
*/ | ||||
#define RASQAL_RAPTOR_VERSION 10421 | ||||
/* Public structures */ | /* Public structures */ | |||
#ifndef RASQAL_WORLD_DECLARED | #ifndef RASQAL_WORLD_DECLARED | |||
#define RASQAL_WORLD_DECLARED 1 | #define RASQAL_WORLD_DECLARED 1 | |||
/** | /** | |||
* rasqal_world: | * rasqal_world: | |||
* | * | |||
* Rasqal world class. | * Rasqal world class. | |||
*/ | */ | |||
typedef struct rasqal_world_s rasqal_world; | typedef struct rasqal_world_s rasqal_world; | |||
skipping to change at line 250 | skipping to change at line 252 | |||
/** | /** | |||
* rasqal_variable: | * rasqal_variable: | |||
* @vars_table: variables table that owns this variable | * @vars_table: variables table that owns this variable | |||
* @name: Variable name. | * @name: Variable name. | |||
* @value: Variable value or NULL if unbound. | * @value: Variable value or NULL if unbound. | |||
* @offset: Internal. | * @offset: Internal. | |||
* @type: Variable type. | * @type: Variable type. | |||
* @expression: Expression when the variable is a computed SELECT expressio n | * @expression: Expression when the variable is a computed SELECT expressio n | |||
* @user_data: Pointer to user data associated with a variable. This is no t used by rasqal. | * @user_data: Pointer to user data associated with a variable. This is no t used by rasqal. | |||
* @usage: reference count | ||||
* | * | |||
* Binding between a variable name and a value. | * Binding between a variable name and a value. | |||
* | * | |||
* Includes internal field @offset for recording the offset into the | * Includes internal field @offset for recording the offset into the | |||
* (internal) rasqal_query variables array. | * (internal) rasqal_query variables array. | |||
*/ | */ | |||
typedef struct { | typedef struct { | |||
rasqal_variables_table* vars_table; | rasqal_variables_table* vars_table; | |||
const unsigned char *name; | const unsigned char *name; | |||
rasqal_literal* value; | rasqal_literal* value; | |||
int offset; | int offset; | |||
rasqal_variable_type type; | rasqal_variable_type type; | |||
struct rasqal_expression_s* expression; | struct rasqal_expression_s* expression; | |||
void *user_data; | void *user_data; | |||
int usage; | ||||
} rasqal_variable; | } rasqal_variable; | |||
/** | /** | |||
* rasqal_data_graph_flags: | * rasqal_data_graph_flags: | |||
* @RASQAL_DATA_GRAPH_NONE: Internal. | * @RASQAL_DATA_GRAPH_NONE: Internal. | |||
* @RASQAL_DATA_GRAPH_NAMED: Graphs with a source and name. | * @RASQAL_DATA_GRAPH_NAMED: Graphs with a source and name. | |||
* @RASQAL_DATA_GRAPH_BACKGROUND: Graphs with a source only. | * @RASQAL_DATA_GRAPH_BACKGROUND: Graphs with a source only. | |||
* | * | |||
* Flags for the type of #rasqal_data_graph. | * Flags for the type of #rasqal_data_graph. | |||
* | * | |||
* These are used by rasqal_query_add_data_graph(). See #rasqal_data_graph. | * These are used by rasqal_new_data_graph_from_uri() and | |||
* rasqal_new_data_graph_from_iostream(). See #rasqal_data_graph. | ||||
*/ | */ | |||
typedef enum { | typedef enum { | |||
RASQAL_DATA_GRAPH_NONE = 0, | RASQAL_DATA_GRAPH_NONE = 0, | |||
RASQAL_DATA_GRAPH_NAMED = 1, | RASQAL_DATA_GRAPH_NAMED = 1, | |||
RASQAL_DATA_GRAPH_BACKGROUND = 2, | RASQAL_DATA_GRAPH_BACKGROUND = 2, | |||
} rasqal_data_graph_flags; | } rasqal_data_graph_flags; | |||
/** | /** | |||
* rasqal_data_graph: | * rasqal_data_graph: | |||
* @world: rasqal_world object | * @world: rasqal_world object | |||
* @uri: source URI | * @uri: source URI | |||
* @name_uri: name of graph for %RASQAL_DATA_GRAPH_NAMED | * @name_uri: name of graph for %RASQAL_DATA_GRAPH_NAMED | |||
* @flags: %RASQAL_DATA_GRAPH_NAMED or %RASQAL_DATA_GRAPH_BACKGROUND | * @flags: %RASQAL_DATA_GRAPH_NAMED or %RASQAL_DATA_GRAPH_BACKGROUND | |||
* @format_type: MIME Type of data format at @uri (or NULL) | ||||
* @format_name: Raptor parser Name of data format at @uri (or NULL) | ||||
* @format_uri: URI of data format at @uri (or NULL) | ||||
* @iostr: Raptor iostream for content, overriding @uri if present (or NULL | ||||
) | ||||
* @base_uri: base URI for reading from iostream | ||||
* @usage: usage count of this object | ||||
* | * | |||
* A source of RDF data for querying. | * A source of RDF data for querying. | |||
* | * | |||
* The @uri is the original source (base URI) of the content. It may | * If @iostr is present, the graph can be constructed by parsing the | |||
* also have an additional name @name_uri as long as @flags is | * iostream and using @base_uri as a base uri. Otherwise the graph | |||
* %RASQAL_DATA_GRAPH_NAMED | * can be constructed from the graph at URI @uri. | |||
* | ||||
* In either case the @name_uri is the graph name as long as @flags | ||||
* is %RASQAL_DATA_GRAPH_NAMED | ||||
*/ | */ | |||
typedef struct { | typedef struct { | |||
rasqal_world* world; | rasqal_world* world; | |||
raptor_uri* uri; | raptor_uri* uri; | |||
raptor_uri* name_uri; | raptor_uri* name_uri; | |||
int flags; | int flags; | |||
const char* format_type; | ||||
const char* format_name; | ||||
raptor_uri* format_uri; | ||||
raptor_iostream* iostr; | ||||
raptor_uri* base_uri; | ||||
int usage; | ||||
} rasqal_data_graph; | } rasqal_data_graph; | |||
/** | /** | |||
* rasqal_literal_type: | * rasqal_literal_type: | |||
* @RASQAL_LITERAL_BLANK: RDF blank node literal (SPARQL r:bNode) | * @RASQAL_LITERAL_BLANK: RDF blank node literal (SPARQL r:bNode) | |||
* @RASQAL_LITERAL_URI: RDF URI Literal (SPARQL r:URI) | * @RASQAL_LITERAL_URI: RDF URI Literal (SPARQL r:URI) | |||
* @RASQAL_LITERAL_STRING: RDF Plain Literal - no datatype (SPARQL r:Litera l) | * @RASQAL_LITERAL_STRING: RDF Plain Literal - no datatype (SPARQL r:Litera l) | |||
* @RASQAL_LITERAL_XSD_STRING: String xsd:string | * @RASQAL_LITERAL_XSD_STRING: String xsd:string | |||
* @RASQAL_LITERAL_BOOLEAN: Boolean literal xsd:boolean. | * @RASQAL_LITERAL_BOOLEAN: Boolean literal xsd:boolean. | |||
* @RASQAL_LITERAL_INTEGER: Integer literal xsd:integer. | * @RASQAL_LITERAL_INTEGER: Integer literal xsd:integer. | |||
skipping to change at line 500 | skipping to change at line 520 | |||
* @RASQAL_EXPR_IF: Expression for LAQRS IF(expr, expr, expr) | * @RASQAL_EXPR_IF: Expression for LAQRS IF(expr, expr, expr) | |||
* @RASQAL_EXPR_URI: Expression for LAQRS URI(expr) | * @RASQAL_EXPR_URI: Expression for LAQRS URI(expr) | |||
* @RASQAL_EXPR_IRI: Expression for LAQRS IRI(expr) | * @RASQAL_EXPR_IRI: Expression for LAQRS IRI(expr) | |||
* @RASQAL_EXPR_STRLANG: Expression for LAQRS STRLANG(expr, expr) | * @RASQAL_EXPR_STRLANG: Expression for LAQRS STRLANG(expr, expr) | |||
* @RASQAL_EXPR_STRDT: Expression for LAQRS STRDT(expr, expr) | * @RASQAL_EXPR_STRDT: Expression for LAQRS STRDT(expr, expr) | |||
* @RASQAL_EXPR_BNODE: Expression for LAQRS BNODE(expr) | * @RASQAL_EXPR_BNODE: Expression for LAQRS BNODE(expr) | |||
* @RASQAL_EXPR_GROUP_CONCAT: Expression for LAQRS GROUP_CONCAT(arglist) ag gregate function | * @RASQAL_EXPR_GROUP_CONCAT: Expression for LAQRS GROUP_CONCAT(arglist) ag gregate function | |||
* @RASQAL_EXPR_SAMPLE: Expression for LAQRS SAMPLE(expr) aggregate functio n | * @RASQAL_EXPR_SAMPLE: Expression for LAQRS SAMPLE(expr) aggregate functio n | |||
* @RASQAL_EXPR_IN: Expression for LAQRS expr IN ( list of expr ) | * @RASQAL_EXPR_IN: Expression for LAQRS expr IN ( list of expr ) | |||
* @RASQAL_EXPR_NOT_IN: Expression for LAQRS expr NOT IN ( list of expr ) | * @RASQAL_EXPR_NOT_IN: Expression for LAQRS expr NOT IN ( list of expr ) | |||
* @RASQAL_EXPR_ISNUMERIC: Expression for SPARQL 1.1 isNUMERIC(expr) | ||||
* @RASQAL_EXPR_UNKNOWN: Internal | * @RASQAL_EXPR_UNKNOWN: Internal | |||
* @RASQAL_EXPR_LAST: Internal | * @RASQAL_EXPR_LAST: Internal | |||
* | * | |||
* Rasqal expression operators. A mixture of unary, binary and | * Rasqal expression operators. A mixture of unary, binary and | |||
* tertiary operators (string matches). Also includes casting and | * tertiary operators (string matches). Also includes casting and | |||
* two ordering operators from ORDER BY in SPARQL. | * two ordering operators from ORDER BY in SPARQL. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
/* internal */ | /* internal */ | |||
RASQAL_EXPR_UNKNOWN, | RASQAL_EXPR_UNKNOWN, | |||
skipping to change at line 564 | skipping to change at line 585 | |||
RASQAL_EXPR_IF, | RASQAL_EXPR_IF, | |||
RASQAL_EXPR_URI, | RASQAL_EXPR_URI, | |||
RASQAL_EXPR_IRI, | RASQAL_EXPR_IRI, | |||
RASQAL_EXPR_STRLANG, | RASQAL_EXPR_STRLANG, | |||
RASQAL_EXPR_STRDT, | RASQAL_EXPR_STRDT, | |||
RASQAL_EXPR_BNODE, | RASQAL_EXPR_BNODE, | |||
RASQAL_EXPR_GROUP_CONCAT, | RASQAL_EXPR_GROUP_CONCAT, | |||
RASQAL_EXPR_SAMPLE, | RASQAL_EXPR_SAMPLE, | |||
RASQAL_EXPR_IN, | RASQAL_EXPR_IN, | |||
RASQAL_EXPR_NOT_IN, | RASQAL_EXPR_NOT_IN, | |||
RASQAL_EXPR_ISNUMERIC, | ||||
/* internal */ | /* internal */ | |||
RASQAL_EXPR_LAST= RASQAL_EXPR_NOT_IN | RASQAL_EXPR_LAST = RASQAL_EXPR_ISNUMERIC | |||
} rasqal_op; | } rasqal_op; | |||
/** | /** | |||
* rasqal_expression_flags: | * rasqal_expression_flags: | |||
* @RASQAL_EXPR_FLAG_DISTINCT: Distinct | * @RASQAL_EXPR_FLAG_DISTINCT: Distinct | |||
* @RASQAL_EXPR_FLAG_AGGREGATE: Aggregate function expression | * @RASQAL_EXPR_FLAG_AGGREGATE: Aggregate function expression | |||
* | * | |||
* Flags for expressions. | * Flags for expressions. | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
skipping to change at line 782 | skipping to change at line 804 | |||
/** | /** | |||
* rasqal_graph_pattern_operator: | * rasqal_graph_pattern_operator: | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_BASIC: Just triple patterns and constrain ts. | * @RASQAL_GRAPH_PATTERN_OPERATOR_BASIC: Just triple patterns and constrain ts. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL: Set of graph patterns (ANDed) a nd constraints. | * @RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL: Set of graph patterns (ANDed) a nd constraints. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_UNION: Set of graph patterns (UNIONed) an d constraints. | * @RASQAL_GRAPH_PATTERN_OPERATOR_UNION: Set of graph patterns (UNIONed) an d constraints. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_GROUP: Set of graph patterns (ANDed) and constraints. | * @RASQAL_GRAPH_PATTERN_OPERATOR_GROUP: Set of graph patterns (ANDed) and constraints. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH: A graph term + a graph pattern and constraints. | * @RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH: A graph term + a graph pattern and constraints. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_FILTER: A filter graph pattern with an ex pression | * @RASQAL_GRAPH_PATTERN_OPERATOR_FILTER: A filter graph pattern with an ex pression | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_LET: LET ?var := Expression (LAQRS) | * @RASQAL_GRAPH_PATTERN_OPERATOR_LET: LET ?var := Expression (LAQRS) | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_SELECT: SELECT graph pattern | ||||
* @RASQAL_GRAPH_PATTERN_OPERATOR_SERVICE: SERVICE graph pattern | ||||
* @RASQAL_GRAPH_PATTERN_OPERATOR_MINUS: MINUS graph pattern | ||||
* @RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN: Internal. | * @RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN: Internal. | |||
* @RASQAL_GRAPH_PATTERN_OPERATOR_LAST: Internal. | * @RASQAL_GRAPH_PATTERN_OPERATOR_LAST: Internal. | |||
* | * | |||
* Graph pattern operators | * Graph pattern operators | |||
*/ | */ | |||
typedef enum { | typedef enum { | |||
RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN = 0, | RASQAL_GRAPH_PATTERN_OPERATOR_UNKNOWN = 0, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_BASIC = 1, | RASQAL_GRAPH_PATTERN_OPERATOR_BASIC = 1, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL = 2, | RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL = 2, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_UNION = 3, | RASQAL_GRAPH_PATTERN_OPERATOR_UNION = 3, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_GROUP = 4, | RASQAL_GRAPH_PATTERN_OPERATOR_GROUP = 4, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH = 5, | RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH = 5, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_FILTER = 6, | RASQAL_GRAPH_PATTERN_OPERATOR_FILTER = 6, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_LET = 7, | RASQAL_GRAPH_PATTERN_OPERATOR_LET = 7, | |||
RASQAL_GRAPH_PATTERN_OPERATOR_SELECT = 8, | ||||
RASQAL_GRAPH_PATTERN_OPERATOR_SERVICE = 9, | ||||
RASQAL_GRAPH_PATTERN_OPERATOR_MINUS = 10, | ||||
RASQAL_GRAPH_PATTERN_OPERATOR_LAST = RASQAL_GRAPH_PATTERN_OPERATOR_LET | RASQAL_GRAPH_PATTERN_OPERATOR_LAST = RASQAL_GRAPH_PATTERN_OPERATOR_MINUS | |||
} rasqal_graph_pattern_operator; | } rasqal_graph_pattern_operator; | |||
/** | /** | |||
* rasqal_graph_pattern_visit_fn: | * rasqal_graph_pattern_visit_fn: | |||
* @query: #rasqal_query containing the graph pattern | * @query: #rasqal_query containing the graph pattern | |||
* @gp: current graph_pattern | * @gp: current graph_pattern | |||
* @user_data: user data passed in | * @user_data: user data passed in | |||
* | * | |||
* User function to visit an graph_pattern and operate on it with | * User function to visit an graph_pattern and operate on it with | |||
* rasqal_graph_pattern_visit() or rasqal_query_graph_pattern_visit() | * rasqal_graph_pattern_visit() or rasqal_query_graph_pattern_visit() | |||
skipping to change at line 918 | skipping to change at line 946 | |||
void rasqal_query_set_explain(rasqal_query* query, int is_explain); | void rasqal_query_set_explain(rasqal_query* query, int is_explain); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_get_limit(rasqal_query* query); | int rasqal_query_get_limit(rasqal_query* query); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_query_set_limit(rasqal_query* query, int limit); | void rasqal_query_set_limit(rasqal_query* query, int limit); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_get_offset(rasqal_query* query); | int rasqal_query_get_offset(rasqal_query* query); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_query_set_offset(rasqal_query* query, int offset); | void rasqal_query_set_offset(rasqal_query* query, int offset); | |||
RASQAL_API | RASQAL_API RASQAL_DEPRECATED | |||
int rasqal_query_add_data_graph(rasqal_query* query, raptor_uri* uri, rapto r_uri* name_uri, int flags); | int rasqal_query_add_data_graph(rasqal_query* query, raptor_uri* uri, rapto r_uri* name_uri, int flags); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_add_data_graph2(rasqal_query* query, rasqal_data_graph* da | ||||
ta_graph); | ||||
RASQAL_API | ||||
int rasqal_query_add_data_graphs(rasqal_query* query, raptor_sequence* data | ||||
_graphs); | ||||
RASQAL_API | ||||
raptor_sequence* rasqal_query_get_data_graph_sequence(rasqal_query* query); | raptor_sequence* rasqal_query_get_data_graph_sequence(rasqal_query* query); | |||
RASQAL_API | RASQAL_API | |||
rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* query, int idx ); | rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* query, int idx ); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_dataset_contains_named_graph(rasqal_query* query, raptor_u ri *graph_uri); | int rasqal_query_dataset_contains_named_graph(rasqal_query* query, raptor_u ri *graph_uri); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_add_variable(rasqal_query* query, rasqal_variable* var); | int rasqal_query_add_variable(rasqal_query* query, rasqal_variable* var); | |||
RASQAL_API | RASQAL_API | |||
raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal_query* que ry); | raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal_query* que ry); | |||
skipping to change at line 1013 | skipping to change at line 1046 | |||
RASQAL_API | RASQAL_API | |||
rasqal_expression* rasqal_graph_pattern_get_filter_expression(rasqal_graph_ pattern* gp); | rasqal_expression* rasqal_graph_pattern_get_filter_expression(rasqal_graph_ pattern* gp); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_graph_pattern_visit(rasqal_query* query, rasqal_graph_pattern *g p, rasqal_graph_pattern_visit_fn fn, void* user_data); | int rasqal_graph_pattern_visit(rasqal_query* query, rasqal_graph_pattern *g p, rasqal_graph_pattern_visit_fn fn, void* user_data); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_graph_pattern_get_index(rasqal_graph_pattern* gp); | int rasqal_graph_pattern_get_index(rasqal_graph_pattern* gp); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_graph_pattern_variable_bound_in(rasqal_graph_pattern *gp, rasqal _variable *v); | int rasqal_graph_pattern_variable_bound_in(rasqal_graph_pattern *gp, rasqal _variable *v); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_graph_pattern_get_origin(rasqal_graph_pattern* graph _pattern); | rasqal_literal* rasqal_graph_pattern_get_origin(rasqal_graph_pattern* graph _pattern); | |||
RASQAL_API | ||||
rasqal_variable* rasqal_graph_pattern_get_variable(rasqal_graph_pattern* gr | ||||
aph_pattern); | ||||
RASQAL_API | ||||
rasqal_literal* rasqal_graph_pattern_get_service(rasqal_graph_pattern* grap | ||||
h_pattern); | ||||
/* Utility methods */ | /* Utility methods */ | |||
RASQAL_API | RASQAL_API | |||
const char* rasqal_query_verb_as_string(rasqal_query_verb verb); | const char* rasqal_query_verb_as_string(rasqal_query_verb verb); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_print(rasqal_query* query, FILE* fh); | int rasqal_query_print(rasqal_query* query, FILE* fh); | |||
/* Query */ | /* Query */ | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_prepare(rasqal_query* query, const unsigned char *query_st ring, raptor_uri *base_uri); | int rasqal_query_prepare(rasqal_query* query, const unsigned char *query_st ring, raptor_uri *base_uri); | |||
RASQAL_API | RASQAL_API | |||
rasqal_query_results* rasqal_query_execute(rasqal_query* query); | rasqal_query_results* rasqal_query_execute(rasqal_query* query); | |||
RASQAL_API | RASQAL_API | |||
void* rasqal_query_get_user_data(rasqal_query* query); | void* rasqal_query_get_user_data(rasqal_query* query); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_query_set_user_data(rasqal_query* query, void *user_data); | void rasqal_query_set_user_data(rasqal_query* query, void *user_data); | |||
RASQAL_API | ||||
raptor_sequence* rasqal_query_get_bindings_variables_sequence(rasqal_query* | ||||
query); | ||||
RASQAL_API | ||||
rasqal_variable* rasqal_query_get_bindings_variable(rasqal_query* query, in | ||||
t idx); | ||||
RASQAL_API | ||||
raptor_sequence* rasqal_query_get_bindings_rows_sequence(rasqal_query* quer | ||||
y); | ||||
RASQAL_API | ||||
rasqal_row* rasqal_query_get_bindings_row(rasqal_query* query, int idx); | ||||
/* query results */ | /* query results */ | |||
RASQAL_API | RASQAL_API | |||
rasqal_query_results* rasqal_new_query_results(rasqal_world* world, rasqal_ query* query, rasqal_query_results_type type, rasqal_variables_table* vars_ table); | rasqal_query_results* rasqal_new_query_results(rasqal_world* world, rasqal_ query* query, rasqal_query_results_type type, rasqal_variables_table* vars_ table); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_query_results(rasqal_query_results *query_results); | void rasqal_free_query_results(rasqal_query_results *query_results); | |||
RASQAL_API | RASQAL_API | |||
rasqal_query* rasqal_query_results_get_query(rasqal_query_results* query_re sults); | rasqal_query* rasqal_query_results_get_query(rasqal_query_results* query_re sults); | |||
/* Bindings result format */ | /* Bindings result format */ | |||
skipping to change at line 1110 | skipping to change at line 1156 | |||
/** | /** | |||
* RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER: | * RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER: | |||
* | * | |||
* Flag for rasqal_query_results_formats_enumerate() to get query results f ormats that can be written. | * Flag for rasqal_query_results_formats_enumerate() to get query results f ormats that can be written. | |||
*/ | */ | |||
#define RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER 2 | #define RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER 2 | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_results_formats_enumerate(rasqal_world* world, unsigned in t counter, const char **name, const char **label, const unsigned char **uri _string, const char **mime_type, int* flags); | int rasqal_query_results_formats_enumerate(rasqal_world* world, unsigned in t counter, const char **name, const char **label, const unsigned char **uri _string, const char **mime_type, int* flags); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_results_formats_check2(rasqal_world* world, const char *na | ||||
me, raptor_uri* uri, const char *mime_type, int flags); | ||||
RASQAL_API RASQAL_DEPRECATED | ||||
int rasqal_query_results_formats_check(rasqal_world* world, const char *nam e, raptor_uri* uri, const char *mime_type); | int rasqal_query_results_formats_check(rasqal_world* world, const char *nam e, raptor_uri* uri, const char *mime_type); | |||
RASQAL_API | RASQAL_API | |||
rasqal_query_results_formatter* rasqal_new_query_results_formatter2(rasqal_ world* world, const char *name, const char *mime_type, raptor_uri* format_u ri); | rasqal_query_results_formatter* rasqal_new_query_results_formatter2(rasqal_ world* world, const char *name, const char *mime_type, raptor_uri* format_u ri); | |||
#if !defined(RASQAL_DISABLE_DEPRECATED) | #if !defined(RASQAL_DISABLE_DEPRECATED) | |||
RASQAL_API RASQAL_DEPRECATED | RASQAL_API RASQAL_DEPRECATED | |||
rasqal_query_results_formatter* rasqal_new_query_results_formatter(rasqal_w orld* world, const char *name, raptor_uri* format_uri); | rasqal_query_results_formatter* rasqal_new_query_results_formatter(rasqal_w orld* world, const char *name, raptor_uri* format_uri); | |||
RASQAL_API RASQAL_DEPRECATED | RASQAL_API RASQAL_DEPRECATED | |||
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_by_mime_ type(rasqal_world* world, const char *mime_type); | |||
#endif | #endif | |||
RASQAL_API | RASQAL_API | |||
skipping to change at line 1135 | skipping to change at line 1183 | |||
RASQAL_API | RASQAL_API | |||
const char* rasqal_query_results_formatter_get_mime_type(rasqal_query_resul ts_formatter *formatter); | const char* rasqal_query_results_formatter_get_mime_type(rasqal_query_resul ts_formatter *formatter); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_query_iostream_write_escaped_counted_string(rasqal_query* query, raptor_iostream* iostr, const unsigned char* string, size_t len); | int rasqal_query_iostream_write_escaped_counted_string(rasqal_query* query, raptor_iostream* iostr, const unsigned char* string, size_t len); | |||
RASQAL_API | RASQAL_API | |||
unsigned char* rasqal_query_escape_counted_string(rasqal_query* query, cons t unsigned char *string, size_t len, size_t* output_len_p); | unsigned char* rasqal_query_escape_counted_string(rasqal_query* query, cons t unsigned char *string, size_t len, size_t* output_len_p); | |||
/* Data graph class */ | /* Data graph class */ | |||
RASQAL_API | RASQAL_API | |||
rasqal_data_graph* rasqal_new_data_graph_from_uri(rasqal_world* world, rapt | ||||
or_uri* uri, raptor_uri* name_uri, int flags, const char* format_type, cons | ||||
t char* format_name, raptor_uri* format_uri); | ||||
RASQAL_API | ||||
rasqal_data_graph* rasqal_new_data_graph_from_iostream(rasqal_world* world, | ||||
raptor_iostream* iostr, raptor_uri* base_uri, raptor_uri* name_uri, int fl | ||||
ags, const char* format_type, const char* format_name, raptor_uri* format_u | ||||
ri); | ||||
RASQAL_API RASQAL_DEPRECATED | ||||
rasqal_data_graph* rasqal_new_data_graph(rasqal_world* world, raptor_uri* u ri, raptor_uri* name_uri, int flags); | rasqal_data_graph* rasqal_new_data_graph(rasqal_world* world, raptor_uri* u ri, raptor_uri* name_uri, int flags); | |||
RASQAL_API | RASQAL_API | |||
rasqal_data_graph* rasqal_new_data_graph_from_data_graph(rasqal_data_graph* | ||||
dg); | ||||
RASQAL_API | ||||
void rasqal_free_data_graph(rasqal_data_graph* dg); | void rasqal_free_data_graph(rasqal_data_graph* dg); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh); | int rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh); | |||
/** | /** | |||
* rasqal_compare_flags: | * rasqal_compare_flags: | |||
* @RASQAL_COMPARE_NOCASE: String comparisons are case independent. | * @RASQAL_COMPARE_NOCASE: String comparisons are case independent. | |||
* @RASQAL_COMPARE_XQUERY: XQuery comparsion rules apply. | * @RASQAL_COMPARE_XQUERY: XQuery comparsion rules apply. | |||
* @RASQAL_COMPARE_RDF: RDF Term comparsion rules apply. | * @RASQAL_COMPARE_RDF: RDF Term comparsion rules apply. | |||
* @RASQAL_COMPARE_URI: Allow comparison of URIs and allow strings to ha ve a boolean value (for RDQL) | * @RASQAL_COMPARE_URI: Allow comparison of URIs and allow strings to ha ve a boolean value (for RDQL) | |||
skipping to change at line 1200 | skipping to change at line 1254 | |||
rasqal_expression* rasqal_new_expression_from_expression(rasqal_expression* e); | rasqal_expression* rasqal_new_expression_from_expression(rasqal_expression* e); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_expression(rasqal_expression* e); | void rasqal_free_expression(rasqal_expression* e); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_expression_print_op(rasqal_expression* e, FILE* fh); | void rasqal_expression_print_op(rasqal_expression* e, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_expression_print(rasqal_expression* e, FILE* fh); | int rasqal_expression_print(rasqal_expression* e, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_expression_evaluate(rasqal_world *world, raptor_loca tor *locator, rasqal_expression* e, int flags); | rasqal_literal* rasqal_expression_evaluate(rasqal_world *world, raptor_loca tor *locator, rasqal_expression* e, int flags); | |||
RASQAL_API | ||||
const char* rasqal_expression_op_label(rasqal_op op); | ||||
RASQAL_API | ||||
int rasqal_expression_compare(rasqal_expression* e1, rasqal_expression* e2, | ||||
int flags, int* error_p); | ||||
/** | /** | |||
* rasqal_expression_visit_fn: | * rasqal_expression_visit_fn: | |||
* @user_data: user data passed in with rasqal_expression_visit() | * @user_data: user data passed in with rasqal_expression_visit() | |||
* @e: current expression | * @e: current expression | |||
* | * | |||
* User function to visit an expression and operate on it with | * User function to visit an expression and operate on it with | |||
* rasqal_expression_visit() | * rasqal_expression_visit() | |||
* | * | |||
* Return value: non-0 to truncate the visit | * Return value: non-0 to truncate the visit | |||
skipping to change at line 1248 | skipping to change at line 1306 | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_decimal_literal_from_decimal(rasqal_world* world , const unsigned char *string, rasqal_xsd_decimal* decimal); | rasqal_literal* rasqal_new_decimal_literal_from_decimal(rasqal_world* world , const unsigned char *string, rasqal_xsd_decimal* decimal); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_new_literal_from_literal(rasqal_literal* l); | rasqal_literal* rasqal_new_literal_from_literal(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_literal(rasqal_literal* l); | void rasqal_free_literal(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_literal_print(rasqal_literal* l, FILE* fh); | int rasqal_literal_print(rasqal_literal* l, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
const char* rasqal_literal_type_label(rasqal_literal_type type); | ||||
RASQAL_API | ||||
void rasqal_literal_print_type(rasqal_literal* l, FILE* fh); | void rasqal_literal_print_type(rasqal_literal* l, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
rasqal_variable* rasqal_literal_as_variable(rasqal_literal* l); | rasqal_variable* rasqal_literal_as_variable(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
const unsigned char* rasqal_literal_as_string(rasqal_literal* l); | const unsigned char* rasqal_literal_as_string(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
const unsigned char* rasqal_literal_as_string_flags(rasqal_literal* l, int flags, int *error); | const unsigned char* rasqal_literal_as_string_flags(rasqal_literal* l, int flags, int *error); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_literal_as_node(rasqal_literal* l); | rasqal_literal* rasqal_literal_as_node(rasqal_literal* l); | |||
RASQAL_API | RASQAL_API | |||
skipping to change at line 1300 | skipping to change at line 1360 | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_triple(rasqal_triple* t); | void rasqal_free_triple(rasqal_triple* t); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_triple_print(rasqal_triple* t, FILE* fh); | int rasqal_triple_print(rasqal_triple* t, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal *l); | void rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal *l); | |||
RASQAL_API | RASQAL_API | |||
rasqal_literal* rasqal_triple_get_origin(rasqal_triple* t); | rasqal_literal* rasqal_triple_get_origin(rasqal_triple* t); | |||
/* Variable class */ | /* Variable class */ | |||
RASQAL_API | RASQAL_API RASQAL_DEPRECATED | |||
rasqal_variable* rasqal_new_variable_typed(rasqal_query* rq, rasqal_variabl e_type type, unsigned char *name, rasqal_literal *value); | rasqal_variable* rasqal_new_variable_typed(rasqal_query* rq, rasqal_variabl e_type type, unsigned char *name, rasqal_literal *value); | |||
RASQAL_API | RASQAL_API RASQAL_DEPRECATED | |||
rasqal_variable* rasqal_new_variable(rasqal_query* rq, unsigned char *name, rasqal_literal *value); | rasqal_variable* rasqal_new_variable(rasqal_query* rq, unsigned char *name, rasqal_literal *value); | |||
RASQAL_API | RASQAL_API | |||
rasqal_variable* rasqal_new_variable_from_variable(rasqal_variable* v); | rasqal_variable* rasqal_new_variable_from_variable(rasqal_variable* v); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_free_variable(rasqal_variable* v); | void rasqal_free_variable(rasqal_variable* v); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_variable_print(rasqal_variable* v, FILE* fh); | int rasqal_variable_print(rasqal_variable* v, FILE* fh); | |||
RASQAL_API | RASQAL_API | |||
void rasqal_variable_set_value(rasqal_variable* v, rasqal_literal* l); | void rasqal_variable_set_value(rasqal_variable* v, rasqal_literal* l); | |||
skipping to change at line 1365 | skipping to change at line 1425 | |||
int rasqal_xsd_decimal_divide(rasqal_xsd_decimal* result, rasqal_xsd_decima l* a, rasqal_xsd_decimal* b); | int rasqal_xsd_decimal_divide(rasqal_xsd_decimal* result, rasqal_xsd_decima l* a, rasqal_xsd_decimal* b); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_xsd_decimal_negate(rasqal_xsd_decimal* result, rasqal_xsd_decima l* a); | int rasqal_xsd_decimal_negate(rasqal_xsd_decimal* result, rasqal_xsd_decima l* a); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_xsd_decimal_compare(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b ); | int rasqal_xsd_decimal_compare(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b ); | |||
RASQAL_API | RASQAL_API | |||
int rasqal_xsd_decimal_equals(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b) ; | int rasqal_xsd_decimal_equals(rasqal_xsd_decimal* a, rasqal_xsd_decimal* b) ; | |||
RASQAL_API | RASQAL_API | |||
int rasqal_xsd_decimal_is_zero(rasqal_xsd_decimal* d); | int rasqal_xsd_decimal_is_zero(rasqal_xsd_decimal* d); | |||
/* rasqal_engine.c */ | /** | |||
* rasqal_service: | ||||
* | ||||
* Rasqal SPARQL Protocol Service | ||||
*/ | ||||
typedef struct rasqal_service_s rasqal_service; | ||||
RASQAL_API | ||||
rasqal_service* rasqal_new_service(rasqal_world* world, raptor_uri* service | ||||
_uri, const char* query_string, raptor_sequence* data_graphs); | ||||
RASQAL_API | ||||
void rasqal_free_service(rasqal_service* svc); | ||||
RASQAL_API | ||||
rasqal_query_results* rasqal_service_execute(rasqal_service* svc); | ||||
RASQAL_API | ||||
int rasqal_service_set_www(rasqal_service* svc, raptor_www* www); | ||||
RASQAL_API | ||||
int rasqal_service_set_format(rasqal_service* svc, const char *format); | ||||
/** | /** | |||
* rasqal_triple_parts: | * rasqal_triple_parts: | |||
* @RASQAL_TRIPLE_NONE: no parts | * @RASQAL_TRIPLE_NONE: no parts | |||
* @RASQAL_TRIPLE_SUBJECT: Subject present in a triple. | * @RASQAL_TRIPLE_SUBJECT: Subject present in a triple. | |||
* @RASQAL_TRIPLE_PREDICATE: Predicate present in a triple. | * @RASQAL_TRIPLE_PREDICATE: Predicate present in a triple. | |||
* @RASQAL_TRIPLE_OBJECT: Object present in a triple. | * @RASQAL_TRIPLE_OBJECT: Object present in a triple. | |||
* @RASQAL_TRIPLE_ORIGIN: Origin/graph present in a triple. | * @RASQAL_TRIPLE_ORIGIN: Origin/graph present in a triple. | |||
* @RASQAL_TRIPLE_GRAPH: Alias for RASQAL_TRIPLE_ORIGIN | * @RASQAL_TRIPLE_GRAPH: Alias for RASQAL_TRIPLE_ORIGIN | |||
* @RASQAL_TRIPLE_SPO: Subject, Predicate and Object present in a triple. | * @RASQAL_TRIPLE_SPO: Subject, Predicate and Object present in a triple. | |||
skipping to change at line 1462 | skipping to change at line 1538 | |||
* | * | |||
* Lowest accepted @rasqal_triples_source API version | * Lowest accepted @rasqal_triples_source API version | |||
*/ | */ | |||
#define RASQAL_TRIPLES_SOURCE_MIN_VERSION 1 | #define RASQAL_TRIPLES_SOURCE_MIN_VERSION 1 | |||
/** | /** | |||
* RASQAL_TRIPLES_SOURCE_MAX_VERSION: | * RASQAL_TRIPLES_SOURCE_MAX_VERSION: | |||
* | * | |||
* Highest accepted @rasqal_triples_source API version | * Highest accepted @rasqal_triples_source API version | |||
*/ | */ | |||
#define RASQAL_TRIPLES_SOURCE_MAX_VERSION 1 | #define RASQAL_TRIPLES_SOURCE_MAX_VERSION 2 | |||
/** | ||||
* rasqal_triples_source_feature: | ||||
* @RASQAL_TRIPLES_SOURCE_FEATURE_NONE: No feature | ||||
* @RASQAL_TRIPLES_SOURCE_FEATURE_IOSTREAM_DATA_GRAPH: Support raptor_iostr | ||||
eam data graphs | ||||
* | ||||
* Optional features that may be supported by a triple source factory | ||||
*/ | ||||
typedef enum { | ||||
RASQAL_TRIPLES_SOURCE_FEATURE_NONE, | ||||
RASQAL_TRIPLES_SOURCE_FEATURE_IOSTREAM_DATA_GRAPH | ||||
} rasqal_triples_source_feature; | ||||
/** | /** | |||
* rasqal_triples_source: | * rasqal_triples_source: | |||
* @version: API version - only V1 is defined for now | * @version: API version - only V1 is defined for now | |||
* @query: Source for this query. | * @query: Source for this query. | |||
* @user_data: Context user data passed into the factory methods. | * @user_data: Context user data passed into the factory methods. | |||
* @init_triples_match: Factory method to initalise a new #rasqal_triples_m atch. | * @init_triples_match: Factory method to initalise a new #rasqal_triples_m atch. | |||
* @triple_present: Factory method to return presence or absence of a compl ete triple. | * @triple_present: Factory method to return presence or absence of a compl ete triple. | |||
* @free_triples_source: Factory method to deallocate resources. | * @free_triples_source: Factory method to deallocate resources. | |||
* @support_feature: Factory method to test support for a feature, returnin g non-0 if supported | ||||
* | * | |||
* Triples source as initialised by a #rasqal_triples_source_factory. | * Triples source as initialised by a #rasqal_triples_source_factory. | |||
*/ | */ | |||
struct rasqal_triples_source_s { | struct rasqal_triples_source_s { | |||
int version; | int version; | |||
rasqal_query* query; | rasqal_query* query; | |||
void *user_data; | void *user_data; | |||
skipping to change at line 1488 | skipping to change at line 1577 | |||
rasqal_query* query; | rasqal_query* query; | |||
void *user_data; | void *user_data; | |||
/* API v1 */ | /* API v1 */ | |||
int (*init_triples_match)(rasqal_triples_match* rtm, struct rasqal_triple s_source_s* rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t); | int (*init_triples_match)(rasqal_triples_match* rtm, struct rasqal_triple s_source_s* rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t); | |||
int (*triple_present)(struct rasqal_triples_source_s* rts, void *user_dat a, rasqal_triple *t); | int (*triple_present)(struct rasqal_triples_source_s* rts, void *user_dat a, rasqal_triple *t); | |||
void (*free_triples_source)(void *user_data); | void (*free_triples_source)(void *user_data); | |||
/* API v2 onwards */ | /* API v2 onwards */ | |||
int (*support_feature)(void *user_data, rasqal_triples_source_feature fea ture); | ||||
}; | }; | |||
typedef struct rasqal_triples_source_s rasqal_triples_source; | typedef struct rasqal_triples_source_s rasqal_triples_source; | |||
/** | /** | |||
* RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION: | * RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION: | |||
* | * | |||
* Lowest accepted @rasqal_triples_source_factory API version | * Lowest accepted @rasqal_triples_source_factory API version | |||
*/ | */ | |||
#define RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION 1 | #define RASQAL_TRIPLES_SOURCE_FACTORY_MIN_VERSION 1 | |||
/** | /** | |||
* RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION: | * RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION: | |||
* | * | |||
* Highest accepted @rasqal_triples_source_factory API version | * Highest accepted @rasqal_triples_source_factory API version | |||
*/ | */ | |||
#define RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION 1 | #define RASQAL_TRIPLES_SOURCE_FACTORY_MAX_VERSION 2 | |||
/** | ||||
* rasqal_triples_error_handler: | ||||
* @query: query object | ||||
* @locator: error locator (or NULL) | ||||
* @message: error message | ||||
* | ||||
* Triples source factory error handler callback. | ||||
*/ | ||||
typedef void (*rasqal_triples_error_handler)(rasqal_query* query, raptor_lo | ||||
cator* locator, const char* message); | ||||
/** | /** | |||
* rasqal_triples_source_factory: | * rasqal_triples_source_factory: | |||
* @version: API factory version - only V1 is defined for now | * @version: API factory version from 1 to 2 | |||
* @user_data: User data for triples_source_factory. | * @user_data: User data for triples_source_factory. | |||
* @user_data_size: Size Of @user_data for new_triples_source. | * @user_data_size: Size of @user_data for new_triples_source. | |||
* @new_triples_source: Create a new triples source - returns non-zero on f | * @new_triples_source: Create a new triples source - returns non-zero on f | |||
ailure < 0 is a 'no rdf data error', > 0 is an unspecified error.. | ailure < 0 is a 'no rdf data error', > 0 is an unspecified error. Err | |||
or messages are generated by rasqal internally. (V1) | ||||
* @init_triples_source: Initialise a new triples source V2 for a particula | ||||
r source URI/base URI and syntax. Returns non-zero on failure with errors r | ||||
eported via the handler callback by the implementation. (V2) | ||||
* | * | |||
* A factory that initialises #rasqal_triples_source structures | * A factory that initialises #rasqal_triples_source structures to | |||
* to returning matches to a triple pattern. | * returning matches to a triple pattern across the dataset formed | |||
* from the data graphs recorded in the @query object. | ||||
*/ | */ | |||
typedef struct { | typedef struct { | |||
int version; | int version; | |||
void *user_data; | void *user_data; | |||
size_t user_data_size; | size_t user_data_size; | |||
/* API v1 */ | /* API v1 */ | |||
int (*new_triples_source)(rasqal_query* query, void *factory_user_data, v oid *user_data, rasqal_triples_source* rts); | int (*new_triples_source)(rasqal_query* query, void *factory_user_data, v oid *user_data, rasqal_triples_source* rts); | |||
/* API v2 onwards */ | /* API v2 onwards */ | |||
int (*init_triples_source)(rasqal_query* query, void *factory_user_data, void *user_data, rasqal_triples_source* rts, rasqal_triples_error_handler h andler); | ||||
} rasqal_triples_source_factory; | } rasqal_triples_source_factory; | |||
/** | /** | |||
* rasqal_triples_source_factory_register_fn: | * rasqal_triples_source_factory_register_fn: | |||
* @factory: factory to register | * @factory: factory to register | |||
* | * | |||
* Register a factory for generating triples sources #rasqal_triples_source | * Register a factory for generating triples sources #rasqal_triples_source | |||
* | * | |||
* Return value: non-0 on failure | * Return value: non-0 on failure | |||
*/ | */ | |||
End of changes. 39 change blocks. | ||||
26 lines changed or deleted | 152 lines changed or added | |||