RDF::Query::Client(3pm) | User Contributed Perl Documentation | RDF::Query::Client(3pm) |
RDF::Query::Client - get data from W3C SPARQL Protocol 1.0 servers
use RDF::Query::Client; my $query = RDF::Query::Client ->new('SELECT DISTINCT ?s WHERE { ?s ?p ?o . }'); my $iterator = $query->execute('http://example.com/sparql'); while (my $row = $iterator->next) { print $row->{s}->as_string; }
Options include:
Unlike RDF::Query, where you get a choice of query language, the query language for RDF::Query::Client is always 'sparql'. RDF::TrineShortcuts offers a way to perform RDQL queries on remote SPARQL stores though (by transforming RDQL to SPARQL).
Options include:
Returns undef on error; an RDF::Trine::Iterator if called in a scalar context; an array obtained by calling "get_all" on the iterator if called in list context.
Link: </my/endpoint>; rel="http://ontologi.es/sparql#endpoint"
Change the URL in the angled brackets, but not the URL in the rel string.
This feature requires the HTTP::LRDD package to be installed.
The "execute" and "get" methods allow AuthUsername and AuthPassword options to be passed to them for HTTP Basic authentication. For more complicated authentication (Digest, OAuth, Windows, etc), it is also possible to pass these methods a customised LWP::UserAgent.
If you have the Crypt::SSLeay package installed, requests to HTTPS endpoints should work. It's possible to specify a client X.509 certificate (e.g. for WebID authentication) by setting particular environment variables. See Crypt::SSLeay documentation for details.
Probably.
Please report any you find here: <https://rt.cpan.org/Dist/Display.html?Queue=RDF-Query-Client>.
Toby Inkster, <tobyink@cpan.org>
Copyright (C) 2009-2013 by Toby Inkster
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
2019-02-07 | perl v5.28.1 |