1librasqal(3)               Library Functions Manual               librasqal(3)
2
3
4

NAME

6       librasqal - Rasqal RDF query library
7

SYNOPSIS

9       #include <rasqal.h>
10
11       rasqal_world*world=rasqal_new_world();
12       rasqal_query_results *results;
13       raptor_uri *base_uri=raptor_new_uri("http://example.org/foo");
14       rasqal_query *rq=rasqal_new_query(world,"rdql",NULL);
15       const char *query_string="select * from <http://example.org/data.rdf>";
16
17       rasqal_query_prepare(rq,query_string,base_uri);
18       results=rasqal_query_execute(rq);
19       while(!rasqal_query_results_finished(results)) {
20        for(i=0;i<rasqal_query_results_get_bindings_count(results);i++) {
21         const char *name=rasqal_query_results_get_binding_name(results,i);
22         rasqal_literal *value=rasqal_query_results_get_binding_value(results,i);
23         /* ... */
24        }
25        rasqal_query_results_next(results);
26       }
27       rasqal_free_query_results(results);
28       rasqal_free_query(rq);
29       raptor_free_uri(base_uri);
30       rasqal_free_world(world);
31
32       cc `rasqal-config --cflags` file.c `rasqal-config --libs`
33

DESCRIPTION

35       The  Rasqal  library provides a high-level interface to RDF query pars‐
36       ing, query construction, query execution over an RDF  graph  and  query
37       results manipulation and formatting.  The library provides APIs to each
38       of the steps in the process and provides support for handling  multiple
39       query  language syntaxes.  At present Rasqal partially supports the W3C
40       draft SPARQL query language and fully supports RDQL.
41
42       Rasqal uses the libraptor(3) library for providing  URI  handling,  WWW
43       content retrieval and other support functions.
44

LIBRARY INITIALISATION AND CLEANUP

46       rasqal_world *rasqal_new_world(void)
47              Create  the rasqal world object.  This must be called before use
48              of any rasqal library functions.
49
50       void rasqal_free_world(rasqal_world* world)
51              Destroy the rasqal world object and cleanup the  library.   This
52              must be called after destroying all rasqal objects.
53

LIBRARY FUNCTIONS

55       These  functions provide general library features not associated to any
56       particular class.
57
58       int rasqal_languages_enumerate(raptor_world* world, const unsigned  int
59       counter,  const  char  **name,  const char **label, const unsigned char
60       **uri_string)
61              Return the name, label, uri_string (all optional)  for  a  query
62              language  with a given integer counter, returning non-zero if no
63              such query language at that offset exists.  The  counter  should
64              start  from 0 and be incremented by 1 until the function returns
65              non-zero.
66
67       int rasqal_language_name_check(raptor_world* world, const char *name)
68              Check name is a known query language name.
69
70       int rasqal_query_set_feature(rasqal_query* query,  rasqal_feature  fea‐
71       ture, int value)
72              Set  a  query  feature  feature  to  a particular integer value.
73              Returns non 0 on failure or if the feature is unknown.  The cur‐
74              rent defined parser features are:
75                Feature                                 Values
76                RASQAL_FEATURE_NO_NET                   Boolean (non 0 true)
77
78       If the no_net feature is true (default false) then network requests are
79       denied.
80
81       int rasqal_query_set_feature_string(rasqal_query* query, rasqal_feature
82       feature, const unsigned char* value)
83              Set  a  query  feature  feature  to  a  particular string value.
84              Returns non 0 on failure or if the feature is unknown.  The cur‐
85              rent  defined  query features are given in rasqal_query_set_fea‐
86              ture and at present only take  integer  values.  If  an  integer
87              value feature is set with this function, value is interpreted as
88              an integer and then that value is used.
89
90       int rasqal_query_get_feature(rasqal_query* query,  rasqal_feature  fea‐
91       ture)
92              Get  a  query feature integer value.  The allowed feature values
93              and types are given under rasqal_features_enumerate.
94
95       const  unsigned   char*   rasqal_query_get_feature_string(rasqal_query*
96       query, rasqal_feature feature)
97              Get a query feature string value. The allowed feature values and
98              types are given under rasqal_features_enumerate.
99
100       int  rasqal_features_enumerate(const  rasqal_feature   feature,   const
101       char** name, raptor_uri** uri, const char** label)
102              Return  the  name,  URI, string label (all optional) for a query
103              feature, returning non-zero if no such feature exists.
104
105       unsigned int rasqal_get_feature_count(void)
106              Get the count of rasqal features defined which can be found with
107              rasqal_features_enumerate.
108
109       Rasqal features have URIs that are constructed from the URI http://fea
110       ture.librdf.org/rasqal- and the name so for example feature  noNet  has
111       URI http://feature.librdf.org/rasqal-noNet
112
113       rasqal_feature rasqal_feature_from_uri(raptor_uri* uri)
114              Turn  a  URI  uri into a rasqal feature identifier, or <0 if the
115              feature   is   unknown.    The   URIs   are   described    below
116              rasqal_query_set_feature.
117
118       int rasqal_feature_value_type(const rasqal_feature feature)
119              Get a rasqal feature value tyype - integer or string.
120

QUERY CONSTRUCTOR

122       rasqal_query*  rasqal_new_query(raptor_world*  world, const char *name,
123       const unsigned char *uri)
124              Create a new rasqal query object for the query syntax with  name
125              name.   Currently  "rdql"  for  the  RDF Data Query Language and
126              "sparql" for the SPARQL query language are recognised.   A  lan‐
127              guage may alternatively be identified by a URI uri.  If name and
128              uri are both NULL the default query language is  selected,  cur‐
129              rently "sparql".
130

QUERY DESTRUCTOR

132       void rasqal_free_query(rasqal_query* query)
133              Destroy a rasqal query object.
134

QUERY METHODS

