NAME
SADI::Simple::OutputModel - a light wrapper around RDF::Trine::Model that simplifies NanoPublications in SADI
SYNOPSIS
my $output_model = SADI::Simple::OutputModel->new();
$output_model->_init( $output_model->_init($implements_ServiceBase);))
DESCRIPTION
There are various things that an output model can do to itself to
automatically generate NanoPublications. This object wraps RDF::Trine::Model
exposing its API, but adding these new functionalities.
All of the functionalities for NanoPublishers will be ignored if present
in a service that does not NanoPublish, so feel free to include them
in your service to avoid having to update the service later when you
decide that NanoPublishing is pretty cool...
SUBROUTINES
add_statement
$output_model->add_statement( $statement, [$input]);
Allows you to add the context for a NanoPubs Assertion named graph.
Second parameter is optional, and can be present but undef in a service
that does not publish nanopubs, but might be a nanopublisher one day.
The $input is the RDF::Trine::Node::Resource that is currently
being analyzed in the service "process it" loop.
nanopublish_result_for
$output_model->nanopublish_result_for($input);
in the context of the "process it" loop of a SADI service, this method
should be invoked at the end of the loop to complete the
NanoPublication of the output from the given $input.
If it is present in a non-NanoPublishing service, it will be ignored.