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.133 2006/01/12 05:15:52 cmdjb Exp $ * $Id: rasqal.h 10872 2006-04-28 05:49:16Z dajobe $
* *
* Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/ * Copyright (C) 2003-2006, David Beckett http://purl.org/net/dajobe/
* 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
skipping to change at line 336 skipping to change at line 336
* @RASQAL_EXPR_LE: Expression for A less than or equal to B. * @RASQAL_EXPR_LE: Expression for A less than or equal to B.
* @RASQAL_EXPR_GE: Expression for A greater than or equal to B. * @RASQAL_EXPR_GE: Expression for A greater than or equal to B.
* @RASQAL_EXPR_UMINUS: Expression for -A. * @RASQAL_EXPR_UMINUS: Expression for -A.
* @RASQAL_EXPR_PLUS: Expression for +A. * @RASQAL_EXPR_PLUS: Expression for +A.
* @RASQAL_EXPR_MINUS: Expression for A-B. * @RASQAL_EXPR_MINUS: Expression for A-B.
* @RASQAL_EXPR_STAR: Expression for A*B. * @RASQAL_EXPR_STAR: Expression for A*B.
* @RASQAL_EXPR_SLASH: Expression for A/B. * @RASQAL_EXPR_SLASH: Expression for A/B.
* @RASQAL_EXPR_REM: Expression for A/B remainder. * @RASQAL_EXPR_REM: Expression for A/B remainder.
* @RASQAL_EXPR_STR_EQ: Expression for A string equals B. * @RASQAL_EXPR_STR_EQ: Expression for A string equals B.
* @RASQAL_EXPR_STR_NEQ: Expression for A string not-equals B. * @RASQAL_EXPR_STR_NEQ: Expression for A string not-equals B.
* @RASQAL_EXPR_STR_MATCH: Expression for string A matches regex B with fla * @RASQAL_EXPR_STR_MATCH: Expression for string A matches literal regex B
gs. with flags.
* @RASQAL_EXPR_STR_NMATCH: Expression for string A not-matches regex B wit * @RASQAL_EXPR_STR_NMATCH: Expression for string A not-matches literal reg
h flags. ex B with flags.
* @RASQAL_EXPR_REGEX: Expression for string A matches expression regex B w
ith flags.
* @RASQAL_EXPR_TILDE: Expression for binary not A. * @RASQAL_EXPR_TILDE: Expression for binary not A.
* @RASQAL_EXPR_BANG: Expression for logical not A. * @RASQAL_EXPR_BANG: Expression for logical not A.
* @RASQAL_EXPR_LITERAL: Expression for a #rasqal_literal. * @RASQAL_EXPR_LITERAL: Expression for a #rasqal_literal.
* @RASQAL_EXPR_FUNCTION: Expression for a function A with arguments (B...) . * @RASQAL_EXPR_FUNCTION: Expression for a function A with arguments (B...) .
* @RASQAL_EXPR_BOUND: Expression for SPARQL ISBOUND(A). * @RASQAL_EXPR_BOUND: Expression for SPARQL ISBOUND(A).
* @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).
skipping to change at line 396 skipping to change at line 397
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_ORDER_COND_ASC, RASQAL_EXPR_ORDER_COND_ASC,
RASQAL_EXPR_ORDER_COND_DESC, RASQAL_EXPR_ORDER_COND_DESC,
RASQAL_EXPR_LANGMATCHES, RASQAL_EXPR_LANGMATCHES,
RASQAL_EXPR_REGEX,
/* internal */ /* internal */
RASQAL_EXPR_LAST= RASQAL_EXPR_LANGMATCHES RASQAL_EXPR_LAST= RASQAL_EXPR_REGEX
} rasqal_op; } rasqal_op;
/** /**
* rasqal_expression: * rasqal_expression:
* *
* 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 {
int usage; /* reference count - 1 for itself */ int usage; /* reference count - 1 for itself */
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; /* optional 3rd arg for EXPR_REGEX */
rasqal_literal* literal; rasqal_literal* literal;
rasqal_variable* variable; rasqal_variable* variable;
unsigned char *value; /* UTF-8 value */ unsigned char *value; /* UTF-8 value */
/* 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;
skipping to change at line 607 skipping to change at line 610
RASQAL_API 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
void rasqal_query_add_variable(rasqal_query* query, rasqal_variable* var); void 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);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_anonymous_variable_sequence(rasqal_query*
query);
RASQAL_API
raptor_sequence* rasqal_query_get_all_variable_sequence(rasqal_query* query ); raptor_sequence* rasqal_query_get_all_variable_sequence(rasqal_query* query );
RASQAL_API RASQAL_API
rasqal_variable* rasqal_query_get_variable(rasqal_query* query, int idx); rasqal_variable* rasqal_query_get_variable(rasqal_query* query, int idx);
RASQAL_API RASQAL_API
int rasqal_query_has_variable(rasqal_query* query, const unsigned char *nam e); int rasqal_query_has_variable(rasqal_query* query, const unsigned char *nam e);
RASQAL_API RASQAL_API
int rasqal_query_set_variable(rasqal_query* query, const unsigned char *nam e, rasqal_literal* value); int rasqal_query_set_variable(rasqal_query* query, const unsigned char *nam e, rasqal_literal* value);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query); raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query);
RASQAL_API RASQAL_API
skipping to change at line 634 skipping to change at line 639
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_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
int rasqal_query_write(raptor_iostream* iostr, rasqal_query* query, raptor_
uri* format_uri, raptor_uri* base_uri);
/* graph patterns */ /* graph patterns */
RASQAL_API RASQAL_API
rasqal_graph_pattern* rasqal_query_get_query_graph_pattern(rasqal_query* qu ery); rasqal_graph_pattern* rasqal_query_get_query_graph_pattern(rasqal_query* qu ery);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_graph_pattern_sequence(rasqal_query* quer y); raptor_sequence* rasqal_query_get_graph_pattern_sequence(rasqal_query* quer y);
RASQAL_API RASQAL_API
rasqal_graph_pattern* rasqal_query_get_graph_pattern(rasqal_query* query, i nt idx); rasqal_graph_pattern* rasqal_query_get_graph_pattern(rasqal_query* query, i nt idx);
RASQAL_API RASQAL_API
void rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pattern* graph _pattern, rasqal_graph_pattern* sub_graph_pattern); void rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pattern* graph _pattern, rasqal_graph_pattern* sub_graph_pattern);
skipping to change at line 666 skipping to change at line 673
RASQAL_API RASQAL_API
void rasqal_graph_pattern_print(rasqal_graph_pattern* gp, FILE* fh); void rasqal_graph_pattern_print(rasqal_graph_pattern* gp, FILE* fh);
RASQAL_API RASQAL_API
int rasqal_graph_pattern_add_constraint(rasqal_graph_pattern* gp, rasqal_ex pression* expr); int rasqal_graph_pattern_add_constraint(rasqal_graph_pattern* gp, rasqal_ex pression* expr);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_graph_pattern_get_constraint_sequence(rasqal_graph_ pattern* gp); raptor_sequence* rasqal_graph_pattern_get_constraint_sequence(rasqal_graph_ pattern* gp);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_graph_pattern_get_constraint(rasqal_graph_pattern * gp, int idx); rasqal_expression* rasqal_graph_pattern_get_constraint(rasqal_graph_pattern * gp, int idx);
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
int rasqal_graph_pattern_get_index(rasqal_graph_pattern* gp);
/* 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
void rasqal_query_print(rasqal_query* query, FILE* fh); void 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);
skipping to change at line 725 skipping to change at line 734
RASQAL_API RASQAL_API
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);
RASQAL_API RASQAL_API
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);
RASQAL_API
int rasqal_query_iostream_write_escaped_counted_string(rasqal_query* query,
raptor_iostream* iostr, const unsigned char* string, size_t len);
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);
/* Data graph class */ /* Data graph class */
RASQAL_API RASQAL_API
rasqal_data_graph* rasqal_new_data_graph(raptor_uri* uri, raptor_uri* name_ uri, int flags); rasqal_data_graph* rasqal_new_data_graph(raptor_uri* uri, raptor_uri* name_ uri, int flags);
RASQAL_API RASQAL_API
void rasqal_free_data_graph(rasqal_data_graph* dg); void rasqal_free_data_graph(rasqal_data_graph* dg);
RASQAL_API RASQAL_API
void rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh); void rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh);
/** /**
* rasqal_compare_flags: * rasqal_compare_flags:
skipping to change at line 751 skipping to change at line 765
RASQAL_COMPARE_NOCASE = 1, RASQAL_COMPARE_NOCASE = 1,
RASQAL_COMPARE_XQUERY = 2 RASQAL_COMPARE_XQUERY = 2
} rasqal_compare_flags; } rasqal_compare_flags;
/* Expression class */ /* Expression class */
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_1op_expression(rasqal_op op, rasqal_expressio n* arg); rasqal_expression* rasqal_new_1op_expression(rasqal_op op, rasqal_expressio n* arg);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_2op_expression(rasqal_op op, rasqal_expressio n* arg1, rasqal_expression* arg2); rasqal_expression* rasqal_new_2op_expression(rasqal_op op, rasqal_expressio n* arg1, rasqal_expression* arg2);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_3op_expression(rasqal_op op, rasqal_expressio
n* arg1, rasqal_expression* arg2, rasqal_expression* arg3);
RASQAL_API
rasqal_expression* rasqal_new_string_op_expression(rasqal_op op, rasqal_exp ression* arg1, rasqal_literal* literal); rasqal_expression* rasqal_new_string_op_expression(rasqal_op op, rasqal_exp ression* arg1, rasqal_literal* literal);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_literal_expression(rasqal_literal* literal); rasqal_expression* rasqal_new_literal_expression(rasqal_literal* literal);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_function_expression(raptor_uri* name, raptor_ sequence* args); rasqal_expression* rasqal_new_function_expression(raptor_uri* name, raptor_ sequence* args);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_cast_expression(raptor_uri* name, rasqal_expr ession *value); rasqal_expression* rasqal_new_cast_expression(raptor_uri* name, rasqal_expr ession *value);
RASQAL_API RASQAL_API
rasqal_expression* rasqal_new_expression_from_expression(rasqal_expression* e); rasqal_expression* rasqal_new_expression_from_expression(rasqal_expression* e);
skipping to change at line 835 skipping to change at line 851
void rasqal_free_literal(rasqal_literal* l); void rasqal_free_literal(rasqal_literal* l);
RASQAL_API RASQAL_API
void rasqal_literal_print(rasqal_literal* l, FILE* fh); void rasqal_literal_print(rasqal_literal* l, FILE* fh);
RASQAL_API 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);
RASQAL_API
rasqal_literal* rasqal_literal_as_node(rasqal_literal* l); rasqal_literal* rasqal_literal_as_node(rasqal_literal* l);
RASQAL_API RASQAL_API
int rasqal_literal_compare(rasqal_literal* l1, rasqal_literal* l2, int flag s, int *error); int rasqal_literal_compare(rasqal_literal* l1, rasqal_literal* l2, int flag s, int *error);
RASQAL_API RASQAL_API
int rasqal_literal_equals(rasqal_literal* l1, rasqal_literal* l2); int rasqal_literal_equals(rasqal_literal* l1, rasqal_literal* l2);
RASQAL_API RASQAL_API
rasqal_prefix* rasqal_new_prefix(const unsigned char* prefix, raptor_uri* u ri); rasqal_prefix* rasqal_new_prefix(const unsigned char* prefix, raptor_uri* u ri);
RASQAL_API RASQAL_API
skipping to change at line 1000 skipping to change at line 1018
void rasqal_set_triples_source_factory(void (*register_fn)(rasqal_triples_s ource_factory *factory), void* user_data); void rasqal_set_triples_source_factory(void (*register_fn)(rasqal_triples_s ource_factory *factory), void* user_data);
/* The info below is solely for gtk-doc - ignore it */ /* The info below is solely for gtk-doc - ignore it */
/** /**
* rasqal_expression_s: * rasqal_expression_s:
* @usage: Internal * @usage: Internal
* @op: Internal * @op: Internal
* @arg1: Internal * @arg1: Internal
* @arg2: Internal * @arg2: Internal
* @arg3: Internal
* @literal: Internal * @literal: Internal
* @variable: Internal * @variable: Internal
* @value: Internal * @value: Internal
* @name: Internal * @name: Internal
* @args: Internal * @args: Internal
* *
* Internal - see #rasqal_expression. * Internal - see #rasqal_expression.
* *
*/ */
 End of changes. 12 change blocks. 
6 lines changed or deleted 32 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/