136       const char* rasqal_query_get_name(rasqal_query* query)
137              Get the query language name.
138
139       const char* rasqal_query_get_label(rasqal_query* query)
140              Get the query language human readable label.
141
142       void   rasqal_query_set_fatal_error_handler(rasqal_query*  query,  void
143       *user_data, raptor_message_handler handler)
144              Set the fatal error handler callback.
145
146       void    rasqal_query_set_error_handler(rasqal_query*    query,     void
147       *user_data, raptor_message_handler handler)
148              Set the error handler callback.
149
150       void    rasqal_query_set_warning_handler(rasqal_query*    query,   void
151       *user_data, raptor_message_handler handler)
152              Set the warning handler callback.
153
154       int rasqal_query_get_distinct(rasqal_query* query)
155              Get   the   query   distinct   mode   flag   as   described   in
156              rasqal_query_set_distinct()
157
158       void rasqal_query_set_distinct(rasqal_query* query, int mode)
159              Set  the  query  distinct results mode: 0 (none), 1 (SPARQL DIS‐
160              TINCT) or 2 (SPARQL REDUCE).
161
162       int rasqal_query_get_limit(rasqal_query* query)
163              Get the query-specified limit on results returning  >=  0  if  a
164              limit is given, otherwise not specified.
165
166       void rasqal_query_set_limit(rasqal_query* query, int limit)
167              Set the query results limit.  No more than limit results will be
168              returned.
169
170       int rasqal_query_get_offset(rasqal_query* query)
171              Get the query-specified offset on results returning >=  0  if  a
172              offset is given, otherwise not specified.
173
174       void rasqal_query_set_offset(rasqal_query* query, int offset)
175              Set  the query results offset.  The first offset results will be
176              not be returned.
177
178       int  rasqal_query_add_variable(rasqal_query*  query,   rasqal_variable*
179       var)
180              Add a variable binding to the sequence of bindings in the query.
181
182       raptor_sequence* rasqal_query_get_bound_variable_sequence(rasqal_query*
183       query)
184              Get the sequence of variables that are returning bindings in the
185              query  such  as  when  explicitly  chosen  via SELECT in RDQL or
186              SPARQL or all variables mentioned with SELECT *.
187
188       raptor_sequence*   rasqal_query_get_all_variable_sequence(rasqal_query*
189       query)
190              Get the sequence of all variables mentioned in the query.
191
192       rasqal_variable*   rasqal_query_get_variable(rasqal_query*  query,  int
193       idx)
194              Get one variable binding in the sequence of variable bindings in
195              the query.
196
197       raptor_sequence*                       rasqal_query_get_anonymous_vari‐
198       able_sequence(rasqal_query* query)
199              Get the raptor_sequence of anonymous variables mentioned in  the
200              query.
201
202       int  rasqal_query_has_variable(rasqal_query* query, const unsigned char
203       *name)
204              Return non-0 if the named variable is in the  variable  bindings
205              of the query.
206
207       int  rasqal_query_set_variable(rasqal_query* query, const unsigned char
208       *name, rasqal_literal* value)
209              Set the query variable name to a  literal  value  (the  variable
210              must already be in the sequence of variable bindings).
211
212       raptor_sequence* rasqal_query_get_triple_sequence(rasqal_query* query)
213              Get the sequence of triples to match in the query.
214
215       rasqal_triple* rasqal_query_get_triple(rasqal_query* query, int idx)
216              Get  one  triple  in  the  sequences  of triples to match in the
217              query.
218
219       int rasqal_query_add_prefix(rasqal_query* query, rasqal_prefix* prefix)
220              Add one namespace prefix/URI to the sequence of prefixes in  the
221              query.
222
223       raptor_sequence* rasqal_query_get_prefix_sequence(rasqal_query* query)
224              Get the sequence of prefixes in the query.
225
226       rasqal_prefix* rasqal_query_get_prefix(rasqal_query* query, int idx)
227              Get one prefix in the sequence of prefixes in the query at index
228              idx.
229
230       raptor_sequence*  rasqal_query_get_graph_pattern_sequence(rasqal_query*
231       query)
232              Get the sequence of graph patterns expressions in the query.
233
234       rasqal_graph_pattern*      rasqal_query_get_graph_pattern(rasqal_query*
235       query, int idx)
236              Get a graph pattern in the sequence of graph_pattern expressions
237              in the query.
238
239       void rasqal_query_print(rasqal_query* query, FILE* stream)
240              Print  a query in a debug format.  This format may change in any
241              release.
242
243       int  rasqal_query_prepare(rasqal_query*  query,  const  unsigned   char
244       *query_string, raptor_uri *base_uri)
245              Prepare  a  query  string  query_stringwith  optional  base  URI
246              uri_string  for  execution,  parsing  it   and   modifying   the
247              rasqal_query internals.  Return non-0 on failure.
248
249       rasqal_query_results* rasqal_query_execute(rasqal_query* query)
250              Execute  a  query,  returning  a rasqal_query_results* object or
251              NULL on failure.
252
253       void rasqal_query_set_user_data(rasqal_query* query, void *user_data)
254              Set some user data to be associated with the query.
255
256       void* rasqal_query_get_user_data(rasqal_query* query)
257              Get the user data associated with the query.
258
259       int rasqal_query_add_data_graph(rasqal_query* query,  raptor_uri*  uri,
260       raptor_uri* name_uri, int flags)
261              Add a data graph to the query's data sources, constructing a new
262              data graph object with URI uri, optional name URI  name_uri  and
263              flags.   See  rasqal_new_data_graph  for  a  description  of the
264              argumetns.
265
266       raptor_sequence*     rasqal_query_get_data_graph_sequence(rasqal_query*
267       query)
268              Get the sequence of data graphs in the query.
269
270       rasqal_data_graph* rasqal_query_get_data_graph(rasqal_query* query, int
271       idx)
272              Get one prefix in the sequence of prefixes in the query at index
273              idx.
274
275       raptor_sequence*                          rasqal_query_get_order_condi‐
276       tions_sequence(rasqal_query* query)
277              Get the sequence of all result ordering conditions in the query,
278              each of which is a rasqal_expression.
279
280       rasqal_expression*       rasqal_query_get_order_condition(rasqal_query*
281       query, int idx)
282              Get one result ordering condition expression in the sequence.
283
284       rasqal_query_verb rasqal_query_get_verb(rasqal_query* query)
285              Get the main query verb.
286
287       int rasqal_query_get_wildcard(rasqal_query* query)
288              Get the query verb wildcard flag signifying * in RDQL and SPARQL
289              after the query verb.
290
291       rasqal_graph_pattern*                 rasqal_query_get_query_graph_pat‐
292       tern(rasqal_query* query)
293              Get the top query graph pattern of query.
294
295       void rasqal_query_set_default_generate_bnodeid_parameters(rasqal_query*
296       rdf_query, char* prefix, int base)
297              Control  the  default  method  for  generation  of IDs for blank
298              nodes.  The method uses a short string  prefix  and  an  integer
299              base  to generate the identifier which is not guaranteed to be a
300              strict concatenation.  If prefix is NULL, the default  is  used.
301              If base is less than 1, it is initialised to 1.
302
303       void   rasqal_query_set_generate_bnodeid_handler(rasqal_query*   query,
304       void* user_data, rasqal_generate_bnodeid_handler handler)
305              Allow full customisation of the generated IDs by setting a call‐
306              back  handler and associated user_data that is called whenever a
307              blank node or bag identifier is required.  The  memory  returned
308              is  deallocated  inside rasqal.  Some systems require this to be
309              allocated  inside  the  same  library,   in   which   case   the
310              rasqal_alloc_memory function may be useful.
311
312       rasqal_query_verb_as_string(rasqal_query_verb verb)
313              Get a string for the query verb.
314
315       raptor_sequence*                                  rasqal_query_get_con‐
316       struct_triples_sequence(rasqal_query* query)
317              Get the sequence of triples for a construct.
318
319       rasqal_triple*  rasqal_query_get_construct_triple(rasqal_query*  query,
320       int idx)
321              Get a triple in the sequence of construct triples.
322
323       int rasqal_query_get_explain(rasqal_query* query)
324              Get whether explain was given in the query.
325
326       raptor_sequence*                          rasqal_query_get_group_condi‐
327       tions_sequence(rasqal_query* query)
328              Get the sequence of result group bys in the graph pattern.
329
330       rasqal_expression*       rasqal_query_get_group_condition(rasqal_query*
331       query, int idx)
332              Get one group by expression in the sequences of result group bys
333              in the graph pattern at index idx.
334
335       int  rasqal_query_write(raptor_iostream*  iostr,  rasqal_query*  query,
336       raptor_uri* format_uri, raptor_uri* base_uri)
337              Write  a  formatted  query  to a raptor iostream iostr in format
338              described by URI format_uri using base URI base_uri for relative
339              URIs (or NULL).
340
341       int    rasqal_query_iostream_write_escaped_counted_string(rasqal_query*
342       query, raptor_iostream* iostr, const unsigned char* string, size_t len)
343              Write a string to an iostream in an escaped  form  suitable  for
344              the  query  string.   Uses rasqal_query_escape_counted_string to
345              perform the escaping.
346
347       unsigned char* rasqal_query_escape_counted_string(rasqal_query*  query,
348       const unsigned char *string, size_t len, size_t* output_len_p)
349              Convert a string of length len into an escaped form suitable for
350              the query string.  If output_len is not NULL, it is a pointer to
351              the  location  to  store the output string lenght.  The returned
352              string must be freed by the caller with rasqal_free_memory.
353

GRAPH PATTERN CLASS

355       A class for graph patterns in a query - a set of triple patterns)  with
356       flags and possible sub-graph patterns
357

GRAPH PATTERN CONSTRUCTOR

