.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" 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" '' '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 turned on, 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. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "RDF::LinkedData 3pm" .TH RDF::LinkedData 3pm "2012-07-29" "perl v5.14.2" "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 simple Linked Data implementation .SH "VERSION" .IX Header "VERSION" Version 0.56 .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. 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 minimal 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 content negotiation. Thus, you can concentrate on URIs for your things, you need not be concerned about minting URLs for the pages to serve it. .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 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 model and a base \s-1URI\s0. Optionally, you may pass a Plack::Request object (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 respons 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 . The latter is very limited at present, all it'll do is use the namespaces if you have \f(CW\*(C`namespaces_as_vocabularies\*(C'\fR enabled, which it is by default. .ie n .IP """BUILD""" 4 .el .IP "\f(CWBUILD\fR" 4 .IX Item "BUILD" Called by Moose to initialize an object. .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. .IP "namespaces ( { skos => 'http://www.w3.org/2004/02/skos/core#', dct => 'http://purl.org/dc/terms/' } )" 4 .IX Item "namespaces ( { skos => 'http://www.w3.org/2004/02/skos/core#', dct => 'http://purl.org/dc/terms/' } )" Gets or sets the namespaces that some serializers use for pretty-printing. .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 a RDF::Helper::Properties object is given as 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 a 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 "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" .IP "\(bu" 4 Use IO::Handle streams when they become available from the serializers. .IP "\(bu" 4 Figure out what needs to be done to use this code in other frameworks, such as Magpie. .IP "\(bu" 4 Make it read-write hypermedia. .IP "\(bu" 4 Use a environment variable for config on the command line? .SH "ACKNOWLEDGEMENTS" .IX Header "ACKNOWLEDGEMENTS" 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 and \s-1ABC\s0 Startsiden \s-1AS\s0, 2010\-2012 Kjetil Kjernsmo .PP This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.