RDF::LinkedData

A Linked Data server implementation
Download

RDF::LinkedData Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Publisher Name:
  • Kjetil Kjernsmo
  • Publisher web site:
  • http://search.cpan.org/~kjetilk/

RDF::LinkedData Tags


RDF::LinkedData Description

A Linked Data server implementation RDF::LinkedData is a Perl module that provides a server implementation for serving Linked Data from the host it is configured for. Its main feature is that it can take an RDF model optionally read from file(s) or from a SPARQL endpoint and serve the URIs of those resources according to Linked Data best practices. It will do content negotation, supports many seralizations, and it will do 303 redirects as needed.For example, say you control a host lod.example.org and wish to use it to serve Linked Data. On file, you have a bit of RDF that you want to serve, like: @prefix rdfs: < http://www.w3.org/2000/01/rdf-schema# > . < http://lod.example.org/foo > rdfs:label "DAHUT" ; rdfs:seeAlso . < http://lod.example.org/bar > rdfs:label "More here" .Then configuring this server to use the above file will make http://lod.example.org/foo and http://lod.example.org/bar dereferenceable with no further effort. The server will also return an appropriate 303 redirect to either a data or page suffix depending on the client's Accept header and return a representation of the data.SYNOPSISA simple Plack server illustrates the usage nicely: use RDF::LinkedData; use Plack::Request; use RDF::Trine; my $parser = RDF::Trine::Parser->new( 'turtle' ); my $model = RDF::Trine::Model->temporary_model; my $base_uri = 'http://localhost:5000'; $parser->parse_file_into_model( $base_uri, 't/data/basic.ttl', $model ); my $ld = RDF::LinkedData->new(model => $model, base_uri=>$base_uri); my $linked_data = sub { my $env = shift; my $req = Plack::Request->new($env); my $uri = $req->path_info; if ($req->path_info =~ m!^(.+?)/?(page|data)$!) { $uri = $1; $ld->type($2); } $ld->headers_in($req->headers); return $ld->response($uri)->finalize; } Requirements: · Perl


RDF::LinkedData Related Software