359       There  is  no public constructor for this class, it is constructed when
360       the  query   is   prepared   from   a   syntax.   The   query   methods
361       rasqal_query_get_graph_pattern_sequence and rasqal_query_get_graph_pat‐
362       tern provide access to the top-level graph patterns in a query.
363
364       rasqal_triple*    rasqal_graph_pattern_get_triple(rasqal_graph_pattern*
365       graph_pattern, int idx)
366              Get  a rasqal_triple inside a graph pattern at index idx return‐
367              ing NULL when the index is out of range.
368
369       int    rasqal_graph_pattern_add_sub_graph_pattern(rasqal_graph_pattern*
370       graph_pattern, rasqal_graph_pattern* sub_graph_pattern)
371              Add  a  sub-graph  pattern  sub_graph_pattern to the sequence of
372              sub-graph patterns inside the graph pattern.
373
374       raptor_sequence*                rasqal_graph_pattern_get_sub_graph_pat‐
375       tern_sequence(rasqal_graph_pattern* graph_pattern)
376              Get  the sequence of sub-graph patterns inside the graph pattern
377              returning NULL if there are no sub-graph patterns.
378
379       rasqal_graph_pattern*           rasqal_graph_pattern_get_sub_graph_pat‐
380       tern(rasqal_graph_pattern* graph_pattern, int idx)
381              Get  a  sub-graph  pattern inside the graph pattern at index idx
382              returning NULL when the index is out of range.
383
384       rasqal_graph_pattern_operator           rasqal_graph_pattern_get_opera‐
385       tor(rasqal_graph_pattern* graph_pattern)
386              Get  the  graph pattern operator to determine how the graph pat‐
387              tern should be interpreted.
388
389       int    rasqal_graph_pattern_add_constraint(rasqal_graph_pattern*    gp,
390       rasqal_expression* expr)
391              Add  a constraint expression expr to the sequence of constraints
392              in the graph pattern.
393
394       raptor_sequence*                          rasqal_graph_pattern_get_con‐
395       straint_sequence(rasqal_graph_pattern* gp)
396              Get the sequence of constraints in the graph pattern.
397
398       rasqal_expression*                        rasqal_graph_pattern_get_con‐
399       straint(rasqal_graph_pattern* gp, int idx)
400              Get one constraint expression in the sequences of constraint  to
401              match in the graph pattern at index idx.
402
403       int rasqal_graph_pattern_get_index(rasqal_graph_pattern* graph_pattern)
404              Get  the graph pattern absolute index in the array of graph pat‐
405              terns.  The index is assigned when rasqal_query_prepareP is  run
406              on the query containing the graph pattern.
407
408       void   rasqal_graph_pattern_print(rasqal_graph_pattern*  graph_pattern,
409       FILE* fh)
410              Print a graph pattern in a debug format.  This format may change
411              in any release.
412
413       const  char*  rasqal_graph_pattern_operator_as_string(rasqal_graph_pat‐
414       tern_operator op)
415              Utility function to get a graph pattern operator as a string.
416
417       int   rasqal_graph_pattern_visit(rasqal_graph_pattern*   graph_pattern,
418       rasqal_graph_pattern_visit_fn fn, void *user_data)
419              Visit  a user function fn recursively over the graph pattern and
420              it's sub-graph patterns.  The order is the first  graph  pattern
421              at  hand  and then the arguments, if any.  function fn is called
422              at each point with the arguments of user_data and the graph pat‐
423              tern.
424

QUERY RESULTS CLASS

426       A  class  for  the results of a query.  The results can be in different
427       formats - variable bindings, RDF graphs as a sequence of triples  or  a
428       boolean  result.   The format returned is determined by the query which
429       is query-language specific.
430

QUERY RESULTS CONSTRUCTOR

432       There   is   no   public    constructor    for    this    class,    the
433       rasqal_query_results* is returned from rasqal_query_execute.
434

QUERY RESULTS DESTRUCTOR

436       rasqal_free_query_results(rasqal_query_results *query_results)
437              Destroy a rasqal query results object.
438

QUERY RESULTS METHODS

440       int              rasqal_query_results_is_bindings(rasqal_query_results*
441       query_results)
442
443       int               rasqal_query_results_is_boolean(rasqal_query_results*
444       query_results)
445
446       int rasqal_query_results_is_graph(rasqal_query_results* query_results)
447
448       int                rasqal_query_results_is_syntax(rasqal_query_results*
449       query_results);
450              Return non-0 if the rasqal_query_results is of the given format.
451              Only one of these will be non-0 for any result.
452
453       int          rasqal_query_results_read(raptor_iostream*          iostr,
454       rasqal_query_results*  results,  raptor_uri*  format_uri,   raptor_uri*
455       base_uri)
456              Read  a  query results in a syntax from the read iostr iostream,
457              the format of the syntax is given by the format_uri URI, with an
458              optional base URI base_uri that may be used.  The values of for‐
459              mat_uri supported are provided by at  runtime  by  the  function
460              rasqal_query_results_formats_enumerate().     This    uses   the
461              librdf_query_results_formatter class internally.
462
463       int         rasqal_query_results_write(raptor_iostream          *iostr,
464       rasqal_query_results   *results,   raptor_uri  *format_uri,  raptor_uri
465       *base_uri)
466              Write the query results in a syntax to the write iostr iostream,
467              the format of the syntax is given by the format_uri URI, with an
468              optional base URI base_uri that may be used.  The values of for‐
469              mat_uri  supported  are  provided  by at runtime by the function
470              rasqal_query_results_formats_enumerate().    This    uses    the
471              librdf_query_results_formatter class internally.
472

QUERY VARIABLE BINDINGS RESULTS METHODS

474       int rasqal_query_results_get_count(rasqal_query_results *query_result)
475              Get  the  current  number of variable bindings results returned.
476              (Variable bindings results only)
477
478       int rasqal_query_results_next(rasqal_query_results *query_results)
479              Move to the next variable bindings result,  returning  non-0  on
480              failure  or  results  are  exhausted. (Variable bindings results
481              only)
482
483       int rasqal_query_results_finished(rasqal_query_results *query_results)
484              Find out if the variable binding results are  exhausted,  return
485              non-0  if  results  are  finished or the query failed. (Variable
486              bindings results only)
487
488       int              rasqal_query_results_get_bindings(rasqal_query_results
489       *query_results, const unsigned char ***names, rasqal_literal ***values)
490              Get  all  variable  binding  names  and  values  for the current
491              result.  If names is not NULL, it is set to  the  address  of  a
492              shared array of names of the bindings (an output parameter).  If
493              values is not NULL, it is set to the address of a  shared  array
494              of  rasqal_literal* binding values.  Note that both the names or
495              values are shared and must not be freed by the caller.   Returns
496              non-0 if the assignment failed. (Variable bindings results only)
497
498       rasqal_literal*                          rasqal_query_results_get_bind‐
499       ing_value(rasqal_query_results *query_results, int offset)
500              Get one variable binding literal value for the  current  result.
501              Returns  the  value  of  the variable indexed in the sequence of
502              variable bindings at position offset. (Variable bindings results
503              only)
504
505       const        unsigned        char*       rasqal_query_results_get_bind‐
506       ing_name(rasqal_query_results *query_results, int offset)
507              Get the name of the variable indexed in the sequence of variable
508              bindings at position offset. (Variable bindings results only)
509
510       rasqal_literal*                          rasqal_query_results_get_bind‐
511       ing_value_by_name(rasqal_query_results *query_results,  const  unsigned
512       char *name)
513              Get  the value of the variable in the sequence of variable bind‐
514              ings named name or NULL if not known or unbound. (Variable bind‐
515              ings results only)
516
517       int        rasqal_query_results_get_bindings_count(rasqal_query_results
518       *query_results)
519              Get the number of  bound  variables  in  the  variable  bindings
520              result or <0 on failure. (Variable bindings results only)
521

QUERY BOOLEAN RESULTS METHODS

523       int               rasqal_query_results_get_boolean(rasqal_query_results
524       *query_results)
525              Return the value of a boolean query result.  This is meaningless
526              if  the  query  result  is not a boolean. (Boolean result format
527              only).
528

QUERY RDF GRAPH RESULTS METHODS

530       raptor_statement*  rasqal_query_results_get_triple(rasqal_query_results
531       *query_results)
532              Return  the  current  triple in the RDF graph results or NULL at
533              end of results or on failure.  The returned raptor_statement  is
534              a shared pointer.  (Graph results format only).
535
536       int               rasqal_query_results_next_triple(rasqal_query_results
537       *query_results)
538              Move to the next triple in  the  RDF  graph  results,  returning
539              non-0  at  end  of  results or on failure. (Graph results format
540              only).
541

