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
* *
* Copyright (C) 2003-2009, David Beckett http://www.dajobe.org/ * Copyright (C) 2003-2010, David Beckett http://www.dajobe.org/
* Copyright (C) 2003-2005, University of Bristol, UK http://www.bristol.ac .uk/ * Copyright (C) 2003-2005, 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
* 3. Apache License, V2.0 or any newer version * 3. Apache License, V2.0 or any newer version
* *
* 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
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 919 #define RASQAL_VERSION 920
/** /**
* RASQAL_VERSION_STRING: * RASQAL_VERSION_STRING:
* *
* Rasqal library version string * Rasqal library version string
*/ */
#define RASQAL_VERSION_STRING "0.9.19" #define RASQAL_VERSION_STRING "0.9.20"
/** /**
* 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 19 #define RASQAL_VERSION_RELEASE 20
/** /**
* 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 114 skipping to change at line 114
#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
#ifndef RAPTOR_WORLD_DECLARED
#define RAPTOR_WORLD_DECLARED 1
/* Declare raptor_world type unless it is declared in raptor.h */
typedef struct raptor_world_s raptor_world;
#endif
/* Public statics */ /* Public statics */
RASQAL_API RASQAL_API
extern const char * const rasqal_short_copyright_string; extern const char * const rasqal_short_copyright_string;
RASQAL_API RASQAL_API
extern const char * const rasqal_copyright_string; extern const char * const rasqal_copyright_string;
RASQAL_API RASQAL_API
extern const char * const rasqal_version_string; extern const char * const rasqal_version_string;
RASQAL_API RASQAL_API
extern const unsigned int rasqal_version_major; extern const unsigned int rasqal_version_major;
RASQAL_API RASQAL_API
skipping to change at line 324 skipping to change at line 318
* @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.
* @RASQAL_LITERAL_DOUBLE: Double floating point literal xsd:double. * @RASQAL_LITERAL_DOUBLE: Double floating point literal xsd:double.
* @RASQAL_LITERAL_FLOAT: Floating point literal xsd:float. * @RASQAL_LITERAL_FLOAT: Floating point literal xsd:float.
* @RASQAL_LITERAL_DECIMAL: Decimal integer xsd:decimal. * @RASQAL_LITERAL_DECIMAL: Decimal integer xsd:decimal.
* @RASQAL_LITERAL_DATETIME: Date/Time literal xsd:dateTime. * @RASQAL_LITERAL_DATETIME: Date/Time literal xsd:dateTime.
* @RASQAL_LITERAL_UDT: User defined typed literal with unknown datatype UR I * @RASQAL_LITERAL_UDT: User defined typed literal with unknown datatype UR I
* @RASQAL_LITERAL_PATTERN: Pattern literal for a regex. * @RASQAL_LITERAL_PATTERN: Pattern literal for a regex.
* @RASQAL_LITERAL_QNAME: XML Qname literal. * @RASQAL_LITERAL_QNAME: XML Qname literal.
* @RASQAL_LITERAL_VARIABLE: Variable literal. * @RASQAL_LITERAL_VARIABLE: Variable literal.
* @RASQAL_LITERAL_INTEGER_SUBTYPE: Internal.
* @RASQAL_LITERAL_UNKNOWN: Internal. * @RASQAL_LITERAL_UNKNOWN: Internal.
* @RASQAL_LITERAL_FIRST_XSD: Internal. * @RASQAL_LITERAL_FIRST_XSD: Internal.
* @RASQAL_LITERAL_LAST_XSD: Internal. * @RASQAL_LITERAL_LAST_XSD: Internal.
* @RASQAL_LITERAL_LAST: Internal. * @RASQAL_LITERAL_LAST: Internal.
* *
* Types of literal. * Types of literal.
* *
* The order in the enumeration is significant as it encodes * The order in the enumeration is significant as it encodes
* the SPARQL term ordering conditions: * the SPARQL term ordering conditions:
* *
skipping to change at line 370 skipping to change at line 365
RASQAL_LITERAL_DATETIME, RASQAL_LITERAL_DATETIME,
/* internal */ /* internal */
RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_XSD_STRING, RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_XSD_STRING,
/* internal */ /* internal */
RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME, RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME,
RASQAL_LITERAL_UDT, RASQAL_LITERAL_UDT,
RASQAL_LITERAL_PATTERN, RASQAL_LITERAL_PATTERN,
RASQAL_LITERAL_QNAME, RASQAL_LITERAL_QNAME,
RASQAL_LITERAL_VARIABLE, RASQAL_LITERAL_VARIABLE,
/* internal */ /* internal */
RASQAL_LITERAL_LAST= RASQAL_LITERAL_VARIABLE RASQAL_LITERAL_INTEGER_SUBTYPE,
/* internal */
RASQAL_LITERAL_LAST = RASQAL_LITERAL_INTEGER_SUBTYPE
} rasqal_literal_type; } rasqal_literal_type;
#define RASQAL_LITERAL_UDT_DEFINED 1 #define RASQAL_LITERAL_UDT_DEFINED 1
/** /**
* rasqal_row: * rasqal_row:
* *
* Rasqal Result Row class. * Rasqal Result Row class.
*/ */
typedef struct rasqal_row_s rasqal_row; typedef struct rasqal_row_s rasqal_row;
skipping to change at line 428 skipping to change at line 425
/* integer and boolean types */ /* integer and boolean types */
int integer; int integer;
/* double and float */ /* double and float */
double floating; double floating;
/* uri (can be temporarily NULL if a qname, see flags below) */ /* uri (can be temporarily NULL if a qname, see flags below) */
raptor_uri* uri; raptor_uri* uri;
/* variable */ /* variable */
rasqal_variable* variable; rasqal_variable* variable;
/* decimal */ /* decimal */
rasqal_xsd_decimal* decimal; rasqal_xsd_decimal* decimal;
/* datetime - does not write anything into value */
} value; } value;
/* for string */ /* for string */
const char *language; const char *language;
raptor_uri *datatype; raptor_uri *datatype;
/* various flags for literal types: /* various flags for literal types:
* pattern regex flags * pattern regex flags
* string datatype of qname * string datatype of qname
* uri qname of URI not yet expanded (temporary) * uri qname of URI not yet expanded (temporary)
skipping to change at line 482 skipping to change at line 480
* @RASQAL_EXPR_STR: Expression for SPARQL STR(A). * @RASQAL_EXPR_STR: Expression for SPARQL STR(A).
* @RASQAL_EXPR_LANG: Expression for SPARQL LANG(A). * @RASQAL_EXPR_LANG: Expression for SPARQL LANG(A).
* @RASQAL_EXPR_LANGMATCHES: Expression for SPARQL LANGMATCHES(A, B). * @RASQAL_EXPR_LANGMATCHES: Expression for SPARQL LANGMATCHES(A, B).
* @RASQAL_EXPR_DATATYPE: Expression for SPARQL DATATYPE(A). * @RASQAL_EXPR_DATATYPE: Expression for SPARQL DATATYPE(A).
* @RASQAL_EXPR_ISURI: Expression for SPARQL ISURI(A). * @RASQAL_EXPR_ISURI: Expression for SPARQL ISURI(A).
* @RASQAL_EXPR_ISBLANK: Expression for SPARQL ISBLANK(A). * @RASQAL_EXPR_ISBLANK: Expression for SPARQL ISBLANK(A).
* @RASQAL_EXPR_ISLITERAL: Expression for SPARQL ISLITERAL(A). * @RASQAL_EXPR_ISLITERAL: Expression for SPARQL ISLITERAL(A).
* @RASQAL_EXPR_CAST: Expression for cast literal A to type B. * @RASQAL_EXPR_CAST: Expression for cast literal A to type B.
* @RASQAL_EXPR_ORDER_COND_ASC: Expression for SPARQL order condition ascen ding. * @RASQAL_EXPR_ORDER_COND_ASC: Expression for SPARQL order condition ascen ding.
* @RASQAL_EXPR_ORDER_COND_DESC: Expression for SPARQL order condition desc ending. * @RASQAL_EXPR_ORDER_COND_DESC: Expression for SPARQL order condition desc ending.
* @RASQAL_EXPR_GROUP_COND_ASC: Expression for LAQRS group condition ascend * @RASQAL_EXPR_GROUP_COND_ASC: Obsolete - not used
ing. * @RASQAL_EXPR_GROUP_COND_DESC: Obsolete - not used
* @RASQAL_EXPR_GROUP_COND_DESC: Expression for LAQRS group condition desce * @RASQAL_EXPR_COUNT: Expression for LAQRS select COUNT() aggregate functi
nding. on
* @RASQAL_EXPR_COUNT: Expression for LAQRS select COUNT()
* @RASQAL_EXPR_VARSTAR: Expression for LAQRS select Variable * * @RASQAL_EXPR_VARSTAR: Expression for LAQRS select Variable *
* @RASQAL_EXPR_SAMETERM: Expression for SPARQL sameTerm * @RASQAL_EXPR_SAMETERM: Expression for SPARQL sameTerm
* @RASQAL_EXPR_SUM: Expression for LAQRS select SUM() * @RASQAL_EXPR_SUM: Expression for LAQRS select SUM() aggregate function
* @RASQAL_EXPR_AVG: Expression for LAQRS select AVG() * @RASQAL_EXPR_AVG: Expression for LAQRS select AVG() aggregate function
* @RASQAL_EXPR_MIN: Expression for LAQRS select MIN() * @RASQAL_EXPR_MIN: Expression for LAQRS select MIN() aggregate function
* @RASQAL_EXPR_MAX: Expression for LAQRS select MAX() * @RASQAL_EXPR_MAX: Expression for LAQRS select MAX() aggregate function
* @RASQAL_EXPR_COALESCE: Expression for LAQRS COALESCE(Expr+) * @RASQAL_EXPR_COALESCE: Expression for LAQRS COALESCE(Expr+)
* @RASQAL_EXPR_IF: Expression for LAQRS IF(expr, expr, expr)
* @RASQAL_EXPR_URI: Expression for LAQRS URI(expr)
* @RASQAL_EXPR_IRI: Expression for LAQRS IRI(expr)
* @RASQAL_EXPR_STRLANG: Expression for LAQRS STRLANG(expr, expr)
* @RASQAL_EXPR_STRDT: Expression for LAQRS STRDT(expr, expr)
* @RASQAL_EXPR_BNODE: Expression for LAQRS BNODE(expr)
* @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_IN: Expression for LAQRS expr IN ( list of expr )
* @RASQAL_EXPR_NOT_IN: Expression for LAQRS expr NOT IN ( list of 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 546 skipping to change at line 554
RASQAL_EXPR_GROUP_COND_ASC, RASQAL_EXPR_GROUP_COND_ASC,
RASQAL_EXPR_GROUP_COND_DESC, RASQAL_EXPR_GROUP_COND_DESC,
RASQAL_EXPR_COUNT, RASQAL_EXPR_COUNT,
RASQAL_EXPR_VARSTAR, RASQAL_EXPR_VARSTAR,
RASQAL_EXPR_SAMETERM, RASQAL_EXPR_SAMETERM,
RASQAL_EXPR_SUM, RASQAL_EXPR_SUM,
RASQAL_EXPR_AVG, RASQAL_EXPR_AVG,
RASQAL_EXPR_MIN, RASQAL_EXPR_MIN,
RASQAL_EXPR_MAX, RASQAL_EXPR_MAX,
RASQAL_EXPR_COALESCE, RASQAL_EXPR_COALESCE,
RASQAL_EXPR_IF,
RASQAL_EXPR_URI,
RASQAL_EXPR_IRI,
RASQAL_EXPR_STRLANG,
RASQAL_EXPR_STRDT,
RASQAL_EXPR_BNODE,
RASQAL_EXPR_GROUP_CONCAT,
RASQAL_EXPR_SAMPLE,
RASQAL_EXPR_IN,
RASQAL_EXPR_NOT_IN,
/* internal */ /* internal */
RASQAL_EXPR_LAST= RASQAL_EXPR_COALESCE RASQAL_EXPR_LAST= RASQAL_EXPR_NOT_IN
} rasqal_op; } rasqal_op;
/** /**
* rasqal_expression_flags:
* @RASQAL_EXPR_FLAG_DISTINCT: Distinct
* @RASQAL_EXPR_FLAG_AGGREGATE: Aggregate function expression
*
* Flags for expressions.
*/
typedef enum {
RASQAL_EXPR_FLAG_DISTINCT = 1,
RASQAL_EXPR_FLAG_AGGREGATE = 2
} rasqal_expression_flags;
/**
* rasqal_expression: * rasqal_expression:
* @world: rasqal_world object * @world: rasqal_world object
* @usage: reference count - 1 for itself * @usage: reference count - 1 for itself
* @op: expression operation * @op: expression operation
* @arg1: first argument * @arg1: first argument
* @arg2: second argument * @arg2: second argument
* @arg3: third argument (for #EXPR_REGEX ) * @arg3: third argument (for #RASQAL_EXPR_REGEX )
* @literal: literal argument * @literal: literal argument
* @value: UTF-8 value * @value: UTF-8 value
* @name: name for extension function qname(args...) and cast-to-uri * @name: name for extension function qname(args...) and cast-to-uri
* @args; args for extension function qname(args...), cast-to-uri and COALE * @args: args for extension function qname(args...), cast-to-uri and COALE
SCE SCE
* @params: args for extension function parameters (SPARQL 1.1) (Rasqal 0.9
.20+)
* @flags: bitflags from #rasqal_expression_flags for expressions (Rasqal 0
.9.20+)
* *
* Expression with arguments * Expression with arguments
* *
*/ */
struct rasqal_expression_s { struct rasqal_expression_s {
rasqal_world* world; rasqal_world* world;
int usage; int usage;
rasqal_op op; rasqal_op op;
struct rasqal_expression_s* arg1; struct rasqal_expression_s* arg1;
struct rasqal_expression_s* arg2; struct rasqal_expression_s* arg2;
struct rasqal_expression_s* arg3; struct rasqal_expression_s* arg3;
rasqal_literal* literal; rasqal_literal* literal;
unsigned char *value; unsigned char *value;
raptor_uri* name; raptor_uri* name;
raptor_sequence* args; raptor_sequence* args;
raptor_sequence* params;
unsigned int flags;
}; };
typedef struct rasqal_expression_s rasqal_expression; typedef struct rasqal_expression_s rasqal_expression;
/** /**
* rasqal_triple: * rasqal_triple:
* @subject: Triple subject. * @subject: Triple subject.
* @predicate: Triple predicate. * @predicate: Triple predicate.
* @object: Triple object. * @object: Triple object.
* @origin: Triple origin. * @origin: Triple origin.
* @flags: Or of enum #rasqal_triple_flags bits. * @flags: Or of enum #rasqal_triple_flags bits.
skipping to change at line 618 skipping to change at line 653
* @RASQAL_PATTERN_FLAGS_LAST: Internal * @RASQAL_PATTERN_FLAGS_LAST: Internal
* *
* Flags for #rasqal_graph_pattern. * Flags for #rasqal_graph_pattern.
*/ */
typedef enum { typedef enum {
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;
#if !defined(RASQAL_DISABLE_DEPRECATED)
typedef unsigned char* (*rasqal_generate_bnodeid_handler)(rasqal_query* que ry, void *user_data, unsigned char *user_bnodeid); typedef unsigned char* (*rasqal_generate_bnodeid_handler)(rasqal_query* que ry, void *user_data, unsigned char *user_bnodeid);
#endif
typedef unsigned char* (*rasqal_generate_bnodeid_handler2)(rasqal_world* wo
rld, void *user_data, unsigned char *user_bnodeid);
/** /**
* rasqal_query_verb: * rasqal_query_verb:
* @RASQAL_QUERY_VERB_SELECT: RDQL/SPARQL query select verb. * @RASQAL_QUERY_VERB_SELECT: RDQL/SPARQL query select verb.
* @RASQAL_QUERY_VERB_CONSTRUCT: SPARQL query construct verb. * @RASQAL_QUERY_VERB_CONSTRUCT: SPARQL query construct verb.
* @RASQAL_QUERY_VERB_DESCRIBE: SPARQL query describe verb. * @RASQAL_QUERY_VERB_DESCRIBE: SPARQL query describe verb.
* @RASQAL_QUERY_VERB_ASK: SPARQL query ask verb. * @RASQAL_QUERY_VERB_ASK: SPARQL query ask verb.
* @RASQAL_QUERY_VERB_DELETE: LAQRS query delete verb. * @RASQAL_QUERY_VERB_DELETE: LAQRS query delete verb.
* @RASQAL_QUERY_VERB_INSERT: LAQRS query insert verb. * @RASQAL_QUERY_VERB_INSERT: LAQRS query insert verb.
* @RASQAL_QUERY_VERB_UPDATE: SPARQL 1.1 (draft) update operation * @RASQAL_QUERY_VERB_UPDATE: SPARQL 1.1 (draft) update operation
skipping to change at line 770 skipping to change at line 809
/** /**
* 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()
* *
* Return value: 0 to truncate the visit * Return value: non-0 to truncate the visit
*/ */
typedef int (*rasqal_graph_pattern_visit_fn)(rasqal_query* query, rasqal_gr aph_pattern* gp, void *user_data); typedef int (*rasqal_graph_pattern_visit_fn)(rasqal_query* query, rasqal_gr aph_pattern* gp, void *user_data);
/* RASQAL API */ /* RASQAL API */
/* Public functions */ /* Public functions */
RASQAL_API RASQAL_API
rasqal_world *rasqal_new_world(void); rasqal_world *rasqal_new_world(void);
RASQAL_API RASQAL_API
int rasqal_world_open(rasqal_world* world); int rasqal_world_open(rasqal_world* world);
RASQAL_API RASQAL_API
void rasqal_free_world(rasqal_world* world); void rasqal_free_world(rasqal_world* world);
RASQAL_API RASQAL_API
void rasqal_world_set_raptor(rasqal_world* world, raptor_world* raptor_worl d_ptr); void rasqal_world_set_raptor(rasqal_world* world, raptor_world* raptor_worl d_ptr);
RASQAL_API RASQAL_API
raptor_world *rasqal_world_get_raptor(rasqal_world* world); raptor_world *rasqal_world_get_raptor(rasqal_world* world);
#if 0
RASQAL_API
void rasqal_world_set_log_handler(rasqal_world* world, void *user_data, rap
tor_log_handler handler);
#endif
RASQAL_API
int rasqal_world_set_default_generate_bnodeid_parameters(rasqal_world* worl
d, char *prefix, int base);
RASQAL_API
int rasqal_world_set_generate_bnodeid_handler(rasqal_world* world, void *us
er_data, rasqal_generate_bnodeid_handler2 handler);
/* Features */ /* Features */
RASQAL_API RASQAL_API
int rasqal_features_enumerate(rasqal_world* world, const rasqal_feature fea ture, const char **name, raptor_uri **uri, const char **label); int rasqal_features_enumerate(rasqal_world* world, const rasqal_feature fea ture, const char **name, raptor_uri **uri, const char **label);
RASQAL_API RASQAL_API
unsigned int rasqal_get_feature_count(void); unsigned int rasqal_get_feature_count(void);
RASQAL_API RASQAL_API
rasqal_feature rasqal_feature_from_uri(rasqal_world* world, raptor_uri *uri ); rasqal_feature rasqal_feature_from_uri(rasqal_world* world, raptor_uri *uri );
RASQAL_API RASQAL_API
int rasqal_feature_value_type(const rasqal_feature feature); int rasqal_feature_value_type(const rasqal_feature feature);
skipping to change at line 821 skipping to change at line 870
/* Destroy */ /* Destroy */
RASQAL_API RASQAL_API
void rasqal_free_query(rasqal_query* query); void rasqal_free_query(rasqal_query* query);
/* Methods */ /* Methods */
RASQAL_API RASQAL_API
const char* rasqal_query_get_name(rasqal_query* query); const char* rasqal_query_get_name(rasqal_query* query);
RASQAL_API RASQAL_API
const char* rasqal_query_get_label(rasqal_query* query); const char* rasqal_query_get_label(rasqal_query* query);
/* on raptor2: use rasqal_world_set_log_handler() instead of these */
#if 0
typedef void* raptor_message_handler;
#endif
RASQAL_API RASQAL_API
void rasqal_query_set_fatal_error_handler(rasqal_query* query, void *user_d ata, raptor_message_handler handler); void rasqal_query_set_fatal_error_handler(rasqal_query* query, void *user_d ata, raptor_message_handler handler);
RASQAL_API RASQAL_API
void rasqal_query_set_error_handler(rasqal_query* query, void *user_data, r aptor_message_handler handler); void rasqal_query_set_error_handler(rasqal_query* query, void *user_data, r aptor_message_handler handler);
RASQAL_API RASQAL_API
void rasqal_query_set_warning_handler(rasqal_query* query, void *user_data, raptor_message_handler handler); void rasqal_query_set_warning_handler(rasqal_query* query, void *user_data, raptor_message_handler handler);
RASQAL_API RASQAL_API
int rasqal_query_set_feature(rasqal_query* query, rasqal_feature feature, i nt value); int rasqal_query_set_feature(rasqal_query* query, rasqal_feature feature, i nt value);
RASQAL_API RASQAL_API
int rasqal_query_set_feature_string(rasqal_query *query, rasqal_feature fea ture, const unsigned char *value); int rasqal_query_set_feature_string(rasqal_query *query, rasqal_feature fea ture, const unsigned char *value);
RASQAL_API RASQAL_API
int rasqal_query_get_feature(rasqal_query *query, rasqal_feature feature); int rasqal_query_get_feature(rasqal_query *query, rasqal_feature feature);
RASQAL_API RASQAL_API
const unsigned char* rasqal_query_get_feature_string(rasqal_query *query, r asqal_feature feature); const unsigned char* rasqal_query_get_feature_string(rasqal_query *query, r asqal_feature feature);
RASQAL_API #if !defined(RASQAL_DISABLE_DEPRECATED)
RASQAL_API RASQAL_DEPRECATED
void rasqal_query_set_default_generate_bnodeid_parameters(rasqal_query* rdf _query, char *prefix, int base); void rasqal_query_set_default_generate_bnodeid_parameters(rasqal_query* rdf _query, char *prefix, int base);
RASQAL_API RASQAL_API RASQAL_DEPRECATED
void rasqal_query_set_generate_bnodeid_handler(rasqal_query* query, void *u ser_data, rasqal_generate_bnodeid_handler handler); void rasqal_query_set_generate_bnodeid_handler(rasqal_query* query, void *u ser_data, rasqal_generate_bnodeid_handler handler);
#endif
RASQAL_API RASQAL_API
rasqal_query_verb rasqal_query_get_verb(rasqal_query* query); rasqal_query_verb rasqal_query_get_verb(rasqal_query* query);
RASQAL_API RASQAL_API
int rasqal_query_get_wildcard(rasqal_query* query); int rasqal_query_get_wildcard(rasqal_query* query);
RASQAL_API RASQAL_API
int rasqal_query_get_distinct(rasqal_query* query); int rasqal_query_get_distinct(rasqal_query* query);
RASQAL_API RASQAL_API
void rasqal_query_set_distinct(rasqal_query* query, int distinct_mode); void rasqal_query_set_distinct(rasqal_query* query, int distinct_mode);
RASQAL_API RASQAL_API
skipping to change at line 905 skipping to change at line 962
rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx); rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_order_conditions_sequence(rasqal_query* q uery); raptor_sequence* rasqal_query_get_order_conditions_sequence(rasqal_query* q uery);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_query_get_order_condition(rasqal_query* query, in t idx); rasqal_expression* rasqal_query_get_order_condition(rasqal_query* query, in t idx);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_group_conditions_sequence(rasqal_query* q uery); raptor_sequence* rasqal_query_get_group_conditions_sequence(rasqal_query* q uery);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_query_get_group_condition(rasqal_query* query, in t idx); rasqal_expression* rasqal_query_get_group_condition(rasqal_query* query, in t idx);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_having_conditions_sequence(rasqal_query*
query);
RASQAL_API
rasqal_expression* rasqal_query_get_having_condition(rasqal_query* query, i
nt idx);
RASQAL_API
raptor_sequence* rasqal_query_get_construct_triples_sequence(rasqal_query* query); raptor_sequence* rasqal_query_get_construct_triples_sequence(rasqal_query* query);
RASQAL_API RASQAL_API
rasqal_triple* rasqal_query_get_construct_triple(rasqal_query* query, int i dx); rasqal_triple* rasqal_query_get_construct_triple(rasqal_query* query, int i dx);
RASQAL_API RASQAL_API
void rasqal_query_graph_pattern_visit(rasqal_query* query, rasqal_graph_pat tern_visit_fn visit_fn, void* data); void rasqal_query_graph_pattern_visit(rasqal_query* query, rasqal_graph_pat tern_visit_fn visit_fn, void* data);
RASQAL_API RASQAL_API
int rasqal_query_write(raptor_iostream* iostr, rasqal_query* query, raptor_ uri* format_uri, raptor_uri* base_uri); int rasqal_query_write(raptor_iostream* iostr, rasqal_query* query, raptor_ uri* format_uri, raptor_uri* base_uri);
/* update */ /* update */
RASQAL_API RASQAL_API
skipping to change at line 1019 skipping to change at line 1080
int rasqal_query_results_is_graph(rasqal_query_results *query_results); int rasqal_query_results_is_graph(rasqal_query_results *query_results);
RASQAL_API RASQAL_API
raptor_statement* rasqal_query_results_get_triple(rasqal_query_results *que ry_results); raptor_statement* rasqal_query_results_get_triple(rasqal_query_results *que ry_results);
RASQAL_API RASQAL_API
int rasqal_query_results_next_triple(rasqal_query_results *query_results); int rasqal_query_results_next_triple(rasqal_query_results *query_results);
/* Syntax result format */ /* Syntax result format */
RASQAL_API RASQAL_API
int rasqal_query_results_is_syntax(rasqal_query_results* query_results); int rasqal_query_results_is_syntax(rasqal_query_results* query_results);
#if !defined(RASQAL_DISABLE_DEPRECATED)
RASQAL_API RASQAL_DEPRECATED RASQAL_API RASQAL_DEPRECATED
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, raptor_uri *format_uri, raptor_uri *base_uri);
#endif
RASQAL_API RASQAL_API
int rasqal_query_results_write2(raptor_iostream *iostr, rasqal_query_result s *results, const char* name, const char* mime_type, raptor_uri *format_uri , raptor_uri *base_uri); int rasqal_query_results_write2(raptor_iostream *iostr, rasqal_query_result s *results, const char* name, const char* mime_type, raptor_uri *format_uri , raptor_uri *base_uri);
#if !defined(RASQAL_DISABLE_DEPRECATED)
RASQAL_API RASQAL_DEPRECATED RASQAL_API RASQAL_DEPRECATED
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, raptor_uri *format_uri, raptor_uri *base_uri);
#endif
RASQAL_API RASQAL_API
int rasqal_query_results_read2(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_read2(raptor_iostream *iostr, rasqal_query_results *results, const char* name, const char* mime_type, raptor_uri *format_uri, raptor_uri *base_uri);
/** /**
* RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER: * RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER:
* *
* Flag for rasqal_query_results_formats_enumerate() to get query results f ormats that can be read. * Flag for rasqal_query_results_formats_enumerate() to get query results f ormats that can be read.
*/ */
#define RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER 1 #define RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER 1
skipping to change at line 1048 skipping to change at line 1113
* 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_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)
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
RASQAL_API RASQAL_API
void rasqal_free_query_results_formatter(rasqal_query_results_formatter* fo rmatter); void rasqal_free_query_results_formatter(rasqal_query_results_formatter* fo rmatter);
RASQAL_API RASQAL_API
int rasqal_query_results_formatter_write(raptor_iostream *iostr, rasqal_que ry_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri); int rasqal_query_results_formatter_write(raptor_iostream *iostr, rasqal_que ry_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri);
RASQAL_API RASQAL_API
int rasqal_query_results_formatter_read(rasqal_world* world, raptor_iostrea m *iostr, rasqal_query_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri); int rasqal_query_results_formatter_read(rasqal_world* world, raptor_iostrea m *iostr, rasqal_query_results_formatter* formatter, rasqal_query_results* results, raptor_uri *base_uri);
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
skipping to change at line 1082 skipping to change at line 1149
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)
* @RASQAL_COMPARE_SAMETERM: SPARQL sameTerm() builtin rules apply. * @RASQAL_COMPARE_SAMETERM: SPARQL sameTerm() builtin rules apply.
* *
* Flags for rasqal_expression_evaluate(), rasqal_literal_compare(), * Flags for rasqal_expression_evaluate(), rasqal_literal_compare() or
* rasqal_literal_as_string_flags(), rasqal_new_literal_from_promotion(), * rasqal_literal_as_string_flags()
* rasqal_literal_equals_flags().
*/ */
typedef enum { typedef enum {
RASQAL_COMPARE_NOCASE = 1, RASQAL_COMPARE_NOCASE = 1,
RASQAL_COMPARE_XQUERY = 2, RASQAL_COMPARE_XQUERY = 2,
RASQAL_COMPARE_RDF = 4, RASQAL_COMPARE_RDF = 4,
RASQAL_COMPARE_URI = 8, RASQAL_COMPARE_URI = 8,
RASQAL_COMPARE_SAMETERM = 16 RASQAL_COMPARE_SAMETERM = 16
} rasqal_compare_flags; } rasqal_compare_flags;
/* Expression class */ /* Expression class */
skipping to change at line 1108 skipping to change at line 1174
rasqal_expression* rasqal_new_1op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg); rasqal_expression* rasqal_new_1op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_2op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2); rasqal_expression* rasqal_new_2op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_3op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2, rasqal_expression* arg3); rasqal_expression* rasqal_new_3op_expression(rasqal_world* world, rasqal_op op, rasqal_expression* arg1, rasqal_expression* arg2, rasqal_expression* arg3);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_string_op_expression(rasqal_world* world, ras qal_op op, rasqal_expression* arg1, rasqal_literal* literal); rasqal_expression* rasqal_new_string_op_expression(rasqal_world* world, ras qal_op op, rasqal_expression* arg1, rasqal_literal* literal);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_literal_expression(rasqal_world* world, rasqa l_literal* literal); rasqal_expression* rasqal_new_literal_expression(rasqal_world* world, rasqa l_literal* literal);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_function_expression2(rasqal_world* world, rap
tor_uri* name, raptor_sequence* args, raptor_sequence* params, unsigned int
flags);
#if !defined(RASQAL_DISABLE_DEPRECATED)
RASQAL_API RASQAL_DEPRECATED
rasqal_expression* rasqal_new_function_expression(rasqal_world* world, rapt or_uri* name, raptor_sequence* args); rasqal_expression* rasqal_new_function_expression(rasqal_world* world, rapt or_uri* name, raptor_sequence* args);
#endif
RASQAL_API
rasqal_expression* rasqal_new_aggregate_function_expression(rasqal_world* w
orld, rasqal_op op, rasqal_expression* arg1, raptor_sequence* params, unsig
ned int flags);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_cast_expression(rasqal_world* world, raptor_u ri* name, rasqal_expression *value); rasqal_expression* rasqal_new_cast_expression(rasqal_world* world, raptor_u ri* name, rasqal_expression *value);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_coalesce_expression(rasqal_world* world, rapt or_sequence* args); rasqal_expression* rasqal_new_coalesce_expression(rasqal_world* world, rapt or_sequence* args);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_set_expression(rasqal_world* world, rasqal_op
op, rasqal_expression* arg1, raptor_sequence* args);
RASQAL_API
rasqal_expression* rasqal_new_group_concat_expression(rasqal_world* world,
int flags, raptor_sequence* args, rasqal_literal* separator);
RASQAL_API
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_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: 0 to truncate the visit * Return value: non-0 to truncate the visit
*/ */
typedef int (*rasqal_expression_visit_fn)(void *user_data, rasqal_expressio n *e); typedef int (*rasqal_expression_visit_fn)(void *user_data, rasqal_expressio n *e);
RASQAL_API RASQAL_API
int rasqal_expression_visit(rasqal_expression* e, rasqal_expression_visit_f n fn, void *user_data); int rasqal_expression_visit(rasqal_expression* e, rasqal_expression_visit_f n fn, void *user_data);
/* Literal class */ /* Literal class */
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_integer_literal(rasqal_world* world, rasqal_lite ral_type type, int integer); rasqal_literal* rasqal_new_integer_literal(rasqal_world* world, rasqal_lite ral_type type, int integer);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_typed_literal(rasqal_world* world, rasqal_litera l_type type, const unsigned char* string); rasqal_literal* rasqal_new_typed_literal(rasqal_world* world, rasqal_litera l_type type, const unsigned char* string);
skipping to change at line 1474 skipping to change at line 1550
/* The info below is solely for gtk-doc - ignore it */ /* The info below is solely for gtk-doc - ignore it */
/** /**
* raptor_world: * raptor_world:
* *
* Internal * Internal
*/ */
/** /**
* RAPTOR_WORLD_DECLARED:
*
* Internal
*/
/**
* RASQAL_QUERY_RESULTS_FORMATTER_DECLARED: * RASQAL_QUERY_RESULTS_FORMATTER_DECLARED:
* *
* Internal * Internal
*/ */
/** /**
* RASQAL_WORLD_DECLARED: * RASQAL_WORLD_DECLARED:
* *
* Internal * Internal
*/ */
skipping to change at line 1508 skipping to change at line 1578
* rasqal_expression_s: * rasqal_expression_s:
* @usage: Internal * @usage: Internal
* @op: Internal * @op: Internal
* @arg1: Internal * @arg1: Internal
* @arg2: Internal * @arg2: Internal
* @arg3: Internal * @arg3: Internal
* @literal: Internal * @literal: Internal
* @value: Internal * @value: Internal
* @name: Internal * @name: Internal
* @args: Internal * @args: Internal
* @params: Internal
* @flags: Internal
* *
* Internal - see #rasqal_expression. * Internal - see #rasqal_expression.
* *
*/ */
/** /**
* bind_match: * bind_match:
* @rtm: triples match context * @rtm: triples match context
* @user_data: user data * @user_data: user data
* @bindings: variable binding for parts of triple (s, p, o, g) * @bindings: variable binding for parts of triple (s, p, o, g)
 End of changes. 40 change blocks. 
37 lines changed or deleted 124 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/