/usr/share/librdf-endpoint-perl/endpoint.psgi is in librdf-endpoint-perl 0.09-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 66 67 68 69 70 71 72 73 74 75 76 77 78 | #!/usr/bin/env perl
use strict;
use warnings;
use Data::Dumper;
use Plack::Request;
use Plack::Builder;
use Config::ZOMG;
use Carp qw(confess);
use RDF::Endpoint;
use LWP::MediaTypes qw(add_type);
add_type( 'application/rdf+xml' => qw(rdf xrdf rdfx) );
add_type( 'text/turtle' => qw(ttl) );
add_type( 'text/plain' => qw(nt) );
add_type( 'text/x-nquads' => qw(nq) );
add_type( 'text/json' => qw(json) );
add_type( 'text/html' => qw(html xhtml htm) );
my $config;
if (my $file = $ENV{RDF_ENDPOINT_FILE}) {
my $abs = File::Spec->rel2abs( $file );
$config = {
store => "Memory;file://$abs",
endpoint => {
service_description => {
named_graphs => 1,
default => 1,
},
html => {
embed_images => 1,
image_width => 200,
resource_links => 1,
},
load_data => 0,
update => 1,
}
};
} elsif ($config = eval { Config::ZOMG->open( name => "RDF::Endpoint") }) {
} else {
$config = {
store => "Memory",
endpoint => {
service_description => {
named_graphs => 1,
default => 1,
},
html => {
embed_images => 1,
image_width => 200,
resource_links => 1,
},
load_data => 0,
update => 1,
}
};
}
if (exists $ENV{'PERLRDF_STORE'}) {
$config->{store} = $ENV{'PERLRDF_STORE'};
}
my $end = RDF::Endpoint->new( $config );
my $app = sub {
my $env = shift;
my $req = Plack::Request->new($env);
my $resp = $end->run( $req );
return $resp->finalize;
};
builder {
enable "AccessLog", format => "combined";
$app;
};
__END__
|