NAME
RDF::Server - toolkit for building RDF servers
SYNOPSIS
# Define basic server behavior:
package My::Server;
use RDF::Server;
with 'MooseX::Daemonize';
interface 'REST';
protocol 'HTTP';
semantic 'Atom';
render xml => 'Atom';
render rss => 'RDF';
# Run server (if daemonizable):
my $daemon = My::Server -> new( ... );
$daemon -> run();
DESCRIPTION
RDF::Server provides a flexible framework with which you can design your own RDF service. By dividing itself into several areas of responsibility, the framework allows you to mix and match any capabilities you need to create the service that fits your RDF data and how you need to access it.
The framework identifies four areas of responsibility:
Protocol
The protocol modules manage the outward facing part of the framework and translating the requested operation into an HTTP::Request object that is understood by any of the interface modules. Conversely, it translates the resulting HTTP::Response object into the form required by the environment in which the server is operating.
For example, the Embedded protocol provides a Perl API that can be used by other modules without having to frame operations in terms of HTTP requests and responses.
The methods expected of protocol modules are defined in RDF::Server::Protocol. The outward-facing API is dependent on the environment the server is expected to operate within.
Available protocols in the standard distribution: RDF::Server::Protocol::Embedded, RDF::Server::Protocol::HTTP.
Interface
The interface modules define how the HTTP requests are translated into operations on various handlers that manage different aspects of the RDF triple store.
Semantic
The semantic modules define the meaning attached to and information contained in the various documents and the heirarchy of resources available through the interface modules. Most of the content handlers are attached to a particular semantic.
The available semantic is: RDF::Server::Semantic::Atom.
Formatters
The same information can be rendered in several different formats. The format modules manage this rendering.
The available formatters are: RDF::Server::Formatter::Atom, RDF::Server::Formatter::JSON, RDF::Server::Formatter::RDF.
CLASS METHODS
In addition to the methods exported by Moose, several helper methods are exported when you use
RDF::Server. These can be used to easily specify the interface or protocol role if the name is ambiguous.
By default, these helpers will search for the appropriate class by prepending the appropriate RDF::Server::
namespace. You may override this by prepending +
to the class name.
The class will be applied to your class as a role. The helper will also make sure that the class provides the appropriate role.
- interface
-
The interface defines how HTTP requests are mapped to actions on resources.
Available interfaces: REST.
Default is RDF::Server::Interface::REST.
- protocol
-
The protocol is how the RDF server communicates with the world.
Available protocols: Embedded, HTTP. (Apache2 and FastCGI are on the TODO list.)
Default is RDF::Server::Protocol::Embedded.
- semantic
-
The server semantic determines how the RDF stores are structured and presented in documents by managing how the handler is configured.
Available semantics: Atom.
Default is RDF::Server::Semantic::Atom.
- render
-
The interface maps file types to formatters using the mappings defined by the
render
method.
OBJECT METHODS
- formatter
-
This will return the formatter for a particular file format as defined by the
render
method.
CONFIGURATION
- default_rendering
-
This determines the default file format when none is provided. The file format should map to a formatter defined by the
render
method in the class definition. - handler
-
This object is used by the interface to find the proper handler for a request. This object must inherit from RDF::Server::Handler.
The server semantic can redefine the handler type and provide a way to configure the handler from a configuration file or Perl data structure.
NAMESPACE DESIGN
The RDF::Server namespace is divided into these broad areas:
- Protocol
-
Modules in RDF::Server::Protocol provide the interface with the world. Examples include HTTP, Apache/mod_perl, and FastCGI.
- Interface
-
RDF::Server::Interface modules determine the type of URI and HTTP method management that is used. RDF::Server comes with a REST interface.
- Semantic
-
RDF::Server::Semantic modules manage the configuration and interpretation of URIs once the Interface module has passed the request on. RDF::Server comes with an Atom semantic of URI heirarchies and configuration.
- Formatter
-
RDF::Server::Formatter modules translate the internal data structures to particular document types. The formatter for a request is selected by the Interface module.
- Model
-
RDF::Server:Model modules interface between the Semantic and Formatter modules and the backend triple store.
- Resource
-
RDF::Server:Resource modules represent particular resources and associated data within a triple store.
SEE ALSO
Moose, RDF::Server::Formatter, RDF::Server::Interface, RDF::Server::Model, RDF::Server::Protocol, RDF::Server::Resource, RDF::Server::Semantic.
AUTHOR
James Smith, <jsmith@cpan.org>
LICENSE
Copyright (c) 2008 Texas A&M University.
This library is free software. You can redistribute it and/or modify it under the same terms as Perl itself.