James G Smith > RDF-Server-0.08 > RDF::Server::Formatter

Download:
RDF-Server-0.08.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
Report a bug
Source  

NAME ^

RDF::Server::Formatter - handles rendering an object in a particular format

SYNOPSIS ^

 package My::Format;

 use Moose;
 with 'RDF::Server::Formatter';

 sub resource { }

 sub to_rdf { }

DESCRIPTION ^

Formatters handle the translation of documents from the format used by the handlers, model, and resource and the client.

The RDF triple store interface modules work with RDF. If another document format is preferred, then a formatter is needed to translate between the preferred format and RDF.

REQUIRED METHODS ^

wants_rdf : Bool

This should return true if the resource rendering method expects RDF. Otherwise, the resource handler will pass in a Perl data structure. Rendering to data serialization formats such as JSON or YAML will probably prefer a data structure instead of RDF.

resource : Str

This returns the content in the appropriate format given the RDF or data structure representing the information in the triple store.

to_rdf : Str

This should return an RDF document representing the information presented in the format understood by the formatter.

collection : Str

This should return a document representing the items in a collection as well as any categories or domains into which resources are divided.

workspace : Str

This should return a document representing a set of collections.

service : Str

This should return a document representing a set of workspaces.

category : Str

This should return a document representing a domain within a collection.

feed : Str

This should return a document representing a list of resources that result from a query on a collection.

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.