QUERY RESULTS FORMATTER CLASS

543       A class for formatting the results of a query into a syntax.
544

QUERY RESULTS FORMATTER CONSTRUCTOR

546       rasqal_query_results_formatter* rasqal_new_query_results_formatter(rap‐
547       tor_world* world, const char *name, raptor_uri* uri)
548              Create  a  new query results formatter for the name or uri.  The
549              rasqal_query_results_formats_enumerate()  function  returns  the
550              allowed  names  and/or uris.  If name and uri are both NULL, the
551              default query results format is used.
552
553       rasqal_query_results_formatter*        rasqal_new_query_results_format‐
554       ter_by_mime_type(raptor_world* world, const char *mime_type)
555              Create  a  new query results formatter for the output mime_type.
556              The    rasqal_query_results_formats_enumerate_full()    function
557              returns    the    allowed    names,   uris   and   mime   types.
558              rasqal_query_results_formatter_get_mime_type()  can  return  the
559              mime type of a constructed object.
560

QUERY RESULTS FORMATTER DESTRUCTOR

562       void   rasqal_free_query_results_formatter(rasqal_query_results_format‐
563       ter* formatter)
564              Destroy a rasqal query results formatter object.
565

QUERY RESULTS FORMATTER METHODS

567       int   rasqal_query_results_formatter_read(rasqal_world*   world,   rap‐
568       tor_iostream*    iostr,    rasqal_query_results_formatter*   formatter,
569       rasqal_query_results* results, raptor_uri* base_uri)
570              Read query results formatted in a syntax  from  the  read  iostr
571              iostream with an optional base URI base_uri into results object.
572
573       int     rasqal_query_results_formatter_write(raptor_iostream*    iostr,
574       rasqal_query_results_formatter*    formatter,     rasqal_query_results*
575       results, raptor_uri* base_uri)
576              Write  the  query  results  formatted  in  a syntax to the iostr
577              iostream an optional base URI base_uri.
578
579       const                char*                 rasqal_query_results_format‐
580       ter_get_mime_type(rasqal_query_results_formatter* formatter)
581              Get the mime type of the selected formatter.
582

QUERY RESULTS FORMATTER STATIC METHODS

584       int  rasqal_query_results_formats_enumerate(const unsigned int counter,
585       const  char  **name,  const   char   **label,   const   unsigned   char
586       **uri_string, const char **mime_type, int flags)
587              Get query results formats information by counter..  When counter
588              is 0, this returns the default query results format.  The  name,
589              label,  uri_string  and/or mime_type may be returned if they are
590              not  NULL.   Flags  may  be   either   RASQAL_QUERY_RESULTS_FOR‐
591              MAT_FLAG_READER  or  RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER  to
592              return formats that can be read or written respectively.
593
594       int rasqal_query_results_formats_check(raptor_world* world, const  char
595       *name, raptor_uri* uri, const char *mime_type)
596              Check  if  a query results formatter with the given name, uri or
597              mime_type  exists,  as  would  be  used  by   the   constructors
598              rasqal_new_query_results_formatter()                          or
599              rasqal_new_query_results_formatter_by_mime_type() if called.
600

LITERAL CLASS

602       A class for the values returned as parts of  triples  and  in  variable
603       bindings.  The  rasqal_literal  structure  is  public  and  defined  in
604       rasqal.h however note that some fields are used for  different  literal
605       types  in  different  ways.   The  types of literals are defined in the
606       rasqal_literal_type enum.
607

LITERAL CONSTRUCTORS

609       There a several constructors for rasqal_literal to build them from sim‐
610       ple  types  and  existing rasqal_literal objects.  NOTE: Any objects or
611       strings passed into these constructors becomed  owned  by  the  literal
612       object except where noted.
613
614       rasqal_literal*  rasqal_new_decimal_literal(raptor_world*  world, const
615       unsigned char* decimal)
616              Create a new decimal literal from string decimal.
617
618       rasqal_literal* rasqal_new_double_literal(raptor_world*  world,  double
619       d)
620              Create a new double literal from a d.
621
622       rasqal_literal*     rasqal_new_integer_literal(raptor_world*     world,
623       rasqal_literal_type type, int integer)
624              Create a new integer literal of an integral  type,  either  type
625              RASQAL_LITERAL_INTEGER or RASQAL_LITERAL_BOOLEAN.
626
627       rasqal_literal* rasqal_new_uri_literal(raptor_world* world, raptor_uri*
628       uri)
629              Create a new URI literal from a raptor_uri uri.
630
631       rasqal_literal* rasqal_new_pattern_literal(raptor_world*  world,  const
632       unsigned char *pattern, const char *flags)
633              Create  a  new regular expression literal from regex pattern and
634              flags.
635
636       rasqal_literal*  rasqal_new_string_literal(raptor_world*  world,  const
637       unsigned  char  *string,  const  char  *language, raptor_uri *datatype,
638       const unsigned char *datatype_qname)
639              Create  a  new  Rasqal  string  literal.    The   datatype   and
640              datatype_qname  parameters  are  alternatives;  the  QName  is a
641              datatype that cannot be resolved till later since  the  prefixes
642              have not yet been declared or checked at the time this construc‐
643              tor is called.
644
645              If the string literal is datatyped and of certain  types  recog‐
646              nised  (currently  xsd:decimal, xsd:double) it may be internally
647              converted to a different literal type.
648
649       rasqal_literal*     rasqal_new_simple_literal(raptor_world*      world,
650       rasqal_literal_type type, const unsigned char *string)
651              Create  a new Rasqal simple literal of type RASQAL_LITERAL_BLANK
652              or RASQAL_LITERAL_BLANK_QNAME.
653
654       rasqal_literal*  rasqal_new_boolean_literal(raptor_world*  world,   int
655       value)
656              Create  a  new  Raqal  boolean literal, where value is non-0 for
657              true, 0 for false.
658
659       rasqal_literal*    rasqal_new_variable_literal(raptor_world*     world,
660       rasqal_variable* variable)
661              Create  a new Rasqal variable literal using an existing variable
662              object.
663
664       rasqal_literal*   rasqal_new_decimal_literal_from_decimal(raptor_world*
665       world, const unsigned char *string, rasqal_xsd_decimal* decimal)
666              Create  a new Rasqal decimal literal using an existing string or
667              decimal object.
668
669       rasqal_literal* rasqal_new_float_literal(raptor_world* world, float f)
670              Create a new Rasqal float literal using an existing foat f
671
672       rasqal_literal*      rasqal_new_typed_literal(raptor_world*      world,
673       rasqal_literal_type type, const unsigned char* string)
674              Create  a  new  Rasqal  RDF  typed literal of the given type and
675              string form.
676

LITERAL COPY CONSTRUCTOR

678       rasqal_literal*  rasqal_new_literal_from_literal(rasqal_literal*   lit‐
679       eral)
680              Copy an existing literal object.
681

LITERAL DESTRUCTOR

683       void rasqal_free_literal(rasqal_uri* literal)
684              Destroy a rasqal literal object.
685

LITERAL METHODS

