NAME
RDF::Query::Client - Client for W3C SPARQL Protocol 1.0
VERSION
0.01
SYNOPSIS
use RDF::Query::Client;
my $query = new RDF::Query::Client ("SELECT * WHERE {?s ?p ?o. ?o ?p ?s.}");
my $iterator = $query->execute('http://example.com/sparql');
while (my $row = $iterator->next) {
print $row->{'s'}->as_string;
}
METHODS
new ( $query, \%opts )-
Returns a new RDF::Query::Client object for the specified
$query. The object's interface is designed to be roughly compatible with RDF::Query objects. The query language is always 'sparql'.Options include:
* UserAgent - an LWP::UserAgent to handle HTTP requests. execute ( $endpoint, \%opts )-
$endpointis a URI object or string containing the endpoint URI to be queried.Options include:
* UserAgent - an LWP::UserAgent to handle HTTP requests. * QueryMethod - 'GET', 'POST' or undef (automatic). * QueryParameter - defaults to 'query'. * Headers - additional headers to include (hashref).Returns undef on error; an RDF::Trine::Iterator if called in a scalar context; an array obtained by calling
get_allon the iterator if called in list context. as_sparql ()-
Returns the query as a string in the SPARQL syntax.
useragent ()-
Returns the LWP::UserAgent object used for retrieving web content.
http_response ()-
Returns the last HTTP Response the client experienced.
error ()-
Returns the last error the client experienced.
get ()prepare ()execute_plan ()execute_with_named_graphs ()aggregate ()pattern ()sse ()algebra_fixup ()add_function ()supported_extensions ()supported_functions ()add_computed_statement_generator ()get_computed_statement_generators ()net_filter_function ()add_hook_once ()add_hook ()parsed ()bridge ()log ()logger ()costmodel ()-
Each of these currently returns undef. They are placeholders for compatibility with RDF::Query.
SEE ALSO
http://www.w3.org/TR/rdf-sparql-protocol/
http://www.perlrdf.org/
AUTHOR
Toby Inkster, <mail@tobyinkster.co.uk>
COPYRIGHT AND LICENSE
Copyright (C) 2009 by Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.10.0 or, at your option, any later version of Perl 5 you may have available.