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 13206 2007-11-15 21:48:27Z dajobe $ * Copyright (C) 2003-2008, David Beckett http://www.dajobe.org/
*
* Copyright (C) 2003-2007, 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
* *
* 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 101 skipping to change at line 99
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;
/* Public structures */ /* Public structures */
#ifndef RASQAL_WORLD_DECLARED
#define RASQAL_WORLD_DECLARED 1
/**
* rasqal_world:
*
* Rasqal world class.
*/
typedef struct rasqal_world_s rasqal_world;
#endif
/** /**
* rasqal_query: * rasqal_query:
* *
* Rasqal query class. * Rasqal query class.
*/ */
typedef struct rasqal_query_s rasqal_query; typedef struct rasqal_query_s rasqal_query;
/** /**
* rasqal_query_results: * rasqal_query_results:
* *
* Rasqal query results class. * Rasqal query results class.
*/ */
typedef struct rasqal_query_results_s rasqal_query_results; typedef struct rasqal_query_results_s rasqal_query_results;
#ifndef RASQAL_QUERY_RESULTS_FORMATTER_DECLARED
#define RASQAL_QUERY_RESULTS_FORMATTER_DECLARED 1
/** /**
* rasqal_query_results_formatter: * rasqal_query_results_formatter:
* *
* Rasqal query results formatter class. * Rasqal query results formatter class.
*/ */
typedef struct rasqal_query_results_formatter_s rasqal_query_results_format ter; typedef struct rasqal_query_results_formatter_s rasqal_query_results_format ter;
#endif
typedef struct rasqal_literal_s rasqal_literal; typedef struct rasqal_literal_s rasqal_literal;
/** /**
* rasqal_graph_pattern: * rasqal_graph_pattern:
* *
* Rasqal graph pattern class. * Rasqal graph pattern class.
*/ */
typedef struct rasqal_graph_pattern_s rasqal_graph_pattern; typedef struct rasqal_graph_pattern_s rasqal_graph_pattern;
skipping to change at line 247 skipping to change at line 258
} 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 Literal / xsd:string (SPARQL r:Literal) * @RASQAL_LITERAL_STRING: RDF Literal / xsd:string (SPARQL r:Literal)
* @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_FLOATING: Deprecated %RASQAL_LITERAL_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_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_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:
* *
* Blank Nodes << IRIS << RDF literals << typed literals * Blank Nodes << IRIs << RDF literals << typed literals
* *
* which coresponds to in enum values * which coresponds to in enum values
* *
* BLANK << URI << STRING << * BLANK << URI << STRING <<
* (BOOLEAN | INTEGER | DOUBLE | FLOAT | DECIMAL | DATETIME) * (BOOLEAN | INTEGER | DOUBLE | FLOAT | DECIMAL | DATETIME)
*
* (RASQAL_LITERAL_FIRST_XSD ... RASQAL_LITERAL_LAST_XSD) * (RASQAL_LITERAL_FIRST_XSD ... RASQAL_LITERAL_LAST_XSD)
* *
* Not used (internal): PATTERN, QNAME, VARIABLE * Not used (internal): PATTERN, QNAME, VARIABLE
* *
* See rasqal_literal_compare() when used with flags * See rasqal_literal_compare() when used with flags
* %RASQAL_COMPARE_XQUERY * %RASQAL_COMPARE_XQUERY
*/ */
typedef enum { typedef enum {
/* internal */ /* internal */
RASQAL_LITERAL_UNKNOWN, RASQAL_LITERAL_UNKNOWN,
RASQAL_LITERAL_BLANK, RASQAL_LITERAL_BLANK,
RASQAL_LITERAL_URI, RASQAL_LITERAL_URI,
RASQAL_LITERAL_STRING, RASQAL_LITERAL_STRING,
RASQAL_LITERAL_BOOLEAN, RASQAL_LITERAL_BOOLEAN,
RASQAL_LITERAL_INTEGER, RASQAL_LITERAL_INTEGER,
RASQAL_LITERAL_DOUBLE, RASQAL_LITERAL_DOUBLE,
/* deprecated */
RASQAL_LITERAL_FLOATING = RASQAL_LITERAL_DOUBLE,
RASQAL_LITERAL_FLOAT, RASQAL_LITERAL_FLOAT,
RASQAL_LITERAL_DECIMAL, RASQAL_LITERAL_DECIMAL,
RASQAL_LITERAL_DATETIME, RASQAL_LITERAL_DATETIME,
/* internal */ /* internal */
RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_STRING, RASQAL_LITERAL_FIRST_XSD = RASQAL_LITERAL_STRING,
/* internal */ /* internal */
RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME, RASQAL_LITERAL_LAST_XSD = RASQAL_LITERAL_DATETIME,
RASQAL_LITERAL_PATTERN, RASQAL_LITERAL_PATTERN,
RASQAL_LITERAL_QNAME, RASQAL_LITERAL_QNAME,
RASQAL_LITERAL_VARIABLE, RASQAL_LITERAL_VARIABLE,
skipping to change at line 356 skipping to change at line 365
/* 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)
*/ */
const unsigned char *flags; const unsigned char *flags;
/* parent XSD type if any or RASQAL_LITERAL_UNKNOWN */ /* parent XSD type if any or RASQAL_LITERAL_UNKNOWN */
rasqal_literal_type parent_type; rasqal_literal_type parent_type;
/* world object */
rasqal_world *world;
}; };
/** /**
* rasqal_op: * rasqal_op:
* @RASQAL_EXPR_AND: Expression for AND(A, B) * @RASQAL_EXPR_AND: Expression for AND(A, B)
* @RASQAL_EXPR_OR: Expression for OR(A, B) * @RASQAL_EXPR_OR: Expression for OR(A, B)
* @RASQAL_EXPR_EQ: Expression for A equals B * @RASQAL_EXPR_EQ: Expression for A equals B
* @RASQAL_EXPR_NEQ: Expression for A not equals B. * @RASQAL_EXPR_NEQ: Expression for A not equals B.
* @RASQAL_EXPR_LT: Expression for A less than B. * @RASQAL_EXPR_LT: Expression for A less than B.
* @RASQAL_EXPR_GT: Expression for A greather than B. * @RASQAL_EXPR_GT: Expression for A greather than B.
skipping to change at line 598 skipping to change at line 610
* *
* Return value: 0 to truncate the visit * Return value: 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
void rasqal_init(void); rasqal_world *rasqal_new_world(void);
RASQAL_API RASQAL_API
void rasqal_finish(void); void rasqal_free_world(rasqal_world* world);
/* Features */ /* Features */
RASQAL_API RASQAL_API
int rasqal_features_enumerate(const rasqal_feature feature, const char **na me, raptor_uri **uri, const char **label); int rasqal_features_enumerate(const rasqal_feature feature, const char **na me, 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(raptor_uri *uri); rasqal_feature rasqal_feature_from_uri(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);
RASQAL_API RASQAL_API
int rasqal_languages_enumerate(const unsigned int counter, const char **nam int rasqal_languages_enumerate(rasqal_world* world, unsigned int counter, c
e, const char **label, const unsigned char **uri_string); onst char **name, const char **label, const unsigned char **uri_string);
RASQAL_API RASQAL_API
int rasqal_language_name_check(const char *name); int rasqal_language_name_check(rasqal_world* world, const char *name);
/* Query class */ /* Query class */
/* Create */ /* Create */
RASQAL_API RASQAL_API
rasqal_query* rasqal_new_query(const char *name, const unsigned char *uri); rasqal_query* rasqal_new_query(rasqal_world* world, const char *name, const
unsigned char *uri);
/* 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);
RASQAL_API RASQAL_API
skipping to change at line 679 skipping to change at line 693
void rasqal_query_set_offset(rasqal_query* query, int offset); void rasqal_query_set_offset(rasqal_query* query, int offset);
RASQAL_API RASQAL_API
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
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); 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);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_anonymous_variable_sequence(rasqal_query* query); raptor_sequence* rasqal_query_get_anonymous_variable_sequence(rasqal_query* query);
RASQAL_API 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
rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx); rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx);
RASQAL_API RASQAL_API
void rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix); int rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query); raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query);
RASQAL_API RASQAL_API
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);
skipping to change at line 727 skipping to change at line 741
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);
/* 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); int rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pattern* graph_ pattern, rasqal_graph_pattern* sub_graph_pattern);
RASQAL_API RASQAL_API
rasqal_triple* rasqal_graph_pattern_get_triple(rasqal_graph_pattern* graph_ pattern, int idx); rasqal_triple* rasqal_graph_pattern_get_triple(rasqal_graph_pattern* graph_ pattern, int idx);
RASQAL_API RASQAL_API
raptor_sequence* rasqal_graph_pattern_get_sub_graph_pattern_sequence(rasqal _graph_pattern* graph_pattern); raptor_sequence* rasqal_graph_pattern_get_sub_graph_pattern_sequence(rasqal _graph_pattern* graph_pattern);
RASQAL_API RASQAL_API
rasqal_graph_pattern* rasqal_graph_pattern_get_sub_graph_pattern(rasqal_gra ph_pattern* graph_pattern, int idx); rasqal_graph_pattern* rasqal_graph_pattern_get_sub_graph_pattern(rasqal_gra ph_pattern* graph_pattern, int idx);
RASQAL_API RASQAL_DEPRECATED
int rasqal_graph_pattern_get_flags(rasqal_graph_pattern* graph_pattern);
RASQAL_API RASQAL_API
rasqal_graph_pattern_operator rasqal_graph_pattern_get_operator(rasqal_grap h_pattern* graph_pattern); rasqal_graph_pattern_operator rasqal_graph_pattern_get_operator(rasqal_grap h_pattern* graph_pattern);
RASQAL_API RASQAL_API
const char* rasqal_graph_pattern_operator_as_string(rasqal_graph_pattern_op erator op); const char* rasqal_graph_pattern_operator_as_string(rasqal_graph_pattern_op erator op);
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);
skipping to change at line 814 skipping to change at line 826
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);
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 RASQAL_API
int rasqal_query_results_formats_enumerate_full(const unsigned int counter, int rasqal_query_results_read(raptor_iostream *iostr, rasqal_query_results
const char **name, const char **label, const unsigned char **uri_string, c *results, raptor_uri *format_uri, raptor_uri *base_uri);
onst char **mime_type);
/**
* RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER:
*
* 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
/**
* RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER:
*
* 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
RASQAL_API RASQAL_API
int rasqal_query_results_formats_enumerate(const unsigned int counter, cons t char **name, const char **label, const unsigned char **uri_string); 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(const char *name, raptor_uri* uri, c onst 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_formatter(const ch ar *name, raptor_uri* uri); rasqal_query_results_formatter* rasqal_new_query_results_formatter(rasqal_w orld* world, const char *name, raptor_uri* format_uri);
RASQAL_API RASQAL_API
rasqal_query_results_formatter* rasqal_new_query_results_formatter_by_mime_ type(const char *mime_type); rasqal_query_results_formatter* rasqal_new_query_results_formatter_by_mime_ type(rasqal_world* world, const char *mime_type);
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);
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(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);
skipping to change at line 891 skipping to change at line 919
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
void rasqal_expression_print(rasqal_expression* e, FILE* fh); void rasqal_expression_print(rasqal_expression* e, FILE* fh);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_expression_evaluate(rasqal_query* query, rasqal_expr ession* e, int flags); rasqal_literal* rasqal_expression_evaluate(rasqal_query* query, rasqal_expr ession* e, int flags);
/** /**
* rasqal_expression_foreach_fn:
* @user_data: user data passed in with rasqal_expression_foreach()
* @e: current expression
*
* User function to visit an expression and operate on it.
*
* @deprecated: Use #rasqal_expression_visit_fn and rasqal_expression_visit
()
*
* Return value: 0 to truncate the visit
*/
typedef int (*rasqal_expression_foreach_fn)(void *user_data, rasqal_express
ion *e);
RASQAL_API RASQAL_DEPRECATED
int rasqal_expression_foreach(rasqal_expression* e, rasqal_expression_forea
ch_fn fn, void *user_data);
/**
* 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: 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_literal_type type, int in teger); 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_literal_type type, const un rasqal_literal* rasqal_new_typed_literal(rasqal_world* world, rasqal_litera
signed char* string); l_type type, const unsigned char* string);
RASQAL_API RASQAL_DEPRECATED
rasqal_literal* rasqal_new_floating_literal(double f);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_double_literal(double d); rasqal_literal* rasqal_new_double_literal(rasqal_world* world, double d);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_float_literal(float f); rasqal_literal* rasqal_new_float_literal(rasqal_world* world, float f);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_uri_literal(raptor_uri* uri); rasqal_literal* rasqal_new_uri_literal(rasqal_world* world, raptor_uri* uri );
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_pattern_literal(const unsigned char *pattern, co nst char *flags); rasqal_literal* rasqal_new_pattern_literal(rasqal_world* world, const unsig ned char *pattern, const char *flags);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_string_literal(const unsigned char *string, cons t char *language, raptor_uri *datatype, const unsigned char *datatype_qname ); rasqal_literal* rasqal_new_string_literal(rasqal_world* world, const unsign ed char *string, const char *language, raptor_uri *datatype, const unsigned char *datatype_qname);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_simple_literal(rasqal_literal_type type, const u nsigned char *string); rasqal_literal* rasqal_new_simple_literal(rasqal_world* world, rasqal_liter al_type type, const unsigned char *string);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_boolean_literal(int value); rasqal_literal* rasqal_new_boolean_literal(rasqal_world* world, int value);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_variable_literal(rasqal_variable *variable); rasqal_literal* rasqal_new_variable_literal(rasqal_world* world, rasqal_var iable *variable);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_decimal_literal(const unsigned char *string); rasqal_literal* rasqal_new_decimal_literal(rasqal_world* world, const unsig ned char *string);
RASQAL_API RASQAL_API
rasqal_literal* rasqal_new_decimal_literal_from_decimal(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
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
skipping to change at line 1001 skipping to change at line 1011
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_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_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_API
void rasqal_free_variable(rasqal_variable* v); void rasqal_free_variable(rasqal_variable* v);
RASQAL_API RASQAL_API
void rasqal_variable_print(rasqal_variable* v, FILE* fh); void 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);
/* memory functions */ /* memory functions */
RASQAL_API RASQAL_API
void rasqal_free_memory(void *ptr); void rasqal_free_memory(void *ptr);
RASQAL_API RASQAL_API
skipping to change at line 1082 skipping to change at line 1094
RASQAL_TRIPLE_SPOG = RASQAL_TRIPLE_SPO | RASQAL_TRIPLE_GRAPH RASQAL_TRIPLE_SPOG = RASQAL_TRIPLE_SPO | RASQAL_TRIPLE_GRAPH
} rasqal_triple_parts; } rasqal_triple_parts;
/** /**
* rasqal_triples_match: * rasqal_triples_match:
* @user_data: User data pointer for factory methods. * @user_data: User data pointer for factory methods.
* @bind_match: The [4]array (s,p,o,origin) bindings against the current tr iple match only touching triple parts given. Returns parts that were bound or 0 on failure. * @bind_match: The [4]array (s,p,o,origin) bindings against the current tr iple match only touching triple parts given. Returns parts that were bound or 0 on failure.
* @next_match: Move to next match. * @next_match: Move to next match.
* @is_end: Check for end of triple match - return non-0 if is end. * @is_end: Check for end of triple match - return non-0 if is end.
* @finish: Finish triples match and destroy any allocated memory. * @finish: Finish triples match and destroy any allocated memory.
* @world: rasqal_world object
* *
* Triples match structure as initialised by #rasqal_triples_source * Triples match structure as initialised by #rasqal_triples_source
* method init_triples_match. * method init_triples_match.
*/ */
struct rasqal_triples_match_s { struct rasqal_triples_match_s {
void *user_data; void *user_data;
rasqal_triple_parts (*bind_match)(struct rasqal_triples_match_s*, void *u ser_data, rasqal_variable *bindings[4], rasqal_triple_parts parts); rasqal_triple_parts (*bind_match)(struct rasqal_triples_match_s* rtm, voi d *user_data, rasqal_variable *bindings[4], rasqal_triple_parts parts);
void (*next_match)(struct rasqal_triples_match_s*, void *user_data); void (*next_match)(struct rasqal_triples_match_s* rtm, void *user_data);
int (*is_end)(struct rasqal_triples_match_s*, void *user_data); int (*is_end)(struct rasqal_triples_match_s* rtm, void *user_data);
void (*finish)(struct rasqal_triples_match_s*, void *user_data); void (*finish)(struct rasqal_triples_match_s* rtm, void *user_data);
rasqal_world *world;
}; };
typedef struct rasqal_triples_match_s rasqal_triples_match; typedef struct rasqal_triples_match_s rasqal_triples_match;
/** /**
* rasqal_triple_meta: * rasqal_triple_meta:
* @bindings: Variable bindings for this triple+origin to set. * @bindings: Variable bindings for this triple+origin to set.
* @triples_match: The matcher that is setting these bindings. * @triples_match: The matcher that is setting these bindings.
* @context: Context data used by the matcher. * @context: Context data used by the matcher.
* @parts: Parts of the triple to match/bindings to set. * @parts: Parts of the triple to match/bindings to set.
* @is_exact: non-0 if all parts of the triple are given * @is_exact: non-0 if all parts of the triple are given
* @executed: non-0 if the triple pattern has been fully executed
* *
* Triple matching metadata for one triple pattern. * Triple matching metadata for one triple pattern.
*/ */
typedef struct typedef struct {
{
/* 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;
rasqal_triple_parts parts; rasqal_triple_parts parts;
/* non-0 if the associated triple pattern contains no variables */ /* non-0 if the associated triple pattern contains no variables */
skipping to change at line 1168 skipping to change at line 1183
*/ */
typedef struct { typedef struct {
void *user_data; void *user_data;
size_t user_data_size; size_t user_data_size;
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);
} rasqal_triples_source_factory; } rasqal_triples_source_factory;
/* set the triples_source_factory */ /* set the triples_source_factory */
RASQAL_API RASQAL_API
void rasqal_set_triples_source_factory(void (*register_fn)(rasqal_triples_s ource_factory *factory), void* user_data); void rasqal_set_triples_source_factory(rasqal_world* world, void (*register _fn)(rasqal_triples_source_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_QUERY_RESULTS_FORMATTER_DECLARED:
*
* Internal
*/
/**
* RASQAL_WORLD_DECLARED:
*
* Internal
*/
/**
* 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
* *
* Internal - see #rasqal_expression. * Internal - see #rasqal_expression.
* *
*/ */
/** /**
* rasqal_literal_s: * bind_match:
* @usage: Internal * @rtm: triples match context
* @type: Internal * @user_data: user data
* @string: Internal * @bindings: variable binding for parts of triple (s, p, o, g)
* @string_len: Internal * @parts: parts of triple to match
* *
* Internal - see #rasqal_literal. * Internal - see #rasqal_triples_match
* *
* Return value: match parts
*/
/**
* next_match:
* @rtm: triples match context
* @user_data: user data
*
* Internal - see #rasqal_triples_match
*/ */
/** /**
* rasqal_triples_match_s: * is_end:
* @user_data: Internal * @rtm: triples match context
* @bind_match: Internal * @user_data: user data
* @next_match: Internal
* @is_end: Internal
* @finish: Internal
* *
* Internal - see #rasqal_triples_match. * Internal - see #rasqal_triples_match
* *
* Return value: non-0 if end of match
*/ */
/** /**
* rasqal_triples_source_s: * finish:
* @query: Internal * @rtm: triples match context
* @user_data: Internal * @user_data: user data
* @init_triples_match: Internal
* @triple_present: Internal
* @free_triples_source: Internal
* *
* Internal - see #rasqal_triples_source. * Internal - see #rasqal_triples_match
*/
/**
* init_triples_match:
* @rtm: triples match context
* @rts: triples match source
* @user_data: user data
* @m: triple meta
* @t: triple
*
* Internal - see #rasqal_triples_source
* *
* Return value: non-0 on failure
*/ */
/** /**
* rasqal_variable_s: * triple_present:
* @rts: triples match source
* @user_data: user data
* @t: triple to test for presence
* *
* Internal. * Internal - see #rasqal_triples_source
* *
* Return value: non-0 on failure
*/
/**
* free_triples_source:
* @user_data: user data
*
* Internal - see #rasqal_triples_source
*/ */
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif #endif
 End of changes. 60 change blocks. 
89 lines changed or deleted 144 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/