687       void rasqal_literal_print(rasqal_literal* literal, FILE* fh)
688              Print  a  literal  in a debug format.  This format may change in
689              any release.
690
691       rasqal_variable* rasqal_literal_as_variable(rasqal_literal* literal)
692              Return a rasqal literal as a variable, if it is  one,  otherwise
693              return NULL.
694
695       const unsigned char* rasqal_literal_as_string(rasqal_literal* literal)
696              Return  a  rasqal  literal  as a string value.  This always suc‐
697              ceeds.
698
699       const  unsigned  char*   rasqal_literal_as_string_flags(rasqal_literal*
700       literal, int flags, int* error)
701              Return  a  rasqal  literal as a string value according to flags.
702              The  only  defined  string  value  at  present  is   RASQAL_COM‐
703              PARE_XQUERY  to  use  XQuery  conversion rules.  If error is not
704              NULL, it will be set to non-0 if there is an error.
705
706       rasqal_literal* rasqal_literal_as_node(rasqal_literal* literal)
707              Return a new rasqal literal into one suitable for a node  in  an
708              RDF  triple or binding - as a URI, literal string (or datatyped)
709              or blank node.  The returned literal is owned by the caller  and
710              must be freed by rasqal_free_literal.
711
712       int  rasqal_literal_compare(rasqal_literal*  literal1,  rasqal_literal*
713       literal2, rasqal_compare_flags flags, int* error)
714              Compare two literals with type promotion across their range.  If
715              the  types  are  not  the  same, they are promoted.  If one is a
716              floating, the other is promoted to floating, otherwise for inte‐
717              gers, otherwise as strings (all literals have a string value).
718
719              flags  affects string comparisons.  If the RASQAL_COMPARE_NOCASE
720              bit is set, a case independent comparison is made.
721
722              The return value is comparable to strcmp(3), first before second
723              returns <0.  equal returns 0, and first after second returns >0.
724              If there is no ordering, such as for URIs, the return value is 0
725              for equal, non-0 for different (using raptor_uri_equals).
726
727       int   rasqal_literal_equals(rasqal_literal*  literal1,  rasqal_literal*
728       literal2)
729              Compare two literals with no type promotion If literal2's  value
730              is a boolean, it will match
731               the string "true" or "false" in literal1.
732
733       rasqal_literal* rasqal_literal_value(rasqal_literal* literal)
734              Get the value of a literal, looking up any variables.
735
736       raptor_uri* rasqal_literal_datatype(rasqal_literal* literal)
737              Get the datatype URI of a literal
738

TRIPLE CLASS

740       A  class  for triples of three literals, used for matching triples in a
741       query where the literals may be variables as well as in then  interface
742       between Rasqal and RDF systems using RDF triples, when the literals may
743       not be literals.  The structure of this class is public and defined  in
744       rasqal.h
745

TRIPLE CONSTRUCTOR

747       rasqal_triple*  rasqal_new_triple(rasqal_literal*  subject, rasqal_lit‐
748       eral* predicate, rasqal_literal* object)
749              Create a new rasqal triple from three literals.
750

TRIPLE COPY CONSTRUCTOR

752       rasqal_triple* rasqal_new_triple_from_triple(rasqal_triple* triple)
753              Copy an existing rasqal triple object.
754

TRIPLE DESTRUCTOR

756       void rasqal_free_triple(rasqal_triple* triple)
757              Destroy a rasqal triple object.
758

TRIPLE METHODS

760       void rasqal_triple_print(rasqal_triple* triple, FILE* fh)
761              Print a triple in a debug format.  This format may change in any
762              release.
763
764       void   rasqal_triple_set_origin(rasqal_triple*  triple,  rasqal_literal
765       *literal)
766              Set the origin rasqal_literal of the  triple,  typically  a  URI
767              literal.
768
769       rasqal_literal* rasqal_triple_get_origin(rasqal_triple* triple)
770              Get the origin rasqal_literal of the triple.
771

VARIABLE CLASS

773       A  class  for variable name and literal used to capture a variable with
774       optional value binding such as returned as  query  results  by  various
775       methods.  The structure of this class is public and defined in rasqal.h
776

VARIABLE CONSTRUCTOR

778       rasqal_variable*    rasqal_new_variable(rasqal_query*    query,   const
779       unsigned char *name, rasqal_literal* value)
780              Create a new rasqal variable scoped  to  a  Rasqal  query,  with
781              required name and optional rasqal_literal value.  This creates a
782              variable of type RASQAL_VARIABLE_TYPE_NORMAL.
783
784       rasqal_variable*      rasqal_new_variable_typed(rasqal_query*       rq,
785       rasqal_variable_type  type,  const unsigned char *name, rasqal_literal*
786       value)
787              Create a new rasqal variable scoped  to  a  Rasqal  query,  with
788              required  name,  optional  rasqal_literal  value  and  type type
789              either     RASQAL_VARIABLE_TYPE_NORMAL      or      RASQAL_VARI‐
790              ABLE_TYPE_ANONYMOUS
791

VARIABLE COPY CONSTRUCTOR

793       rasqal_variable*     rasqal_new_variable_from_variable(rasqal_variable*
794       variable)
795              Create a new rasqal variable object from an existing variable.
796

VARIABLE DESTRUCTOR

798       void rasqal_free_variable(rasqal_variable* variable)
799              Destroy a rasqal variable object.
800

VARIABLE METHODS

802       void rasqal_variable_print(rasqal_variable* variable, FILE* fh)
803              Print a variable in a debug format.  This format may  change  in
804              any release.
805
806       void  rasqal_variable_set_value(rasqal_variable*  variable, rasqal_lit‐
807       eral* literal)
808              Set the value of a rasqal variable to an  rasqal_literal  value,
809              freeing any current value.  The new literal may be NULL.
810

PREFIX CLASS

812       A  class for namespace name/URI prefix association used to shorten URIs
813       in some query languages using XML-style QNames.  The structure of  this
814       class is public and defined in rasqal.h
815

PREFIX CONSTRUCTOR

817       rasqal_prefix*  rasqal_new_prefix(const  unsigned  char*  prefix,  rap‐
818       tor_uri* uri)
819              Create a new namespace prefix with the given  short  prefix  and
820              URI uri.
821

PREFIX DESTRUCTOR

823       void rasqal_free_prefix(rasqal_prefix* prefix)
824              Destroy a rasqal prefix object.
825
826       void rasqal_prefix_print(rasqal_prefix* prefix, FILE* fh)
827              Print a prefix in a debug format.  This format may change in any
828              release.
829

EXPRESSION CLASS

831       A class for constraint expressions over literals  and  variables.   The
832       expression operators are defined in rasqal.h as enum rasqal_op and take
833       one, two or more complex parameters.
834

EXPRESSION CONSTRUCTORS

836       rasqal_expression* rasqal_new_0op_expression(rasqal_op op)
837              Create a new expression with a 0-argument operator.
838
839       rasqal_expression*       rasqal_new_1op_expression(rasqal_op        op,
840       rasqal_expression* arg)
841              Create a new expression with a 1-argument operator.
842
843       rasqal_expression*        rasqal_new_2op_expression(rasqal_op       op,
844       rasqal_expression* arg1, rasqal_expression* arg2)
845              Create a new expression with a 2-argument operator.
846
847       rasqal_expression*       rasqal_new_2op_expression(rasqal_op        op,
848       rasqal_expression*  arg1,  rasqal_expression*  arg2, rasqal_expression*
849       arg3)
850              Create a new expression with a 3-argument operator.
851
852       rasqal_expression*    rasqal_new_string_op_expression(rasqal_op     op,
853       rasqal_expression* arg1, rasqal_literal* literal)
854              Create  a  new expression with a 2-argument operator, the second
855              of which is a literal string.
856
857       rasqal_expression*  rasqal_new_literal_expression(rasqal_literal*  lit‐
858       eral)
859              Create a new expression over an existing rasqal literal.
860
861       rasqal_expression*      rasqal_new_variable_expression(rasqal_variable*
862       variable)
863              Create a new expression over an existing rasqal variable.
864
865       rasqal_expression*   rasqal_new_function_expression(raptor_uri*   name,
866       raptor_sequence* args)
867              Create  a  new  expression  for  a  function named name and with
868              sequence of rasqal_literal* arguments args.
869
870       rasqal_expression*     rasqal_new_cast_expression(raptor_uri*     name,
871       rasqal_expression* value)
872              Create  a  new  expression  for a casting of value to a datatype
873              with URI name.
874

EXPRESSION COPY CONSTRUCTOR

876       rasqal_expression* rasqal_new_expression_from_expression(rasqal_expres‐
877       sion* expression)
878              Copy an existing rasqal expression object.
879

EXPRESSION DESTRUCTOR

881       void rasqal_free_expression(rasqal_expression* expression)
882              Destroy a rasqal expression object.
883

EXPRESSION METHODS

