NAME
Plack::App::DAIA - DAIA Server as Plack application
VERSION
version 0.2
SYNOPSIS
package Your::App;
use parent 'Plack::App::DAIA';
sub retrieve {
my ($self, $id) = @_;
my $daia = DAIA::Response->new();
# construct DAIA object
return $daia;
};
1;
DESCRIPTION
This module implements a DAIA server as PSGI application. It provides serialization in DAIA/XML and DAIA/JSON and automatically adds some warnings and error messages. The core functionality must be implemented by deriving from this class and implementing the method retrieve. The following serialization formats are supported by default:
- xml
-
DAIA/XML format (default)
- json
-
DAIA/JSON format
- rdfjson
-
DAIA/RDF in RDF/JSON.
In addition you get DAIA/RDF in several RDF formats (rdfxml, turtle, and ntriples if RDF::Trine is installed. If RDF::NS is installed, you also get known namespace prefixes for RDF/Turtle format. Furthermore the output formats svg and dot are supported if RDF::Trine::Exporter::GraphViz is installed to visualize RDF graphs.
METHODS
new ( [%options] )
Creates a new DAIA server. Known options are
- xslt
-
Path of a DAIA XSLT client to attach to DAIA/XML responses.
- xsd
-
Path of a DAIA XML Schema to validate DAIA/XML response.
- warnings
-
Enable warnings in the DAIA response (enabled by default).
retrieve ( $id )
Must return a status and a DAIA::Response object. Override this method if you derive an application from Plack::App::DAIA.
as_psgi ( $status, $daia [, $format [, $callback ] ] )
Serializes a DAIA::Response in some DAIA serialization format (xml by default) and returns a a PSGI response with given HTTP status code.
call
Core method of the Plack::Component. You should not need to override this.
SEE ALSO
AUTHOR
Jakob Voss
COPYRIGHT AND LICENSE
This software is copyright (c) 2011 by Jakob Voss.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.