rasqal.h | rasqal.h | |||
---|---|---|---|---|
/* -*- Mode: c; c-basic-offset: 2 -*- | /* -*- Mode: c; c-basic-offset: 2 -*- | |||
* | * | |||
* rasqal.h - Rasqal RDF Query library interfaces and definition | * rasqal.h - Rasqal RDF Query library interfaces and definition | |||
* | * | |||
* $Id: rasqal.h,v 1.93 2005/03/20 22:11:21 cmdjb Exp $ | * $Id: rasqal.h,v 1.109 2005/05/19 21:44:59 cmdjb Exp $ | |||
* | * | |||
* Copyright (C) 2003-2005, David Beckett http://purl.org/net/dajobe/ | * Copyright (C) 2003-2005, David Beckett http://purl.org/net/dajobe/ | |||
* Institute for Learning and Research Technology http://www.ilrt.bristol.a c.uk/ | * Institute for Learning and Research Technology http://www.ilrt.bristol.a c.uk/ | |||
* University of Bristol, UK http://www.bristol.ac.uk/ | * University of Bristol, UK http://www.bristol.ac.uk/ | |||
* | * | |||
* This package is Free Software and part of Redland http://librdf.org/ | * This package is Free Software and part of Redland http://librdf.org/ | |||
* | * | |||
* It is licensed under the following three licenses as alternatives: | * It is licensed under the following three licenses as alternatives: | |||
* 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | * 1. GNU Lesser General Public License (LGPL) V2.1 or any newer version | |||
* 2. GNU General Public License (GPL) V2 or any newer version | * 2. GNU General Public License (GPL) V2 or any newer version | |||
skipping to change at line 27 | skipping to change at line 27 | |||
* | * | |||
* You may not use this file except in compliance with at least one of | * You may not use this file except in compliance with at least one of | |||
* the above three licenses. | * the above three licenses. | |||
* | * | |||
* See LICENSE.html or LICENSE.txt at the top of this package for the | * See LICENSE.html or LICENSE.txt at the top of this package for the | |||
* complete terms and further detail along with the license texts for | * complete terms and further detail along with the license texts for | |||
* the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. | * the licenses in COPYING.LIB, COPYING and LICENSE-2.0.txt respectively. | |||
* | * | |||
*/ | */ | |||
#ifndef RDQL_H | #ifndef RASQAL_H | |||
#define RDQL_H | #define RASQAL_H | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#ifdef WIN32 | #ifdef WIN32 | |||
# ifdef RASQAL_INTERNAL | # ifdef RASQAL_INTERNAL | |||
# define RASQAL_API _declspec(dllexport) | # define RASQAL_API _declspec(dllexport) | |||
# else | # else | |||
# define RASQAL_API _declspec(dllimport) | # define RASQAL_API _declspec(dllimport) | |||
skipping to change at line 65 | skipping to change at line 65 | |||
#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 | |||
/* Public statics */ | /* Public statics */ | |||
extern const char * const rasqal_short_copyright_string; | RASQAL_API extern const char * const rasqal_short_copyright_string; | |||
extern const char * const rasqal_copyright_string; | RASQAL_API extern const char * const rasqal_copyright_string; | |||
extern const char * const rasqal_version_string; | RASQAL_API extern const char * const rasqal_version_string; | |||
extern const unsigned int rasqal_version_major; | RASQAL_API extern const unsigned int rasqal_version_major; | |||
extern const unsigned int rasqal_version_minor; | RASQAL_API extern const unsigned int rasqal_version_minor; | |||
extern const unsigned int rasqal_version_release; | RASQAL_API extern const unsigned int rasqal_version_release; | |||
extern const unsigned int rasqal_version_decimal; | RASQAL_API extern const unsigned int rasqal_version_decimal; | |||
/* Public structure */ | /* Public structure */ | |||
typedef struct rasqal_query_s rasqal_query; | typedef struct rasqal_query_s rasqal_query; | |||
typedef struct rasqal_query_results_s rasqal_query_results; | typedef struct rasqal_query_results_s rasqal_query_results; | |||
typedef struct rasqal_literal_s rasqal_literal; | typedef struct rasqal_literal_s rasqal_literal; | |||
typedef struct rasqal_graph_pattern_s rasqal_graph_pattern; | typedef struct rasqal_graph_pattern_s rasqal_graph_pattern; | |||
typedef enum { | typedef enum { | |||
RASQAL_FEATURE_LAST | RASQAL_FEATURE_LAST | |||
} rasqal_feature; | } rasqal_feature; | |||
typedef struct { | typedef struct { | |||
const unsigned char *prefix; | const unsigned char *prefix; | |||
raptor_uri* uri; | raptor_uri* uri; | |||
int declared; | int declared; | |||
int depth; | int depth; | |||
} rasqal_prefix; | } rasqal_prefix; | |||
typedef enum { | ||||
RASQAL_VARIABLE_TYPE_UNKNOWN = 0, | ||||
RASQAL_VARIABLE_TYPE_NORMAL = 1, | ||||
RASQAL_VARIABLE_TYPE_ANONYMOUS = 2 | ||||
} rasqal_variable_type; | ||||
/* variable binding */ | /* variable binding */ | |||
typedef struct { | typedef struct { | |||
const unsigned char *name; | const unsigned char *name; | |||
struct rasqal_literal_s *value; | struct rasqal_literal_s *value; | |||
int offset; /* offset in the rasqal_query variables array */ | int offset; /* offset in the rasqal_query variables array */ | |||
rasqal_variable_type type; /* variable type */ | ||||
} rasqal_variable; | } rasqal_variable; | |||
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; | |||
typedef struct { | typedef struct { | |||
raptor_uri* uri; | raptor_uri* uri; | |||
skipping to change at line 183 | skipping to change at line 190 | |||
RASQAL_EXPR_LITERAL, | RASQAL_EXPR_LITERAL, | |||
RASQAL_EXPR_FUNCTION, | RASQAL_EXPR_FUNCTION, | |||
RASQAL_EXPR_BOUND, | RASQAL_EXPR_BOUND, | |||
RASQAL_EXPR_STR, | RASQAL_EXPR_STR, | |||
RASQAL_EXPR_LANG, | RASQAL_EXPR_LANG, | |||
RASQAL_EXPR_DATATYPE, | RASQAL_EXPR_DATATYPE, | |||
RASQAL_EXPR_ISURI, | RASQAL_EXPR_ISURI, | |||
RASQAL_EXPR_ISBLANK, | RASQAL_EXPR_ISBLANK, | |||
RASQAL_EXPR_ISLITERAL, | RASQAL_EXPR_ISLITERAL, | |||
RASQAL_EXPR_CAST, | RASQAL_EXPR_CAST, | |||
RASQAL_EXPR_LAST= RASQAL_EXPR_CAST | RASQAL_EXPR_ORDER_COND_ASC, | |||
RASQAL_EXPR_ORDER_COND_DESC, | ||||
RASQAL_EXPR_ORDER_COND_NONE, | ||||
RASQAL_EXPR_LAST= RASQAL_EXPR_ORDER_COND_NONE | ||||
} rasqal_op; | } rasqal_op; | |||
struct rasqal_variable_s; | struct rasqal_variable_s; | |||
/* expression (arg1), unary op (arg1), binary op (arg1,arg2), | /* expression (arg1), unary op (arg1), binary op (arg1,arg2), | |||
* literal or variable | * literal or variable | |||
*/ | */ | |||
struct rasqal_expression_s { | struct rasqal_expression_s { | |||
rasqal_op op; | rasqal_op op; | |||
struct rasqal_expression_s* arg1; | struct rasqal_expression_s* arg1; | |||
skipping to change at line 208 | skipping to change at line 218 | |||
/* for extension function qname(args...) and cast-to-uri */ | /* for extension function qname(args...) and cast-to-uri */ | |||
raptor_uri* name; | raptor_uri* name; | |||
raptor_sequence* args; | raptor_sequence* args; | |||
}; | }; | |||
typedef struct rasqal_expression_s rasqal_expression; | typedef struct rasqal_expression_s rasqal_expression; | |||
/* Extra flags for triples */ | /* Extra flags for triples */ | |||
typedef enum { | typedef enum { | |||
/* true when all of subject, predicate, object are given */ | /* Not used - was only used internally in the execution engine */ | |||
RASQAL_TRIPLE_FLAGS_EXACT=1, | RASQAL_TRIPLE_FLAGS_EXACT=1, | |||
/* true when the triple is an optional match */ | /* Not used - this is now a property of a graph pattern */ | |||
RASQAL_TRIPLE_FLAGS_OPTIONAL=2, | RASQAL_TRIPLE_FLAGS_OPTIONAL=2, | |||
RASQAL_TRIPLE_FLAGS_LAST=RASQAL_TRIPLE_FLAGS_OPTIONAL | RASQAL_TRIPLE_FLAGS_LAST=RASQAL_TRIPLE_FLAGS_OPTIONAL | |||
} rasqal_triple_flags; | } rasqal_triple_flags; | |||
/* an RDF triple or a triple pattern */ | /* an RDF triple or a triple pattern */ | |||
typedef struct { | typedef struct { | |||
rasqal_literal* subject; | rasqal_literal* subject; | |||
rasqal_literal* predicate; | rasqal_literal* predicate; | |||
rasqal_literal* object; | rasqal_literal* object; | |||
skipping to change at line 234 | skipping to change at line 244 | |||
} rasqal_triple ; | } rasqal_triple ; | |||
/* Flags for graph patterns */ | /* Flags for graph patterns */ | |||
typedef enum { | typedef enum { | |||
/* true when the graph pattern is an optional match */ | /* true when the graph pattern is an optional match */ | |||
RASQAL_PATTERN_FLAGS_OPTIONAL=1, | RASQAL_PATTERN_FLAGS_OPTIONAL=1, | |||
RASQAL_PATTERN_FLAGS_LAST=RASQAL_PATTERN_FLAGS_OPTIONAL | RASQAL_PATTERN_FLAGS_LAST=RASQAL_PATTERN_FLAGS_OPTIONAL | |||
} rasqal_pattern_flags; | } rasqal_pattern_flags; | |||
typedef unsigned char* (*rasqal_generate_bnodeid_handler)(rasqal_query* que | ||||
ry, void *user_data, unsigned char *user_bnodeid); | ||||
/* Query verbs */ | ||||
typedef enum { | ||||
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, | ||||
RASQAL_QUERY_VERB_LAST=RASQAL_QUERY_VERB_ASK | ||||
} rasqal_query_verb; | ||||
/* RASQAL API */ | /* RASQAL API */ | |||
/* Public functions */ | /* Public functions */ | |||
RASQAL_API void rasqal_init(void); | RASQAL_API void rasqal_init(void); | |||
RASQAL_API void rasqal_finish(void); | RASQAL_API void rasqal_finish(void); | |||
RASQAL_API int rasqal_languages_enumerate(const unsigned int counter, const char **name, const char **label, const unsigned char **uri_string); | RASQAL_API int rasqal_languages_enumerate(const unsigned int counter, const char **name, const char **label, const unsigned char **uri_string); | |||
RASQAL_API int rasqal_language_name_check(const char *name); | RASQAL_API int rasqal_language_name_check(const char *name); | |||
skipping to change at line 258 | skipping to change at line 281 | |||
/* Destroy */ | /* Destroy */ | |||
RASQAL_API void rasqal_free_query(rasqal_query* query); | RASQAL_API void rasqal_free_query(rasqal_query* query); | |||
/* Methods */ | /* Methods */ | |||
RASQAL_API const char* rasqal_query_get_name(rasqal_query* query); | RASQAL_API const char* rasqal_query_get_name(rasqal_query* query); | |||
RASQAL_API const char* rasqal_query_get_label(rasqal_query* query); | RASQAL_API const char* rasqal_query_get_label(rasqal_query* query); | |||
RASQAL_API void rasqal_query_set_fatal_error_handler(rasqal_query* query, v oid *user_data, raptor_message_handler handler); | RASQAL_API void rasqal_query_set_fatal_error_handler(rasqal_query* query, v oid *user_data, raptor_message_handler handler); | |||
RASQAL_API void rasqal_query_set_error_handler(rasqal_query* query, void *u ser_data, raptor_message_handler handler); | RASQAL_API void rasqal_query_set_error_handler(rasqal_query* query, void *u ser_data, raptor_message_handler handler); | |||
RASQAL_API void rasqal_query_set_warning_handler(rasqal_query* query, void *user_data, raptor_message_handler handler); | RASQAL_API void rasqal_query_set_warning_handler(rasqal_query* query, void *user_data, raptor_message_handler handler); | |||
RASQAL_API void rasqal_query_set_feature(rasqal_query *query, rasqal_featur e feature, int value); | RASQAL_API void rasqal_query_set_feature(rasqal_query *query, rasqal_featur e feature, int value); | |||
RASQAL_API void rasqal_query_set_default_generate_bnodeid_parameters(rasqal | ||||
_query* rdf_query, char *prefix, int base); | ||||
RASQAL_API void rasqal_query_set_generate_bnodeid_handler(rasqal_query* que | ||||
ry, void *user_data, rasqal_generate_bnodeid_handler handler); | ||||
RASQAL_API rasqal_query_verb rasqal_query_get_verb(rasqal_query *query); | ||||
RASQAL_API int rasqal_query_get_wildcard(rasqal_query *query); | ||||
RASQAL_API int rasqal_query_get_distinct(rasqal_query *query); | RASQAL_API int rasqal_query_get_distinct(rasqal_query *query); | |||
RASQAL_API void rasqal_query_set_distinct(rasqal_query *query, int is_disti nct); | ||||
RASQAL_API int rasqal_query_get_limit(rasqal_query *query); | RASQAL_API int rasqal_query_get_limit(rasqal_query *query); | |||
RASQAL_API void rasqal_query_set_limit(rasqal_query *query, int limit); | ||||
RASQAL_API int rasqal_query_get_offset(rasqal_query *query); | ||||
RASQAL_API void rasqal_query_set_offset(rasqal_query *query, int limit); | ||||
RASQAL_API RASQAL_DEPRECATED void rasqal_query_add_source(rasqal_query* que ry, raptor_uri* uri); | RASQAL_API RASQAL_DEPRECATED void rasqal_query_add_source(rasqal_query* que ry, raptor_uri* uri); | |||
RASQAL_API RASQAL_DEPRECATED raptor_sequence* rasqal_query_get_source_seque nce(rasqal_query* query); | RASQAL_API RASQAL_DEPRECATED raptor_sequence* rasqal_query_get_source_seque nce(rasqal_query* query); | |||
RASQAL_API RASQAL_DEPRECATED raptor_uri* rasqal_query_get_source(rasqal_que ry* query, int idx); | RASQAL_API RASQAL_DEPRECATED raptor_uri* rasqal_query_get_source(rasqal_que ry* query, int idx); | |||
RASQAL_API int rasqal_query_add_data_graph(rasqal_query* query, raptor_uri* uri, raptor_uri* name_uri, int flags); | RASQAL_API int rasqal_query_add_data_graph(rasqal_query* query, raptor_uri* uri, raptor_uri* name_uri, int flags); | |||
RASQAL_API raptor_sequence* rasqal_query_get_data_graph_sequence(rasqal_que ry* query); | RASQAL_API raptor_sequence* rasqal_query_get_data_graph_sequence(rasqal_que ry* query); | |||
RASQAL_API rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* que ry, int idx); | RASQAL_API rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* que ry, int idx); | |||
RASQAL_API void rasqal_query_add_variable(rasqal_query* query, rasqal_varia ble* var); | RASQAL_API void rasqal_query_add_variable(rasqal_query* query, rasqal_varia ble* var); | |||
RASQAL_API raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal _query* query); | RASQAL_API raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal _query* query); | |||
skipping to change at line 283 | skipping to change at line 314 | |||
RASQAL_API int rasqal_query_has_variable(rasqal_query* query, const unsigne d char *name); | RASQAL_API int rasqal_query_has_variable(rasqal_query* query, const unsigne d char *name); | |||
RASQAL_API int rasqal_query_set_variable(rasqal_query* query, const unsigne d char *name, rasqal_literal* value); | RASQAL_API int rasqal_query_set_variable(rasqal_query* query, const unsigne d char *name, rasqal_literal* value); | |||
RASQAL_API raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query); | RASQAL_API raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query); | |||
RASQAL_API rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx); | RASQAL_API rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx); | |||
RASQAL_API RASQAL_DEPRECATED void rasqal_query_add_constraint(rasqal_query* query, rasqal_expression* expr); | RASQAL_API RASQAL_DEPRECATED void rasqal_query_add_constraint(rasqal_query* query, rasqal_expression* expr); | |||
RASQAL_API RASQAL_DEPRECATED raptor_sequence* rasqal_query_get_constraint_s equence(rasqal_query* query); | RASQAL_API RASQAL_DEPRECATED raptor_sequence* rasqal_query_get_constraint_s equence(rasqal_query* query); | |||
RASQAL_API RASQAL_DEPRECATED rasqal_expression* rasqal_query_get_constraint (rasqal_query* query, int idx); | RASQAL_API RASQAL_DEPRECATED rasqal_expression* rasqal_query_get_constraint (rasqal_query* query, int idx); | |||
RASQAL_API void rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix); | RASQAL_API void rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix); | |||
RASQAL_API raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query); | RASQAL_API raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query); | |||
RASQAL_API rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx); | RASQAL_API rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx); | |||
RASQAL_API raptor_sequence* rasqal_query_get_order_conditions_sequence(rasq | ||||
al_query* query); | ||||
RASQAL_API rasqal_expression* rasqal_query_get_order_condition(rasqal_query | ||||
* query, int idx); | ||||
/* graph patterns */ | /* graph patterns */ | |||
RASQAL_API rasqal_graph_pattern* rasqal_query_get_query_graph_pattern(rasqa l_query* query); | ||||
RASQAL_API raptor_sequence* rasqal_query_get_graph_pattern_sequence(rasqal_ query* query); | RASQAL_API raptor_sequence* rasqal_query_get_graph_pattern_sequence(rasqal_ query* query); | |||
RASQAL_API rasqal_graph_pattern* rasqal_query_get_graph_pattern(rasqal_quer y* query, int idx); | RASQAL_API rasqal_graph_pattern* rasqal_query_get_graph_pattern(rasqal_quer y* query, int idx); | |||
RASQAL_API void rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pat tern* graph_pattern, rasqal_graph_pattern* sub_graph_pattern); | RASQAL_API void rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pat tern* graph_pattern, rasqal_graph_pattern* sub_graph_pattern); | |||
RASQAL_API rasqal_triple* rasqal_graph_pattern_get_triple(rasqal_graph_patt ern* graph_pattern, int idx); | RASQAL_API rasqal_triple* rasqal_graph_pattern_get_triple(rasqal_graph_patt ern* graph_pattern, int idx); | |||
RASQAL_API raptor_sequence* rasqal_graph_pattern_get_sub_graph_pattern_sequ ence(rasqal_graph_pattern* graph_pattern); | RASQAL_API raptor_sequence* rasqal_graph_pattern_get_sub_graph_pattern_sequ ence(rasqal_graph_pattern* graph_pattern); | |||
RASQAL_API rasqal_graph_pattern* rasqal_graph_pattern_get_sub_graph_pattern (rasqal_graph_pattern* graph_pattern, int idx); | RASQAL_API rasqal_graph_pattern* rasqal_graph_pattern_get_sub_graph_pattern (rasqal_graph_pattern* graph_pattern, int idx); | |||
RASQAL_API int rasqal_graph_pattern_get_flags(rasqal_graph_pattern* graph_p attern); | RASQAL_API int rasqal_graph_pattern_get_flags(rasqal_graph_pattern* graph_p attern); | |||
RASQAL_API void rasqal_graph_pattern_print(rasqal_graph_pattern* gp, FILE* fh); | RASQAL_API void rasqal_graph_pattern_print(rasqal_graph_pattern* gp, FILE* fh); | |||
RASQAL_API int rasqal_graph_pattern_add_constraint(rasqal_graph_pattern* gp , rasqal_expression* expr); | RASQAL_API int rasqal_graph_pattern_add_constraint(rasqal_graph_pattern* gp , rasqal_expression* expr); | |||
RASQAL_API raptor_sequence* rasqal_graph_pattern_get_constraint_sequence(ra sqal_graph_pattern* gp); | RASQAL_API raptor_sequence* rasqal_graph_pattern_get_constraint_sequence(ra sqal_graph_pattern* gp); | |||
RASQAL_API rasqal_expression* rasqal_graph_pattern_get_constraint(rasqal_gr aph_pattern* gp, int idx); | RASQAL_API rasqal_expression* rasqal_graph_pattern_get_constraint(rasqal_gr aph_pattern* gp, int idx); | |||
RASQAL_API raptor_sequence* rasqal_query_get_construct_triples_sequence(ras | ||||
qal_query* query); | ||||
RASQAL_API rasqal_triple* rasqal_query_get_construct_triple(rasqal_query* q | ||||
uery, int idx); | ||||
/* Utility methods */ | /* Utility methods */ | |||
RASQAL_API const char* rasqal_query_verb_as_string(rasqal_query_verb verb); | ||||
RASQAL_API void rasqal_query_print(rasqal_query* query, FILE *stream); | RASQAL_API void rasqal_query_print(rasqal_query* query, FILE *stream); | |||
/* Query */ | /* Query */ | |||
RASQAL_API int rasqal_query_prepare(rasqal_query* query, const unsigned cha r *query_string, raptor_uri *base_uri); | RASQAL_API int rasqal_query_prepare(rasqal_query* query, const unsigned cha r *query_string, raptor_uri *base_uri); | |||
RASQAL_API rasqal_query_results* rasqal_query_execute(rasqal_query* query); | RASQAL_API rasqal_query_results* rasqal_query_execute(rasqal_query* query); | |||
RASQAL_API void* rasqal_query_get_user_data(rasqal_query *query); | RASQAL_API void* rasqal_query_get_user_data(rasqal_query *query); | |||
RASQAL_API void rasqal_query_set_user_data(rasqal_query *query, void *user_ data); | RASQAL_API void rasqal_query_set_user_data(rasqal_query *query, void *user_ data); | |||
/* query results */ | /* query results */ | |||
skipping to change at line 386 | skipping to change at line 423 | |||
RASQAL_API void rasqal_free_prefix(rasqal_prefix* prefix); | RASQAL_API void rasqal_free_prefix(rasqal_prefix* prefix); | |||
RASQAL_API void rasqal_prefix_print(rasqal_prefix* p, FILE* fh); | RASQAL_API void rasqal_prefix_print(rasqal_prefix* p, FILE* fh); | |||
/* Triple class */ | /* Triple class */ | |||
RASQAL_API rasqal_triple* rasqal_new_triple(rasqal_literal* subject, rasqal _literal* predicate, rasqal_literal* object); | RASQAL_API rasqal_triple* rasqal_new_triple(rasqal_literal* subject, rasqal _literal* predicate, rasqal_literal* object); | |||
RASQAL_API rasqal_triple* rasqal_new_triple_from_triple(rasqal_triple* t); | RASQAL_API rasqal_triple* rasqal_new_triple_from_triple(rasqal_triple* t); | |||
RASQAL_API void rasqal_free_triple(rasqal_triple* t); | RASQAL_API void rasqal_free_triple(rasqal_triple* t); | |||
RASQAL_API void rasqal_triple_print(rasqal_triple* t, FILE* fh); | RASQAL_API void rasqal_triple_print(rasqal_triple* t, FILE* fh); | |||
RASQAL_API void rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal * l); | RASQAL_API void rasqal_triple_set_origin(rasqal_triple* t, rasqal_literal * l); | |||
RASQAL_API rasqal_literal* rasqal_triple_get_origin(rasqal_triple* t); | RASQAL_API rasqal_literal* rasqal_triple_get_origin(rasqal_triple* t); | |||
RASQAL_API void rasqal_triple_set_flags(rasqal_triple* t, unsigned int flag | RASQAL_API RASQAL_DEPRECATED void rasqal_triple_set_flags(rasqal_triple* t, | |||
s); | unsigned int flags); | |||
RASQAL_API unsigned int rasqal_triple_get_flags(rasqal_triple* t); | RASQAL_API RASQAL_DEPRECATED unsigned int rasqal_triple_get_flags(rasqal_tr | |||
iple* t); | ||||
/* Variable class */ | /* Variable class */ | |||
RASQAL_API rasqal_variable* rasqal_new_variable(rasqal_query* query, const | RASQAL_API rasqal_variable* rasqal_new_variable_typed(rasqal_query* rq, ras | |||
unsigned char *name, rasqal_literal *value); | qal_variable_type type, unsigned char *name, rasqal_literal *value); | |||
RASQAL_API rasqal_variable* rasqal_new_variable(rasqal_query* query, unsign | ||||
ed char *name, rasqal_literal *value); | ||||
RASQAL_API void rasqal_free_variable(rasqal_variable* variable); | RASQAL_API void rasqal_free_variable(rasqal_variable* variable); | |||
RASQAL_API void rasqal_variable_print(rasqal_variable* t, FILE* fh); | RASQAL_API void rasqal_variable_print(rasqal_variable* t, FILE* fh); | |||
RASQAL_API void rasqal_variable_set_value(rasqal_variable* v, rasqal_litera l *l); | RASQAL_API void rasqal_variable_set_value(rasqal_variable* v, rasqal_litera l *l); | |||
/* memory functions */ | ||||
RASQAL_API void rasqal_free_memory(void *ptr); | ||||
RASQAL_API void* rasqal_alloc_memory(size_t size); | ||||
RASQAL_API void* rasqal_calloc_memory(size_t nmemb, size_t size); | ||||
/* rasqal_engine.c */ | /* rasqal_engine.c */ | |||
typedef enum { | typedef enum { | |||
RASQAL_TRIPLE_SUBJECT = 1, | RASQAL_TRIPLE_SUBJECT = 1, | |||
RASQAL_TRIPLE_PREDICATE= 2, | RASQAL_TRIPLE_PREDICATE= 2, | |||
RASQAL_TRIPLE_OBJECT = 4, | RASQAL_TRIPLE_OBJECT = 4, | |||
RASQAL_TRIPLE_ORIGIN = 8 | RASQAL_TRIPLE_ORIGIN = 8 | |||
} rasqal_triple_parts; | } rasqal_triple_parts; | |||
struct rasqal_triples_match_s { | struct rasqal_triples_match_s { | |||
skipping to change at line 435 | skipping to change at line 478 | |||
{ | { | |||
/* triple (subject, predicate, object) and origin */ | /* triple (subject, predicate, object) and origin */ | |||
rasqal_variable* bindings[4]; | rasqal_variable* bindings[4]; | |||
rasqal_triples_match *triples_match; | rasqal_triples_match *triples_match; | |||
void *context; | void *context; | |||
/* parts of the triple*/ | /* parts of the triple*/ | |||
rasqal_triple_parts parts; | rasqal_triple_parts parts; | |||
/* non-0 if all parts of the triple are given */ | ||||
int is_exact; | ||||
} rasqal_triple_meta; | } rasqal_triple_meta; | |||
struct rasqal_triples_source_s { | struct rasqal_triples_source_s { | |||
/* A source for this query */ | /* A source for this query */ | |||
rasqal_query *query; | rasqal_query *query; | |||
void *user_data; | void *user_data; | |||
/* the triples_source_factory initialises these method */ | /* DEPRECATED METHOD */ | |||
rasqal_triples_match* (*new_triples_match)(struct rasqal_triples_source_s * rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t); | rasqal_triples_match* (*new_triples_match)(struct rasqal_triples_source_s * rts, void *user_data, rasqal_triple_meta *m, rasqal_triple *t); | |||
/* the triples_source_factory initialises these method */ | ||||
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); | |||
}; | }; | |||
typedef struct rasqal_triples_source_s rasqal_triples_source; | typedef struct rasqal_triples_source_s rasqal_triples_source; | |||
typedef struct { | typedef struct { | |||
void *user_data; /* user data for triples_source_factory */ | void *user_data; /* user data for triples_source_factory */ | |||
size_t user_data_size; /* size of user data for new_triples_source */ | size_t user_data_size; /* size of user data for new_triples_source */ | |||
End of changes. 23 change blocks. | ||||
19 lines changed or deleted | 78 lines changed or added | |||