Gregory Todd Williams > RDF-EARL-0.001 > RDF::EARL

Download:
RDF-EARL-0.001.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.001   Source  

NAME ^

RDF::EARL - Generate W3C Evaluation and Report Language (EARL) test reports.

VERSION ^

This document describes RDF::EARL version 0.001.

SYNOPSIS ^

my $earl = RDF::EARL->new('http://thing-being-tested.com/'); $earl->pass('http://example.org/test1'); $earl->pass('http://example.org/test2'); $earl->fail('http://example.org/test3', 'failure explanation'); my $model = $earl->model; # $model is a RDF::Trine::Model containing the test results in EARL format

DESCRIPTION ^

RDF::EARL allows generating test reports using the W3C Evaluation and Report Language (EARL) 1.0 RDF vocabulary.

Test reports are generated by defining a subject (the thing being tested), an assertor (the thing doing the testing), and the result of a number of performed tests. The result can be one of: passed, failed, can't tell, inapplicable, and untested (see the methods below, or the EARL 1.0 documentation for more details).

Once the test results have been asserted, the EARL report data may be accessed in a RDF::Trine::Model. This allows the testing system to augment the test data with supplementary data such as links to or contact information for obtaining more information about the subject, assertor, or testing setup.

Alternatively, the as_string method will return the EARL report RDF data as a string in the Turtle RDF format.

METHODS ^

new ( $subj_iri )
new ( subject => $subj_iri, assertor => $assertor_iri )

Creates a new EARL testing object for asserting results of testing the thing (code, project, etc.) represented by $subj_iri by the testing code represented by $assertor_iri. If the assertor key-value pair is omitted, a default value for the RDF::EARL module will be used by default.

assertor

Returns the RDF::Trine::Node::Resource object representing the thing doing the testing. This is either the IRI passed to the constructor as <assertor> or a RDF::EARL IRI like http://purl.org/NET/cpan-uri/dist/RDF-EARL/v_0-001.

subject

Returns the RDF::Trine::Node::Resource object representing the thing being tested. This is the IRI passed to the constructor as <subject>.

model

Returns the RDF::Trine::Model object containing the EARL result data.

pass ( $test, @comments )

Asserts that the test identifed by the $test IRI was passed by the subject system. If there are any @comments specified, they are asserted as earl:info statements on the respective earl:TestResult node in the result model. Returns the RDF::Trine::Node object corresponding to the just-made assertion.

fail ( $test, @comments )

Asserts that the test identifed by the $test IRI was failed by the subject system. If there are any @comments specified, they are asserted as earl:info statements on the respective earl:TestResult node in the result model. Returns the RDF::Trine::Node object corresponding to the just-made assertion.

cantTell ( $test, @comments )

Asserts that it is unclear if the subject passed or failed the test identifed by the $test IRI. If there are any @comments specified, they are asserted as earl:info statements on the respective earl:TestResult node in the result model. Returns the RDF::Trine::Node object corresponding to the just-made assertion.

inapplicable ( $test, @comments )

Asserts that the test identifed by the $test IRI is not applicable to the subject system. If there are any @comments specified, they are asserted as earl:info statements on the respective earl:TestResult node in the result model. Returns the RDF::Trine::Node object corresponding to the just-made assertion.

untested ( $test, @comments )

Asserts that the test identifed by the $test IRI was not tested by the subject system. If there are any @comments specified, they are asserted as earl:info statements on the respective earl:untested node in the result model. Returns the RDF::Trine::Node object corresponding to the just-made assertion.

as_string

Returns EARL report data as a string formatted as Turtle.

SEE ALSO ^

http://www.w3.org/TR/EARL10-Schema/

AUTHOR ^

 Gregory Todd Williams <gwilliams@cpan.org>

LICENSE ^

Copyright (c) 2012 Gregory Todd Williams. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

syntax highlighting: