1librasqal(3) Library Functions Manual librasqal(3)
2
3
4
6 librasqal - Rasqal RDF query library
7
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 prog.c -o prog `pkg-config rasqal --cflags` `pkg-config rasqal --libs`
33
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 supports most of the W3C
40 SPARQL 1.0 Query language, some of SPARQL 1.1 draft and fully supports
41 RDQL.
42
43 Rasqal uses the libraptor(3) library for providing URI handling, WWW
44 content retrieval and other support functions.
45
47 See the HTML API docs that may be installed system wide at
48 /usr/share/gtk-doc/html/rasqal/ or on the web at
49 http://librdf.org/rasqal/docs/api/ ⟨http://librdf.org/rasqal/docs/api/⟩
50
52 See the Raptor API docs changes section at
53 http://librdf.org/rasqal/docs/api/rasqal-changes.html
54 ⟨http://librdf.org/rasqal/docs/api/rasqal-changes.html⟩
55
57 SPARQL Query Language for RDF, Eric Prud'hommeaux and Andy Seaborne
58 (eds), W3C Recommendation, 15 January 2008
59 http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/
60 ⟨http://www.w3.org/TR/2008/REC-rdf-sparql-query-20080115/⟩
61
62 SPARQL Query Results XML Format, Jeen Broekstra and Dave Beckett (eds),
63 W3C Recommendation, 15 January 2008. http://www.w3.org/TR/2008/REC-
64 rdf-sparql-XMLres-20080115/ ⟨http://www.w3.org/TR/2008/REC-rdf-sparql-
65 XMLres-20080115/⟩
66
67 RDQL - A Query Language for RDF, Andy Seaborne, W3C Member Submission 9
68 January 2004 http://www.w3.org/Submission/2004/SUBM-RDQL-20040109/
69 ⟨http://www.w3.org/Submission/2004/SUBM-RDQL-20040109/⟩
70
72 roqet(1),libraptor(3)
73
75 Dave Beckett - http://purl.org/net/dajobe/
76 ⟨http://purl.org/net/dajobe/⟩
77
78
79
80 2011-01-12 librasqal(3)