.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "RDF::LinkedData 3pm" .TH RDF::LinkedData 3pm "2017-08-25" "perl v5.26.0" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" RDF::LinkedData \- A Linked Data server implementation .SH "VERSION" .IX Header "VERSION" Version 1.00 .SH "SYNOPSIS" .IX Header "SYNOPSIS" For just setting this up and get it to run, you would just use the \&\f(CW\*(C`linked_data.psgi\*(C'\fR script in this distribution. The usage of that is documented in Plack::App::RDF::LinkedData, with the \s-1README\s0 being a quick start guide. If you want to try and use this directly, you'd do stuff like: .PP .Vb 7 \& my $ld = RDF::LinkedData\->new(store => $config\->{store}, \& endpoint_config => $config\->{endpoint}, \& base_uri => $config\->{base_uri} \& ); \& $ld\->namespaces($config\->{namespaces}) if ($config\->{namespaces}); \& $ld\->request($req); \& return $ld\->response($uri)\->finalize; .Ve .PP See Plack::App::RDF::LinkedData for a complete example. .SH "DESCRIPTION" .IX Header "DESCRIPTION" This module is used to create a Linked Data server that can serve \s-1RDF\s0 data out of an RDF::Trine::Model. It will look up URIs in the model and do the right thing (known as the 303 dance) and mint URLs for that, as well as perform content negotiation. Thus, you can concentrate on URIs for your things, and you need not be concerned about minting URLs for the pages to serve it. In addition, optional modules can provide other important functionality: Cross-origin resource sharing, VoID description, cache headers, \s-1SPARQL\s0 Endpoint, Triple Pattern Fragments, etc. As such, it encompasses a fair share of Semantic Web best practices, but possibly not in a very flexible \*(L"Big Data\*(R" manner. .SH "METHODS" .IX Header "METHODS" .ie n .IP """new ( store => $store, model => $model, base_uri => $base_uri, hypermedia => 1, namespaces_as_vocabularies => 1, request => $request, endpoint_config => $endpoint_config, void_config => $void_config )""" 4 .el .IP "\f(CWnew ( store => $store, model => $model, base_uri => $base_uri, hypermedia => 1, namespaces_as_vocabularies => 1, request => $request, endpoint_config => $endpoint_config, void_config => $void_config )\fR" 4 .IX Item "new ( store => $store, model => $model, base_uri => $base_uri, hypermedia => 1, namespaces_as_vocabularies => 1, request => $request, endpoint_config => $endpoint_config, void_config => $void_config )" Creates a new handler object based on the named parameters, given a store config (recommended usage is to pass a hashref of the type that can be passed to RDF::Trine::Store\->new_with_config, but a simple string can also be used) or a model and a base \s-1URI.\s0 Optionally, you may pass a Plack::Request object (which must be passed before you call \f(CW\*(C`content\*(C'\fR) and an \f(CW\*(C`endpoint_config\*(C'\fR hashref if you want to have a \s-1SPARQL\s0 Endpoint running using the recommended module RDF::Endpoint. .Sp This module can also provide additional triples to turn the response into a hypermedia type. If you don't want this, set the \f(CW\*(C`hypermedia\*(C'\fR argument to false. Currently this entails setting the \s-1SPARQL\s0 endpoint and vocabularies used using the VoID vocabulary . .Sp Finally, it can provide experimental Triple Pattern Fragments support. .ie n .IP """BUILD""" 4 .el .IP "\f(CWBUILD\fR" 4 .IX Item "BUILD" Called by Moo to initialize an object. .ie n .IP """BUILDARGS""" 4 .el .IP "\f(CWBUILDARGS\fR" 4 .IX Item "BUILDARGS" Called by Moo to ensure that some attributes can be left unset. .ie n .IP """model""" 4 .el .IP "\f(CWmodel\fR" 4 .IX Item "model" Returns the RDF::Trine::Model object. .ie n .IP """base_uri""" 4 .el .IP "\f(CWbase_uri\fR" 4 .IX Item "base_uri" Returns or sets the base \s-1URI\s0 for this handler. .ie n .IP """request ( [ $request ] )""" 4 .el .IP "\f(CWrequest ( [ $request ] )\fR" 4 .IX Item "request ( [ $request ] )" Returns the Plack::Request object, if it exists; or sets it if a Plack::Request object is given as parameter. .ie n .IP """current_etag""" 4 .el .IP "\f(CWcurrent_etag\fR" 4 .IX Item "current_etag" Returns the current Etag of the model suitable for use in a \s-1HTTP\s0 header. This is a read-only attribute. .ie n .IP """last_etag"", ""has_last_etag""" 4 .el .IP "\f(CWlast_etag\fR, \f(CWhas_last_etag\fR" 4 .IX Item "last_etag, has_last_etag" Returns or sets the last Etag of so that changes to the model can be detected. .ie n .IP "namespaces ( $namespace_map )" 4 .el .IP "namespaces ( \f(CW$namespace_map\fR )" 4 .IX Item "namespaces ( $namespace_map )" Gets or sets the namespaces that some serializers use for pretty-printing. Should be handed a URI::NamespaceMap object. .ie n .IP """response ( $uri )""" 4 .el .IP "\f(CWresponse ( $uri )\fR" 4 .IX Item "response ( $uri )" Will look up what to do with the given \s-1URI\s0 object and populate the response object. .ie n .IP """helper_properties ( )""" 4 .el .IP "\f(CWhelper_properties ( )\fR" 4 .IX Item "helper_properties ( )" Returns the RDF::Helper::Properties object. if it exists; or sets it if an RDF::Helper::Properties object is given as a parameter. .ie n .IP """type""" 4 .el .IP "\f(CWtype\fR" 4 .IX Item "type" Returns or sets the type of result to return, i.e. \f(CW\*(C`page\*(C'\fR, in the case of a human-intended page or \f(CW\*(C`data\*(C'\fR for machine consumption, or an empty string if it is an actual resource \s-1URI\s0 that should be redirected. .ie n .IP """my_node""" 4 .el .IP "\f(CWmy_node\fR" 4 .IX Item "my_node" A node for the requested \s-1URI.\s0 This node is typically used as the subject to find which statements to return as data. This expects to get a \s-1URI\s0 object containing the full \s-1URI\s0 of the node. .ie n .IP """count ( $node)""" 4 .el .IP "\f(CWcount ( $node)\fR" 4 .IX Item "count ( $node)" Returns the number of statements that has the \f(CW$node\fR as subject, or all if \f(CW$node\fR is undef. .ie n .IP """endpoint ( [ $endpoint ] )""" 4 .el .IP "\f(CWendpoint ( [ $endpoint ] )\fR" 4 .IX Item "endpoint ( [ $endpoint ] )" Returns the RDF::Endpoint object if it exists or sets it if a RDF::Endpoint object is given as parameter. In most cases, it will be created for you if you pass a \f(CW\*(C`endpoint_config\*(C'\fR hashref to the constructor, so you would most likely not use this method. .ie n .IP """void ( [ $voidg ] )""" 4 .el .IP "\f(CWvoid ( [ $voidg ] )\fR" 4 .IX Item "void ( [ $voidg ] )" Returns the RDF::Generator::Void object, if it exists; or sets it if an RDF::Generator::Void object is given as parameter. Like \&\f(CW\*(C`endpoint\*(C'\fR, it will be created for you if you pass a \f(CW\*(C`void_config\*(C'\fR hashref to the constructor, so you would most likely not use this method. .SH "AUTHOR" .IX Header "AUTHOR" Kjetil Kjernsmo, \f(CW\*(C`\*(C'\fR .SH "CONTRIBUTORS" .IX Header "CONTRIBUTORS" Toby Inkster .SH "BUGS" .IX Header "BUGS" Please report any bugs using github .SH "SUPPORT" .IX Header "SUPPORT" You can find documentation for this module with the perldoc command. .PP .Vb 1 \& perldoc RDF::LinkedData .Ve .PP The perlrdf mailing list is the right place to seek help and discuss this module: .PP .SH "TODO" .IX Header "TODO" This module does what it is supposed to do rather well, and has thus reached the 1.0 milestone. To support a wider variety of use cases, the current module isn't flexible enough, so future version will need substantial changes, but the version number is intended to reflect that. .SH "ACKNOWLEDGMENTS" .IX Header "ACKNOWLEDGMENTS" This module was started by Gregory Todd Williams \f(CW\*(C`\*(C'\fR for RDF::LinkedData::Apache, but has been almost totally rewritten. .SH "COPYRIGHT & LICENSE" .IX Header "COPYRIGHT & LICENSE" Copyright 2010 Gregory Todd Williams .PP Copyright 2010 \s-1ABC\s0 Startsiden \s-1AS\s0 .PP Copyright 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017 Kjetil Kjernsmo .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.