The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

NNexus::Job - Class for Servicing Job Request to NNexus

SYNOPSIS

    use NNexus::Job;
    my $job = NNexus::Job->new(db=>$db,body=>$body,format=>$format,function=>$function,
                               domain=>$domain);
    $job->execute;
    my $response = $job->response;
    my $result = $job->result;
    my $message = $job->message;
    my $status = $job->status;

DESCRIPTION

This class serves as an encapsulation for users' NNexus requests, driven by a minimal API.

METHODS

my $job = NNexus::Job->new(%options);

Creates a new job object, customized via an options hash. Admissible options are: - body: The textual payload to be autolinked/indexed/etc. - format: The format of the given body. Supported: tex|html - function: Operation to be performed. * linkentry: Autolinks a given body returning a result in the same format * index: Indexes a given web resource (URL), given by the "url" option - url: * for function "index": URL at which to begin an indexing job * for function "linkentry": URL to record for change management and invalidation - domain: Domain to use as the reference knowledge base for autolinking/indexing - anntation: serialization format for annotation (links, JSON, RDFa) - embed: boolean for embedded or stand-off annotations - db: An initialized NNexus::DB object (typically internal) - verbosity: boolean switching verbose logging on and off - dom: (optional) overrides the Mojo::DOM object for the given "url" (function=index) - should_update: boolean switching between updating all indexed objects (default) or only indexing new objects instead. (function=index)

$job->execute;

Executes the job prepared by the new method.

$job->response;

Retrieves the job result. Returns a hash ref with three fields: result: the job result (e.g. a payload for a linking job) message: a human-readable description of the job status: a machine-readable status report

$job->result;

Shorthand for $job->response->{result};

$job->status;

Shorthand for $job->response->{status};

$job->message;

Shorthand for $job->response->{message};

AUTHOR

Deyan Ginev <d.ginev@jacobs-university.de>

COPYRIGHT

 Research software, produced as part of work done by 
 the KWARC group at Jacobs University Bremen.
 Released under the MIT License (MIT)