885       void  rasqal_expression_print_op(rasqal_expression*  expression,  FILE*
886       fh)
887              Print an expression operator in a debug format.  This format may
888              change in any release.
889
890       void rasqal_expression_print(rasqal_expression* expression, FILE* fh)
891              Print  an  expression in a debug format.  This format may change
892              in any release.
893
894       rasqal_literal*     rasqal_expression_evaluate(rasqal_query*     query,
895       rasqal_expression* expression, rasqal_compare_flags flags)
896              Evalute  an  expression,  returning  a  rasqal  boolean with the
897              result or NULL on failure.  If flags  are  RASQAL_COMPARE_XQUERY
898              then XQuery comparison and type promotions are used.
899
900       int        rasqal_expression_visit(rasqal_expression*       expression,
901       rasqal_expression_visit_fn fn, void *user_data)
902              Visit a user function fn recursively  over  the  expression  and
903              it's sub-expressions.  The order is the first expression at hand
904              and then the arguments, if any.  function fn is called  at  each
905              point with the arguments of user_data and the expression.
906

DATA GRAPH CLASS

908       A  class for graph data sources to query over from a source URI with an
909       optional name URI.
910

DATA GRAPH CONSTRUCTOR

912       rasqal_data_graph* rasqal_new_data_graph(raptor_uri*  uri,  raptor_uri*
913       name_uri, int flags)
914              Create  a  new  data graph with source URI uri and optional name
915              URI   name_uri.    Flags    can    be    RASQAL_DATA_GRAPH_NONE,
916              RASQAL_DATA_GRAPH_NAMED or RASQAL_DATA_GRAPH_BACKGROUND.
917

DATA GRAPH DESTRUCTOR

919       void rasqal_free_data_graph(rasqal_data_graph* dg)
920              Destroy a rasqal data_graph object.
921
922       void rasqal_data_graph_print(rasqal_data_graph* dg, FILE* fh)
923              Print a data graph in a debug format.  This format may change in
924              any release.
925

DECIMAL CLASS

927       A class for accurate decimal arithmetic to handle XSD decimals.
928

DECIMAL CONSTRUCTOR

930       rasqal_xsd_decimal* rasqal_new_xsd_decimal(void)
931              Create a new decimal object.
932

DECIMAL DESTRUCTOR

934       void rasqal_free_xsd_decimal(rasqal_xsd_decimal* dec)
935              Destroy a rasqal decimal object.
936

DECIMAL METHODS

938       int rasqal_xsd_decimal_set_string(rasqal_xsd_decimal* dec, const  char*
939       string)
940              Set the decimal value from a string.
941
942       double rasqal_xsd_decimal_get_double(rasqal_xsd_decimal* dec)
943              Get the decimal value as a double - this may lose precision.
944
945       char* rasqal_xsd_decimal_as_string(rasqal_xsd_decimal* dec)
946              Get  the decimal as a string.  The returned string is shared and
947              must be copied by the caller.
948
949       char*   rasqal_xsd_decimal_as_counted_string(rasqal_xsd_decimal*   dec,
950       size_t* len_p)
951              Get the decimal as a string plus optional length stored in len_p
952              if it is not NULL .  The returned string is shared and  must  be
953              copied by the caller.
954
955       int rasqal_xsd_decimal_set_long(rasqal_xsd_decimal* dec, long l)
956              Set the decimal value from a long.
957
958       int rasqal_xsd_decimal_set_double(rasqal_xsd_decimal* dec, double d)
959              Set the decimal value from a double.
960
961       int rasqal_xsd_decimal_print(rasqal_xsd_decimal* dec, FILE* stream)
962              Print the decimal to a FILE* stream.
963
964       int rasqal_xsd_decimal_add(rasqal_xsd_decimal* result, rasqal_xsd_deci‐
965       mal* a, rasqal_xsd_decimal* b)
966              Perform decimal a + b and store the result in result.
967
968       int       rasqal_xsd_decimal_subtract(rasqal_xsd_decimal*       result,
969       rasqal_xsd_decimal* a, rasqal_xsd_decimal* b)
970              Perform decimal a - b and store the result in result.
971
972       int       rasqal_xsd_decimal_multiply(rasqal_xsd_decimal*       result,
973       rasqal_xsd_decimal* a, rasqal_xsd_decimal* b)
974              Perform decimal a * b and store the result in result.
975
976       int        rasqal_xsd_decimal_divide(rasqal_xsd_decimal*        result,
977       rasqal_xsd_decimal* a, rasqal_xsd_decimal* b)
978              Perform decimal a / b and store the result in result.
979
980       int        rasqal_xsd_decimal_negate(rasqal_xsd_decimal*        result,
981       rasqal_xsd_decimal* a)
982              Perform decimal - a and store the result in result.
983
984       int rasqal_xsd_decimal_compare(rasqal_xsd_decimal* a,  rasqal_xsd_deci‐
985       mal* b)
986              Compare  decimal a to b and return <0, 0 or >0 if a is < b a = b
987              or a > b in the same fashion as strcmp() does for strings.
988
989       int rasqal_xsd_decimal_equals(rasqal_xsd_decimal*  a,  rasqal_xsd_deci‐
990       mal* b)
991              Return non-0 if decimal a equals b.
992
993       int rasqal_xsd_decimal_is_zero(rasqal_xsd_decimal* d)
994              Return non-0 if decimal a is zero.
995

API CHANGES

