/usr/share/doc/librdf-linkeddata-perl/examples/linked_data.psgi is in librdf-linkeddata-perl 0.58-1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 | #!/usr/bin/perl
use strict;
use warnings;
use Plack::App::RDF::LinkedData;
use RDF::LinkedData;
use Plack::Request;
use Plack::Builder;
use Config::JFDI;
use Carp qw(confess);
use Module::Load::Conditional qw[can_load];
=head1 NAME
linked_data.psgi - A simple Plack server for RDF as linked data
=head1 INSTRUCTIONS
See L<Plack::App::RDF::LinkedData> for instructions on how to use this.
=cut
my $config;
BEGIN {
unless ($config = Config::JFDI->open( name => "RDF::LinkedData")) {
if ($ENV{'PERLRDF_STORE'}) {
$config->{store} = $ENV{'PERLRDF_STORE'};
$config->{base_uri} = 'http://localhost:5000';
} else {
confess "Couldn't find config";
}
}
}
my $linkeddata = Plack::App::RDF::LinkedData->new();
$linkeddata->configure($config);
my $rdf_linkeddata = $linkeddata->to_app;
builder {
enable "Head";
enable "ContentLength";
enable "ConditionalGET";
if (can_load( modules => { 'Plack::Middleware::CrossOrigin' => 0 })) { enable 'CrossOrigin' => %{$config->{cors}}};
$rdf_linkeddata;
};
__END__
=head1 AUTHOR
Kjetil Kjernsmo C<< <kjetilk@cpan.org> >>
=head1 COPYRIGHT
Copyright (c) 2010 ABC Startsiden AS and Gregory Todd Williams and
2010-2012 Kjetil Kjernsmo. This program is free software; you can
redistribute it and/or modify it under the same terms as Perl itself.
=cut
|