| 1 |
<?xml version="1.0" encoding="iso-8859-1"?> |
| 2 |
<?xml version="1.0"?> |
| 3 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 |
<head> |
| 5 |
<title>Redland RDF Application Framework - Perl RDF::Redland::QueryResults Class</title> |
| 6 |
</head> |
| 7 |
<body> |
| 8 |
|
| 9 |
<h1 style="text-align:center">Redland RDF Application Framework - Perl RDF::Redland::QueryResults Class</h1> |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
<div name="index"> |
| 14 |
<p><a name="__index__"></a></p> |
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
</div> |
| 29 |
|
| 30 |
|
| 31 |
<h2><a name="name">NAME</a></h2> |
| 32 |
<p>RDF::Redland::QueryResults - Redland RDF Syntax Query Results Class</p> |
| 33 |
|
| 34 |
<h2><a name="synopsis">SYNOPSIS</a></h2> |
| 35 |
<pre> |
| 36 |
use RDF::Redland; |
| 37 |
</pre> |
| 38 |
<pre> |
| 39 |
... |
| 40 |
my $query=new RDF::Redland::Query("query string", undef, undef, "sparql"); |
| 41 |
my $results=$model->query_execute($query); |
| 42 |
# or my $results=$query->execute($model); |
| 43 |
while(!$results->finished) { |
| 44 |
for (my $i=0; $i < $results->bindings_count(); $i++) { |
| 45 |
my $name=$results->binding_name($i); |
| 46 |
my $value=$results->binding_value($i); |
| 47 |
# ... do something with the results |
| 48 |
} |
| 49 |
$results->next_result; |
| 50 |
} |
| 51 |
</pre> |
| 52 |
<p>The $results in the example is an object of class RDF::Redland::QueryResults.</p> |
| 53 |
|
| 54 |
<h2><a name="description">DESCRIPTION</a></h2> |
| 55 |
<p>This class represents queries of various syntaxes over an RDF::Redland::Model returning a sequence of results that bind variable names to RDF::Redland::Node values.</p> |
| 56 |
|
| 57 |
<h2><a name="constructor">CONSTRUCTOR</a></h2> |
| 58 |
<p>There are no public constructors.</p> |
| 59 |
|
| 60 |
<h2><a name="methods">METHODS</a></h2> |
| 61 |
<dl> |
| 62 |
<dt><strong><a name="count" class="item">count</a></strong></dt> |
| 63 |
<dd> |
| 64 |
<p>Return the number of current results from the query.</p> |
| 65 |
</dd> |
| 66 |
<dt><strong><a name="finished" class="item">finished</a></strong></dt> |
| 67 |
<dd> |
| 68 |
<p>Return non-0 if the results have been exhausted.</p> |
| 69 |
</dd> |
| 70 |
<dt><strong><a name="binding_name" class="item">binding_name INDEX</a></strong></dt> |
| 71 |
<dd> |
| 72 |
<p>Get the name of variable binding <em>INDEX</em> in the array of variable names.</p> |
| 73 |
</dd> |
| 74 |
<dt><strong><a name="binding_names" class="item">binding_names</a></strong></dt> |
| 75 |
<dd> |
| 76 |
<p>Get the names all of the variable bindings as an array.</p> |
| 77 |
</dd> |
| 78 |
<dt><strong><a name="binding_value" class="item">binding_value INDEX</a></strong></dt> |
| 79 |
<dd> |
| 80 |
<p>Get the value of the variable binding <em>INDEX</em> in the current query result.</p> |
| 81 |
</dd> |
| 82 |
<dt><strong><a name="binding_values" class="item">binding_values</a></strong></dt> |
| 83 |
<dd> |
| 84 |
<p>Get the values of all of the variable bindings in the current query result.</p> |
| 85 |
</dd> |
| 86 |
<dt><strong><a name="binding_value_by_name" class="item">binding_value_by_name NAME</a></strong></dt> |
| 87 |
<dd> |
| 88 |
<p>Get the value of the variable binding <em>NAME</em> in the current query result.</p> |
| 89 |
</dd> |
| 90 |
<dt><strong><a name="bindings" class="item">bindings</a></strong></dt> |
| 91 |
<dd> |
| 92 |
<p>Get the variable names and values of the current query result as a hash</p> |
| 93 |
</dd> |
| 94 |
<dt><strong><a name="bindings_count" class="item">bindings_count</a></strong></dt> |
| 95 |
<dd> |
| 96 |
<p>Return the number of variable bindings.</p> |
| 97 |
</dd> |
| 98 |
<dt><strong><a name="next_result" class="item">next_result</a></strong></dt> |
| 99 |
<dd> |
| 100 |
<p>Move to the next query result.</p> |
| 101 |
</dd> |
| 102 |
<dt><strong><a name="as_stream" class="item">as_stream</a></strong></dt> |
| 103 |
<dd> |
| 104 |
<p>Return a new RDF::Redland::Stream object representing the query results as an RDF Graph.</p> |
| 105 |
</dd> |
| 106 |
<dt><strong><a name="to_string_format_uri_base_uri" class="item">to_string [FORMAT-URI [BASE-URI]]</a></strong></dt> |
| 107 |
<dd> |
| 108 |
<p>Serialize to a string syntax in format <em>FORMAT-URI</em> using the optional <em>BASE-URI</em>. The default format when none is given is determined by librdf_query_results_to_string.</p> |
| 109 |
</dd> |
| 110 |
<dt><strong><a name="is_bindings" class="item">is_bindings</a></strong></dt> |
| 111 |
<dd> |
| 112 |
<p>Return non-0 if the query results format is variable bindings</p> |
| 113 |
</dd> |
| 114 |
<dt><strong><a name="is_boolean" class="item">is_boolean</a></strong></dt> |
| 115 |
<dd> |
| 116 |
<p>Return non-0 if the query results format is a boolean</p> |
| 117 |
</dd> |
| 118 |
<dt><strong><a name="is_graph" class="item">is_graph</a></strong></dt> |
| 119 |
<dd> |
| 120 |
<p>Return non-0 if the query results format is an RDF graph</p> |
| 121 |
</dd> |
| 122 |
<dt><strong><a name="get_boolean" class="item">get_boolean</a></strong></dt> |
| 123 |
<dd> |
| 124 |
<p>Get the boolean query result; non-0 is true.</p> |
| 125 |
</dd> |
| 126 |
</dl> |
| 127 |
|
| 128 |
<h2><a name="see_also">SEE ALSO</a></h2> |
| 129 |
<p><a href="Query.html">the RDF::Redland::Query manpage</a></p> |
| 130 |
|
| 131 |
<h2><a name="author">AUTHOR</a></h2> |
| 132 |
<p>Dave Beckett - <a href="http://www.dajobe.org/">http://www.dajobe.org/</a></p> |
| 133 |
<hr /> |
| 134 |
|
| 135 |
<p>(C) Copyright 2000-2011 <a href="http://www.dajobe.org/">Dave Beckett</a>, (C) Copyright 2000-2005 <a href="http://www.bristol.ac.uk/">University of Bristol</a></p> |
| 136 |
|
| 137 |
</body> |
| 138 |
</html> |