Apache-SPARQL-RDFStore
view release on metacpan or search on metacpan
lib/Apache/SPARQL/RDFStore.pm view on Meta::CPAN
my ($class, $ap, $msg ) = @_;
$ap->log()->error( " [ Apache::SPARQL::RDFStore DEBUG ] $msg " );
};
sub _SPARQLhas_Source {
my ($class, $query) = @_;
return ( $query =~ m/\s*(FROM|FROM NAMED|LOAD|WITH)\s*((\<[^>]*\>)|(([a-zA-Z0-9\-_$\.]+)?:([a-zA-Z0-9\-_$\.]+)))\s+/i );
};
# format "rdfxml", "xml", "turtle", "ntriples" ... [defaults vary] (1)
sub _get_content_type {
my ($class, $format) = @_;
my $content_type;
if( $format eq 'rdfxml' ) {
$content_type = 'application/rdf+xml';
} elsif( $format eq 'xml' ) {
$content_type = 'application/sparql-results+xml';
} elsif( $format eq 'turtle' ) {
$content_type = 'application/x-turtle';
} elsif( $format eq 'ntriples' ) {
$content_type = 'application/ntriples';
} else {
$content_type = 'text/plain';
};
};
sub getGraph {
my ($class, $ap, $graph_id, $format ) = @_;
return $Apache::SPARQL::Responses{ 'MalformedRequest' };
};
sub getServiceDescription {
my ($class, $ap) = @_;
return $Apache::SPARQL::Responses{ 'MalformedRequest' };
};
=cut
=head1 NAME
Apache::SPARQL::RDFStore - A mod_perl handler which implements SPARQL HTTP bindings with RDFStore
=head1 SYNOPSIS
<Location /rdfstore>
SetHandler perl-script
PerlHandler Apache::SPARQL::RDFStore
</Location>
#
my $ua = LWP::UserAgent->new();
my $req = HTTP::Request->new(GET => "http://pim.example/rdfstore?query=PREFIX+foaf%3A+%3Chttp%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%3E%0
D%0ASELECT+%3Fpg%0D%0AWHERE%0D%0A++%28%3Fwho+foaf%3Aname+%22Norm+Walsh%22%29%0D%0A++%28%3Fwho+foaf%3Aweblog+%3Fpg%29%0D%0A");
my $res = $ua->request($req);
=head1 DESCRIPTION
Apache::SPARQL::RDFStore is a mod_perl handler which implements SPARQL HTTP bindings with RDFStore...
=head1 MOD_PERL COMPATIBILITY
This handler will work with both mod_perl 1.x and mod_perl 2.x.
=head1 AUTHOR
Alberto Reggiori <alberto@asemantics.com>
=head1 SEE ALSO
Apache::SPARQL
http://www.w3.org/TR/rdf-sparql-protocol/
http://www.w3.org/2001/sw/DataAccess/proto-wd/ (editor working draft)
http://www.w3.org/2001/sw/DataAccess/prot26
http://www.w3.org/TR/rdf-sparql-query/
http://www.w3.org/2001/sw/DataAccess/rq23/ (edit working draft)
=head1 LICENSE
see LICENSE file included into this distribution
=cut
return 1;
( run in 0.607 second using v1.01-cache-2.11-cpan-13bb782fe5a )