1RDF::Redland::QueryResuUlstesr(3C)ontributed Perl DocumeRnDtFa:t:iRoendland::QueryResults(3)
2
3
4
6 RDF::Redland::QueryResults - Redland RDF Syntax Query Results Class
7
9 use RDF::Redland;
10
11 ...
12 my $query=new RDF::Redland::Query("query string", undef, undef, "sparql");
13 my $results=$model->query_execute($query);
14 # or my $results=$query->execute($model);
15 while(!$results->finished) {
16 for (my $i=0; $i < $results->bindings_count(); $i++) {
17 my $name=$results->binding_name($i);
18 my $value=$results->binding_value($i);
19 # ... do something with the results
20 }
21 $results->next_result;
22 }
23
24 The $results in the example is an object of class
25 RDF::Redland::QueryResults.
26
28 This class represents queries of various syntaxes over an
29 RDF::Redland::Model returning a sequence of results that bind variable
30 names to RDF::Redland::Node values.
31
33 There are no public constructors.
34
36 count
37 Return the number of current results from the query.
38
39 finished
40 Return non-0 if the results have been exhausted.
41
42 binding_name INDEX
43 Get the name of variable binding INDEX in the array of variable
44 names.
45
46 binding_names
47 Get the names all of the variable bindings as an array.
48
49 binding_value INDEX
50 Get the value of the variable binding INDEX in the current query
51 result.
52
53 binding_values
54 Get the values of all of the variable bindings in the current query
55 result.
56
57 binding_value_by_name NAME
58 Get the value of the variable binding NAME in the current query
59 result.
60
61 bindings
62 Get the variable names and values of the current query result as a
63 hash
64
65 bindings_count
66 Return the number of variable bindings.
67
68 next_result
69 Move to the next query result.
70
71 as_stream
72 Return a new RDF::Redland::Stream object representing the query
73 results as an RDF Graph.
74
75 to_string [FORMAT-URI [BASE-URI]]
76 Serialize to a string syntax in format FORMAT-URI using the
77 optional BASE-URI. The default format when none is given is
78 determined by librdf_query_results_to_string.
79
80 is_bindings
81 Return non-0 if the query results format is variable bindings
82
83 is_boolean
84 Return non-0 if the query results format is a boolean
85
86 is_graph
87 Return non-0 if the query results format is an RDF graph
88
89 get_boolean
90 Get the boolean query result; non-0 is true.
91
93 RDF::Redland::Query
94
96 Dave Beckett - http://www.dajobe.org/
97
98
99
100perl v5.28.1 2011-02-04 RDF::Redland::QueryResults(3)