.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "RDF::Redland::QueryResults 3pm" .TH RDF::Redland::QueryResults 3pm 2024-03-17 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME RDF::Redland::QueryResults \- Redland RDF Syntax Query Results Class .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use RDF::Redland; \& \& ... \& my $query=new RDF::Redland::Query("query string", undef, undef, "sparql"); \& my $results=$model\->query_execute($query); \& # or my $results=$query\->execute($model); \& while(!$results\->finished) { \& for (my $i=0; $i < $results\->bindings_count(); $i++) { \& my $name=$results\->binding_name($i); \& my $value=$results\->binding_value($i); \& # ... do something with the results \& } \& $results\->next_result; \& } .Ve .PP The \f(CW$results\fR in the example is an object of class RDF::Redland::QueryResults. .SH DESCRIPTION .IX Header "DESCRIPTION" 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. .SH CONSTRUCTOR .IX Header "CONSTRUCTOR" There are no public constructors. .SH METHODS .IX Header "METHODS" .IP count 4 .IX Item "count" Return the number of current results from the query. .IP finished 4 .IX Item "finished" Return non\-0 if the results have been exhausted. .IP "binding_name INDEX" 4 .IX Item "binding_name INDEX" Get the name of variable binding \fIINDEX\fR in the array of variable names. .IP binding_names 4 .IX Item "binding_names" Get the names all of the variable bindings as an array. .IP "binding_value INDEX" 4 .IX Item "binding_value INDEX" Get the value of the variable binding \fIINDEX\fR in the current query result. .IP binding_values 4 .IX Item "binding_values" Get the values of all of the variable bindings in the current query result. .IP "binding_value_by_name NAME" 4 .IX Item "binding_value_by_name NAME" Get the value of the variable binding \fINAME\fR in the current query result. .IP bindings 4 .IX Item "bindings" Get the variable names and values of the current query result as a hash .IP bindings_count 4 .IX Item "bindings_count" Return the number of variable bindings. .IP next_result 4 .IX Item "next_result" Move to the next query result. .IP as_stream 4 .IX Item "as_stream" Return a new RDF::Redland::Stream object representing the query results as an RDF Graph. .IP "to_string [FORMAT\-URI [BASE\-URI]]" 4 .IX Item "to_string [FORMAT-URI [BASE-URI]]" Serialize to a string syntax in format \fIFORMAT-URI\fR using the optional \&\fIBASE-URI\fR. The default format when none is given is determined by librdf_query_results_to_string. .IP is_bindings 4 .IX Item "is_bindings" Return non\-0 if the query results format is variable bindings .IP is_boolean 4 .IX Item "is_boolean" Return non\-0 if the query results format is a boolean .IP is_graph 4 .IX Item "is_graph" Return non\-0 if the query results format is an RDF graph .IP get_boolean 4 .IX Item "get_boolean" Get the boolean query result; non\-0 is true. .SH "SEE ALSO" .IX Header "SEE ALSO" RDF::Redland::Query .SH AUTHOR .IX Header "AUTHOR" Dave Beckett \- http://www.dajobe.org/