++ed by:
TOBYINK

1 PAUSE user
1 non-PAUSE user.

Michael Hendricks
and 1 contributors

NAME

Test::RDF - Test RDF data for validity and equality

VERSION

This documentation refers to Test::RDF version 0.0.3

SYNOPSIS

    use Test::More tests => 3;
    use Test::RDF;
    
    rdf_ok( rdfxml => 'data.rdf', 'data validity' );
    rdf_eq( rdfxml => 'data.rdf', turtle => 'data.ttl', 'XML==Turtle' );
    
    rdf_eq(
        ntriples => \'_:a <http://example.org> "literal .',
        turtle   => \' [] <http://example.org> "literal .',
        'ntriples and turtle blank node equivalence',
    );

DESCRIPTION

Test::RDF is used for testing RDF data in various formats. Currently, Test::RDF exports two functions "rdf_ok" (check the validity of various RDF serialization formats) and "rdf_eq" (check for RDF graph equivalence).

SUBROUTINES

rdf_eq

    Arguments: $FORMAT, $SOURCE, $FORMAT, $SOURCE [, $MESSAGE]

Compares the RDF graphs created by the two RDF serializations for graph equivalence. RDF graph equivalence is defined by the RDF Concepts and Abstract Syntax document here: http://www.w3.org/TR/rdf-concepts/#section-graph-equality. If the two graphs are equivalent, the test passes. If the two graphs are not equivalent, the test fails with a helpful diagnostic message.

The $FORMAT arguments should be one of: rdfxml, turtle or ntriples (actually, you can use any format allowed by your version of RDF::Redland::Parser). $SOURCE should be either the path to a file or a reference to a scalar containing RDF data in the specified format. $MESSAGE is an optional message to use when displaying the "ok" or "not ok" message.

rdf_eq does not correctly handle reflexive statements involving bnodes. That is, statements where subject and object are the same blank node.

rdf_ok

    Arguments: $FORMAT, $SOURCE [, $MESSAGE]

$FORMAT specifies the expected format of the RDF file. It should be one of: rdfxml, turtle or ntriples (actually, you can use any format allowed by your version of RDF::Redland::Parser but those three are the most commonly useful). $SOURCE should be either the path to a file or a reference to a scalar containing RDF data in the specified format. $MESSAGE is an optional message to use when displaying the "ok" or "not ok" message.

CONFIGURATION AND ENVIRONMENT

Test::RDF requires no configuration files or environment variables.

DEPENDENCIES

  • RDF::Redland

INCOMPATIBILITIES

None known

BUGS AND LIMITATIONS

Please report any bugs or feature requests to bug-test-rdf at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-RDF. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc Test::RDF

You can also look for information at:

ACKNOWLEDGEMENTS

Dave Beckett for Redland.

AUTHOR

Michael Hendricks <michael@palmcluster.org>

LICENSE AND COPYRIGHT

Copyright (c) 2006 Michael Hendricks (<michael@palmcluster.org>). All rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.