NAME
RDF::Server::Protocol::Embedded - methods to use RDF::Server in another program
SYNOPSIS
package My::Server;
protocol 'Embedded';
semantic ...;
my $service = My::Server -> new( ... );
$service -> create( $uri => $content );
$content = $service -> fetch( $uri );
$service -> update( $uri => $content );
$service -> delete( $uri );
$service -> delete( $uri => $content );
DESCRIPTION
The embedded protocol translates a simple Perl API into a REST-based set of requests that are passed to the interface.
When using the embedded protocol, you do not need to load an interface since the REST interface is already loaded by the protocol.
CONFIGURATION
There is no special configuration specific to this role. See the documentation for the interface and semantic roles for any configuration that might be required.
METHODS
- handle ($method, $uri, $content)
-
Creates the request and passes it to the REST request handler. Returns the resulting response object.
This method is used to implement the other, more specific methods.
- create ($uri, $content)
-
Creates a resource at the given URI. This becomes a POST request internally.
- fetch ($uri)
-
Returns the appropriate document for the given URI. This becomes a GET request internally.
- update ($uri, $content)
-
Merges the provided document with any data already present in the triple store. Internally, this becomes a PUT request.
This will not replace the triples associated with a resource. To completely replace the existing information, first delete the resource and then create a new version with the desired information.
- delete ($uri)
-
This form will remove all information associated with the given URI. Internally, this becomes a DELETE request without a content body.
- delete ($uri, $content)
-
This form will remove only the information contained in the provided content. Internally, this becomes a DELETE request with a content body.
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.