997   0.9.16
998       Removed rasqal_init and rasqal_finish.
999
1000       Added  a  new  rasqal_world  object  to  manage library allocations and
1001       classes    with    constructor    rasqal_new_world    and    destructor
1002       rasqal_free_world.
1003
1004       The  following functions now take a librdf_world* world argument as the
1005       first argument: rasqal_language_name_check, rasqal_languages_enumerate,
1006       rasqal_new_query,          rasqal_query_results_formats_check         ,
1007       rasqal_new_query_results_formatter,    rasqal_new_query_results_format‐
1008       ter_by_mime_type, rasqal_new_integer_literal, rasqal_new_typed_literal,
1009       rasqal_new_double_literal,                    rasqal_new_float_literal,
1010       rasqal_new_uri_literal,                     rasqal_new_pattern_literal,
1011       rasqal_new_string_literal, rasqal_new_simple_literal,  rasqal_new_bool‐
1012       ean_literal,  rasqal_new_variable_literal,  rasqal_new_decimal_literal,
1013       rasqal_new_decimal_literal_from_decimal
1014
1015       rasqal_query_add_variable,         rasqal_query_add_prefix          and
1016       rasqal_graph_pattern_add_sub_graph_pattern  now  have int return values
1017       for catchng allocation failure.
1018
1019       Added rasqal_query_results_read
1020
1021       Removed rasqal_query_results_formats_enumerate_full.
1022
1023       rasqal_query_results_formats_enumerate gains a flags argument with val‐
1024       ues              RASQAL_QUERY_RESULTS_FORMAT_FLAG_READER             or
1025       RASQAL_QUERY_RESULTS_FORMAT_FLAG_WRITER
1026
1027       Added rasqal_query_results_formatter_read
1028
1029       Added rasqal_new_variable_from_variable
1030
1031       The rasqal_triples_match struct now has a world field.
1032
1033       Removed deprecated functions and  macros:  rasqal_new_floating_literal,
1034       rasqal_graph_pattern_get_flags and rasqal_expression_foreach functions,
1035       rasqal_expression_foreach_fn typedef and RASQAL_LITERAL_FLOATING macro
1036
1037   0.9.15
1038       Added rasqal_xsd_decimal type and  support  functions  rasqal_new_deci‐
1039       mal_literal_from_decimal, rasqal_new_xsd_decimal, rasqal_free_xsd_deci‐
1040       mal,   rasqal_xsd_decimal_set_string,    rasqal_xsd_decimal_get_double,
1041       rasqal_xsd_decimal_as_string,     rasqal_xsd_decimal_as_counted_string,
1042       rasqal_xsd_decimal_set_long,             rasqal_xsd_decimal_set_double,
1043       rasqal_xsd_decimal_print,    rasqal_xsd_decimal_add,   rasqal_xsd_deci‐
1044       mal_subtract,  rasqal_xsd_decimal_multiply,  rasqal_xsd_decimal_divide,
1045       rasqal_xsd_decimal_negate, rasqal_xsd_decimal_compare, rasqal_xsd_deci‐
1046       mal_equals and rasqal_xsd_decimal_is_zero
1047
1048       Added RASQAL_EXPR_SAMETERM for SPARQL sameTerm
1049
1050       Added rasqal_compare_flags RASQAL_COMPARE_RDF and RASQAL_COMPARE_URI.
1051
1052       Added rasqal_new_typed_literal
1053
1054       Added rasqal_new_float_literal
1055
1056       Added rasqal_literal_datatype
1057
1058       Added rasqal_literal_value
1059
1060       Added  rasqal_tripleparts  RASQAL_TRIPLE_GRAPH,  RASQAL_TRIPLE_SPO  and
1061       RASQAL_TRIPLE_SPOG
1062
1063   0.9.14
1064       Added rasqal_new_0op_expression.
1065
1066       Added        rasqal_new_query_results_formatter_by_mime_type        and
1067       rasqal_query_results_formatter_get_mime_type.
1068
1069       Added rasqal_query_results_formats_check and  rasqal_query_results_for‐
1070       mats_enumerate_full.
1071
1072       Added 0y_results_is_syntax.
1073
1074       Added      query     results     group     by     accessor     methods:
1075       rasqal_query_get_group_conditions_sequence                          and
1076       rasqal_query_get_group_condition for LAQRS.
1077
1078       rasqal_query_set_distinct now takes a mode argument.
1079
1080       Added      new     query     verbs     RASQAL_QUERY_VERB_DELETE     and
1081       RASQAL_QUERY_VERB_INSERT for LAQRS.
1082
1083       Added rasqal_query_get_explain
1084
1085       rasqal_expression structure looses an unused field variable.
1086
1087       Added     rasqal_expression      types      RASQAL_EXPR_GROUP_COND_ASC,
1088       RASQAL_EXPR_GROUP_COND_DESC,  RASQAL_EXPR_COUNT and RASQAL_EXPR_VARSTAR
1089       for LAQRS.
1090
1091       rasqal_variable structure gains a new field expression for LAQRS..
1092
1093       Added static variables rasqal_license_string and rasqal_home_url_string
1094
1095   0.9.13
1096       Added rasqal_feature system with single  feature  RASQAL_FEATURE_NO_NET
1097       and   functions   rasqal_feature_from_uri,   rasqal_feature_value_type,
1098       rasqal_features_enumerate,                    rasqal_get_feature_count,
1099       rasqal_query_get_feature,              rasqal_query_get_feature_string,
1100       rasqal_query_set_feature and rasqal_query_set_feature_string.  int.
1101
1102       Added    rasqal_query_results_formatter    class    with    constructor
1103       rasqal_new_query_results_formatter                           destructor
1104       rasqal_free_query_results_formatter             and              method
1105       rasqal_query_results_formatter_write.
1106
1107       Added rasqal_query_results_formats_enumerate for listing supported for‐
1108       mats.
1109
1110   0.9.12
1111       Added      rasqal_query_iostream_write_escaped_counted_string       and
1112       rasqal_query_escape_counted_string
1113
1114       Added rasqal_query_get_anonymous_variable_sequence
1115
1116       Added rasqal_graph_pattern_get_index
1117
1118       Added RASQAL_EXPR_REGEX to rasqal_op
1119
1120       Added arg3 field to rasqal_expression for the REGEX operation.
1121
1122       Added rasqal_query_write
1123
1124       Added rasqal_new_3op_expression
1125
1126       Added rasqal_literal_as_string_flags
1127
1128   0.9.11
1129       Added enum rasqal_compare_flags flags for rasqal_expression_evaluate or
1130       rasqal_literal_compare.
1131
1132       Function rasqal_expression_evaluate gains a flag argument.
1133
1134       Added   rasqal_expression_visit   and   type   for   visitor   function
1135       rasqal_expression_visit_fn.
1136
1137       Added rasqal_new_expression_from_expression.
1138
1139       Deprecated   rasqal_expression_foreach,   replaced   by  rasqal_expres‐
1140       sion_visit.
1141
1142       Remove unused rasqal_new_variable_expression prototype.
1143
1144       Added  rasqal_graph_pattern_visit  and  type   for   visitor   function
1145       rasqal_graph_pattern_visit_fn.
1146
1147       Added rasqal_new_decimal_literal.
1148
1149       Deprecated  rasqal_new_floating_literal replaced by new rasqal_new_dou‐
1150       ble_literal.
1151
1152       Added rasqal_op type RASQAL_EXPR_LANGMATCHES for SPARQL langMatches().
1153
1154       Added   rasqal_literal   types:   RASQAL_LITERAL_DECIMAL,   RASQAL_LIT‐
1155       ERAL_DATETIME,  RASQAL_LITERAL_DOUBLE (replacing deprecated RASQAL_LIT‐
1156       ERAL_FLOATING) and RASQAL_LITERAL_FLOAT.
1157
1158       Reordered the rasqal_literal types in the enum.
1159
1160   0.9.10
1161       Added an rasqal_graph_pattern_operator enumerated type.  with the  fol‐
1162       lowing (useful) values: RASQAL_GRAPH_PATTERN_OPERATOR_BASIC (for triple
1163       patterns),    RASQAL_GRAPH_PATTERN_OPERATOR_OPTIONAL    (for     SPARQL
1164       OPTIONAL),    RASQAL_GRAPH_PATTERN_OPERATOR_UNION,    RASQAL_GRAPH_PAT‐
1165       TERN_OPERATOR_GROUP and RASQAL_GRAPH_PATTERN_OPERATOR_GRAPH (for SPARQL
1166       GRAPH).
1167
1168       Added graph pattern method rasqal_graph_pattern_get_operator Deprecated
1169       rasqal_graph_pattern_get_flags replaced by  the  above.   Added  helper
1170       function rasqal_graph_pattern_operator_as_string.
1171
1172       Modified  the  type  of  the  final  argument  of rasqal_new_graph_pat‐
1173       tern_from_sequence and rasqal_graph_pattern_add_triples from an integer
1174       to a rasqal_graph_pattern_operator enumeration.
1175
1176       Removed documentation of removed functions deprecated in 0.9.9.
1177
1178   0.9.9
1179       Added       query       methods      rasqal_query_get_construct_triple,
1180       rasqal_query_get_construct_triples_sequence,   rasqal_query_get_offset,
1181       rasqal_query_get_order_condition,         rasqal_query_get_order_condi‐
1182       tions_sequence,                   rasqal_query_get_query_graph_pattern,
1183       rasqal_query_get_verb,                       rasqal_query_get_wildcard.
1184       rasqal_query_set_default_generate_bnodeid_parameters,
1185       rasqal_query_set_distinct,   rasqal_query_set_generate_bnodeid_handler,
1186       rasqal_query_set_limit and rasqal_query_set_offset.
1187
1188       Added              expressions              RASQAL_EXPR_ORDER_COND_ASC,
1189       RASQAL_EXPR_ORDER_COND_DESC and RASQAL_EXPR_ORDER_COND_NONE.
1190
1191       Added enum rasqal_variable_type for typing variables.
1192
1193       Added  variable  constructor  rasqal_new_variable_typed to create typed
1194       variables.
1195
1196       Added enum rasqal_query_verb for  the  main  query  verbs  with  values
1197       RASQAL_QUERY_VERB_SELECT,                   RASQAL_QUERY_VERB_CONSTRUCT
1198       RASQAL_QUERY_VERB_DESCRIBE and RASQAL_QUERY_VERB_ASK.
1199
1200       Added rasqal_query_verb_as_string to get a strign for a query verb.
1201
1202       Deprecated  the  rasqal_triple  flags  field  and  the  triple  methods
1203       rasqal_triple_set_flags and rasqal_triple_get_flags.
1204
1205   0.9.8
1206       Added  a  Data  Graph  class  with  constructor  rasqal_new_data_graph,
1207       destructor      rasqal_free_data_graph      and      debug       method
1208       rasqal_data_graph_print.
1209
1210       Added  casting  expressions  with  type RASQAL_EXPR_CAST and expression
1211       constructor rasqal_new_cast_expression
1212
1213       Added a no-arg graph pattern constructor rasqal_new_graph_pattern
1214
1215       Added graph pattern  methods  rasqal_graph_pattern_add_triples  to  add
1216       triples  to a graph pattern and rasqal_graph_pattern_add_sub_graph_pat‐
1217       tern to add a sub-graph pattern to a graph pattern.
1218
1219       Added  graph   pattern   methods   rasqal_graph_pattern_add_constraint,
1220       rasqal_graph_pattern_get_constraint_sequence    and   rasqal_graph_pat‐
1221       tern_get_constraint to add constraints to a graph pattern.
1222
1223       Added  query  methods  for  data  graphs:  rasqal_query_add_data_graph,
1224       rasqal_query_get_data_graph_sequence, rasqal_query_get_data_graph.
1225
1226       Deprecated       query       methods:      rasqal_query_add_constraint,
1227       rasqal_query_get_constraint_sequence       rasqal_query_get_constraint,
1228       rasqal_query_add_source,      rasqal_query_get_source_sequence      and
1229       rasqal_query_get_source.
1230
1231       Removed deprecated  query  methods:  rasqal_query_get_variable_sequence
1232       and rasqal_query_add_triple.
1233
1234   0.9.7
1235       Export rasqal_graph_pattern typedef for graph patterns and added access
1236       methods:                        rasqal_query_get_graph_pattern_sequence
1237       rasqal_query_get_graph_pattern,        rasqal_graph_pattern_get_triple,
1238       rasqal_graph_pattern_get_sub_graph_pattern_sequence,  rasqal_graph_pat‐
1239       tern_get_sub_graph_pattern, rasqal_graph_pattern_get_flags
1240        and  exported  previously  internal  rasqal_graph_pattern_print Export
1241       rasqal_pattern_flags enum for graph pattern flags.
1242
1243       Added           rasqal_query_get_bound_variable_sequence            and
1244       rasqal_query_get_all_variable_sequence.
1245
1246       Deprecate          rasqal_query_get_variable_sequence         prefering
1247       rasqal_query_get_bound_variable_sequence
1248
1249       Added   rasqal_query_get_distinct  and  rasqal_query_get_limit  to  get
1250       access to query flags.
1251
1252       Deleted RASQAL_EXPR_PATTERN which was never used.
1253
1254   0.9.6
1255       Added   new  1-argument  expressions  to  the  expression  constructor;
1256       rasqal_op  enum  gained   the   following   values:   RASQAL_EXPR_LANG,
1257       RASQAL_EXPR_DATATYPE,       RASQAL_EXPR_BOUND,       RASQAL_EXPR_ISURI,
1258       RASQAL_EXPR_ISBLANK and RASQAL_EXPR_ISLITERAL
1259
1260       Added user-defined function expressions to the expression  constructor:
1261       rasqal_op  enum  gained  RASQAL_EXPR_FUNCTION  value; rasqal_expression
1262       gained name and args fields and added rasqal_new_function_expression to
1263       construct a function expression.
1264
1265       Added rasqal_query_results_is_bindings, rasqal_query_results_is_boolean
1266       and rasqal_query_results_is_graph to test the format of query result.
1267
1268       Added rasqal_query_results_get_boolean to get the value  of  a  boolean
1269       query result.
1270
1271       Added                rasqal_query_results_get_triple                and
1272       rasqal_query_results_next_triple to return an RDF graph query result.
1273
1274       Added rasqal_new_triple_from_triple triple copy constructor.
1275
1276   0.9.5
1277       Added rasqal_query_results_write to format query results into a syntax,
1278       written to a raptor iostream.
1279
1280       Changed rasqal_new_floating_literal to take a double argument.
1281
1282       Added    flags    for    triples   with   rasqal_triple_get_flags   and
1283       rasqal_triple_set_flags to get and set them.
1284
1285       Added rasqal_triple_parts  enum  and  updated  the  bind_match  factory
1286       method of the rasqal_triples_match structure to take and return them.
1287
1288       Added  a rasqal_triple_parts type field parts to the rasqal_triple_meta
1289       structure
1290
1291   0.9.4
1292       No API changes.
1293
1294   0.9.3
1295       The struct rasqal_prefix gained a declared field.
1296
1297       The struct rasqal_triple gained an origin field; not  used  at  present
1298       but intended to support work on tracking triple provenance such as pro‐
1299       vided by Redland Contexts.
1300
1301       Added methods rasqal_triple_set_origin and rasqal_triple_get_origin  to
1302       support the above.
1303
1304       struct  rasqal_triple_meta  now takes a 4-array of bindings, the fourth
1305       being the origin.
1306
1307       Exported  function  rasqal_set_triples_source_factory   publically   as
1308       intended.
1309
1310   0.9.2
1311       Several  functions changed their parameters or return values from char*
1312       to unsigned char* or const unsigned char* to reflect the actual use.
1313
1314       Changed to return a const unsigned char*:
1315       rasqal_literal_as_string
1316
1317       Changed to take const unsigned char* (or add const):
1318       rasqal_new_floating_literal
1319       rasqal_new_pattern_literal
1320       rasqal_new_prefix
1321       rasqal_new_simple_literal
1322       rasqal_new_string_literal
1323       rasqal_new_variable
1324       rasqal_query_has_variable
1325       rasqal_query_results_get_binding_name
1326       rasqal_query_results_get_binding_value_by_name
1327       rasqal_query_results_get_bindings
1328       rasqal_query_set_variable
1329
1330   0.9.1
1331       Added the rasqal_query_results class and moved the results methods from
1332       rasqal_query.
1333
1334       Made rasqal_query_execute return a rasqal_query_result*.
1335
1336       Renamed  all  rasqal_query*result*  methods to be rasqal_query_result_*
1337       Added rasqal_free_query_results to tidy up.
1338
1339       OLD API (0.9.0)                          NEW API (0.9.1+)
1340       rasqal_query_get_result_count            rasqal_query_results_get_count
1341       rasqal_query_next_result                 rasqal_query_results_next
1342       rasqal_query_results_finished            rasqal_query_results_finished
1343       rasqal_query_get_result_bindings         rasqal_query_results_get_bind‐
1344       ings
1345       rasqal_query_get_result_binding_value    rasqal_query_results_get_bind‐
1346       ing_value
1347       rasqal_query_get_result_binding_name     rasqal_query_results_get_bind‐
1348       ing_name
1349       rasqal_query_get_result_binding_by_name  rasqal_query_results_get_bind‐
1350       ing_value_by_name
1351       rasqal_query_get_bindings_count          rasqal_query_results_get_bind‐
1352       ings_count
1353
1354   0.9.0
1355       All new.
1356

CONFORMING TO

1358       SPARQL  Query  Language  for  RDF, Eric Prud'hommeaux and Andy Seaborne
1359       (eds),      W3C       Recommendation,       15       January       2008
1360       http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/
1361http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/
1362
1363       SPARQL Query Results XML Format, Jeen Broekstra and Dave Beckett (eds),
1364       W3C  Recommendation,  15  January 2008.  http://www.w3.org/TR/2008/REC-
1365       rdf-sparql-XMLres-20080115/  ⟨http://www.w3.org/TR/2008/REC-rdf-sparql-
1366       XMLres-20080115/⟩
1367
1368       RDQL - A Query Language for RDF, Andy Seaborne, W3C Member Submission 9
1369       January   2004    http://www.w3.org/Submission/2004/SUBM-RDQL-20040109/
1370http://www.w3.org/Submission/2004/SUBM-RDQL-20040109/
1371

SEE ALSO

1373       roqet(1),rasqal-config(1)
1374

AUTHOR

1376       Dave           Beckett           -          http://purl.org/net/dajobe/
1377http://purl.org/net/dajobe/
1378
1379
1380
1381                                  2008-06-22                      librasqal(3)
Impressum