.\" Automatically generated by Pod::Man 4.10 (Pod::Simple 3.35) .\" .\" 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::Trine::Iterator::Bindings 3pm" .TH RDF::Trine::Iterator::Bindings 3pm "2018-11-03" "perl v5.28.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::Trine::Iterator::Bindings \- Iterator class for bindings query results .SH "VERSION" .IX Header "VERSION" This document describes RDF::Trine::Iterator::Bindings version 1.019 .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& use RDF::Trine::Iterator::Bindings; \& \& my $iterator = RDF::Trine::Iterator::Bindings\->new( \e&data, \e@names ); \& while (my $row = $iterator\->next) { \& # $row is a HASHref containing variable name \-> RDF Term bindings \& my @vars = keys %$row; \& print $row\->{ \*(Aqvar\*(Aq }\->as_string; \& } .Ve .SH "METHODS" .IX Header "METHODS" Beyond the methods documented below, this class inherits methods from the RDF::Trine::Iterator class. .ie n .IP """new ( \e@results, \e@names, %args )""" 4 .el .IP "\f(CWnew ( \e@results, \e@names, %args )\fR" 4 .IX Item "new ( @results, @names, %args )" .PD 0 .ie n .IP """new ( \e&results, \e@names, %args )""" 4 .el .IP "\f(CWnew ( \e&results, \e@names, %args )\fR" 4 .IX Item "new ( &results, @names, %args )" .PD Returns a new \s-1SPARQL\s0 Result interator object. Results must be either a reference to an array containing results or a \s-1CODE\s0 reference that acts as an iterator, returning successive items when called, and returning undef when the iterator is exhausted. .ie n .IP """materialize""" 4 .el .IP "\f(CWmaterialize\fR" 4 .IX Item "materialize" Returns a materialized version of the current binding iterator. The materialization process will leave this iterator empty. The materialized iterator that is returned should be used for any future need for the iterator's data. .ie n .IP """project ( @columns )""" 4 .el .IP "\f(CWproject ( @columns )\fR" 4 .IX Item "project ( @columns )" Returns a new stream that projects the current bindings to only the given columns. .ie n .IP """join_streams ( $stream, $stream )""" 4 .el .IP "\f(CWjoin_streams ( $stream, $stream )\fR" 4 .IX Item "join_streams ( $stream, $stream )" Performs a natural, nested loop join of the two streams, returning a new stream of joined results. .ie n .IP """nested_loop_join ( $outer, $inner )""" 4 .el .IP "\f(CWnested_loop_join ( $outer, $inner )\fR" 4 .IX Item "nested_loop_join ( $outer, $inner )" Performs a natural, nested loop join of the two streams, returning a new stream of joined results. .Sp Note that the values from the \f(CW$inner\fR iterator are fully materialized for this join, and the results of the join are in the order of values from the \&\f(CW$outer\fR iterator. This suggests that: .Sp * If sorting needs to be preserved, the \f(CW$outer\fR iterator should be used to determine the result ordering. .Sp * If one iterator is much smaller than the other, it should likely be used as the \f(CW$inner\fR iterator since materialization will require less total memory. .ie n .IP """sorted_by""" 4 .el .IP "\f(CWsorted_by\fR" 4 .IX Item "sorted_by" .PD 0 .ie n .IP """binding_value_by_name ( $name )""" 4 .el .IP "\f(CWbinding_value_by_name ( $name )\fR" 4 .IX Item "binding_value_by_name ( $name )" .PD Returns the binding of the named variable in the current result. .ie n .IP """binding_value ( $i )""" 4 .el .IP "\f(CWbinding_value ( $i )\fR" 4 .IX Item "binding_value ( $i )" Returns the binding of the \f(CW$i\fR\-th variable in the current result. .ie n .IP """binding_values""" 4 .el .IP "\f(CWbinding_values\fR" 4 .IX Item "binding_values" Returns a list of the binding values from the current result. .ie n .IP """binding_names""" 4 .el .IP "\f(CWbinding_names\fR" 4 .IX Item "binding_names" Returns a list of the binding names. .ie n .IP """binding_name ( $i )""" 4 .el .IP "\f(CWbinding_name ( $i )\fR" 4 .IX Item "binding_name ( $i )" Returns the name of the \f(CW$i\fR\-th result column. .ie n .IP """bindings_count""" 4 .el .IP "\f(CWbindings_count\fR" 4 .IX Item "bindings_count" Returns the number of variable bindings in the current result. .ie n .IP """is_bindings""" 4 .el .IP "\f(CWis_bindings\fR" 4 .IX Item "is_bindings" Returns true if the underlying result is a set of variable bindings. .ie n .IP """as_json ( $max_size )""" 4 .el .IP "\f(CWas_json ( $max_size )\fR" 4 .IX Item "as_json ( $max_size )" Returns a \s-1JSON\s0 serialization of the stream data. .ie n .IP """as_xml ( $max_size )""" 4 .el .IP "\f(CWas_xml ( $max_size )\fR" 4 .IX Item "as_xml ( $max_size )" Returns an \s-1XML\s0 serialization of the stream data. .ie n .IP """as_string ( $max_size [, \e$count] )""" 4 .el .IP "\f(CWas_string ( $max_size [, \e$count] )\fR" 4 .IX Item "as_string ( $max_size [, $count] )" Returns a string table serialization of the stream data. .ie n .IP """as_statements ( $pattern | @names )""" 4 .el .IP "\f(CWas_statements ( $pattern | @names )\fR" 4 .IX Item "as_statements ( $pattern | @names )" Returns a RDF::Trine::Iterator::Graph with the statements of the stream. .Sp If \f(CW$pattern\fR, an RDF::Trine::Pattern object, is given as an argument, each of its triples are instantiated with variable bindings from each row of the iterator, and returned as RDF::Trine::Statement objects from a new RDF::Trine::Iterator::Graph iterator. .Sp If 3 variable \f(CW@names\fR are supplied, their corresponding variable bindings in each row of the iterator are used (in order) as the subject, predicate, and object of new RDF::Trine::Statement objects and returned from a new RDF::Trine::Iterator::Graph iterator. .ie n .IP """print_xml ( $fh, $max_size )""" 4 .el .IP "\f(CWprint_xml ( $fh, $max_size )\fR" 4 .IX Item "print_xml ( $fh, $max_size )" Prints an \s-1XML\s0 serialization of the stream data to the filehandle \f(CW$fh\fR. .ie n .IP """construct_args""" 4 .el .IP "\f(CWconstruct_args\fR" 4 .IX Item "construct_args" Returns the arguments necessary to pass to the stream constructor _new to re-create this stream (assuming the same closure as the first argument). .SH "DEPENDENCIES" .IX Header "DEPENDENCIES" \&\s-1JSON\s0 .PP Scalar::Util .SH "BUGS" .IX Header "BUGS" Please report any bugs or feature requests to through the GitHub web interface at . .SH "AUTHOR" .IX Header "AUTHOR" Gregory Todd Williams \f(CW\*(C`\*(C'\fR .SH "COPYRIGHT" .IX Header "COPYRIGHT" Copyright (c) 2006\-2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.