RDF::Trine::Iterator::Graph - Stream (iterator) class for graph query results.
This document describes RDF::Trine::Iterator::Graph version 0.117
use RDF::Trine::Iterator; my $iterator = RDF::Trine::Iterator::Graph->new( \&data ); while (my $statement = $iterator->next) { # do something with $statement }
new ( \@results, %args )
new ( \&results, %args )
Returns a new SPARQL Result interator object. Results must be either an reference to an array containing results or a CODE reference that acts as an iterator, returning successive items when called, and returning undef when the iterator is exhausted.
$type should be one of: bindings, boolean, graph.
as_bindings ( $s, $p, $o )
Returns the iterator as a Bindings iterator, using the supplied triple nodes to determine the variable bindings.
materialize
Returns a materialized version of the current graph iterator.
unique
Returns a Graph iterator that ensures the returned statements are unique. While the underlying RDF graph is the same regardless of uniqueness, the iterator's serialization methods assume the results are unique, and so use this method before serialization.
Uniqueness is opt-in for efficiency concerns -- this method requires O(n) memory, and so may have noticable effects on large graphs.
is_graph
Returns true if the underlying result is an RDF graph.
as_xml ( $max_size )
Returns an XML serialization of the stream data.
print_xml ( $fh, $max_size )
Prints an XML serialization of the stream data to the filehandle $fh.
as_json ( $max_size )
Returns a JSON serialization of the stream data.
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
JSON
Scalar::Util
Gregory Todd Williams <gwilliams@cpan.org>
<gwilliams@cpan.org>
Copyright (c) 2006-2010 Gregory Todd Williams. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install RDF::Trine, copy and paste the appropriate command in to your terminal.
cpanm
cpanm RDF::Trine
CPAN shell
perl -MCPAN -e shell install RDF::Trine
For more information on module installation, please visit the detailed CPAN module installation guide.