.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" 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 .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . 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 "2020-11-09" "perl v5.32.0" "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 \s-1INDEX\s0" 4 .IX Item "binding_name INDEX" Get the name of variable binding \fI\s-1INDEX\s0\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 \s-1INDEX\s0" 4 .IX Item "binding_value INDEX" Get the value of the variable binding \fI\s-1INDEX\s0\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 \s-1NAME\s0" 4 .IX Item "binding_value_by_name NAME" Get the value of the variable binding \fI\s-1NAME\s0\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 \s-1RDF\s0 Graph. .IP "to_string [\s-1FORMAT\-URI\s0 [\s-1BASE\-URI\s0]]" 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 \s-1RDF\s0 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/