Test::RDF - Test RDF data for validity and equality
This documentation refers to Test::RDF version 0.0.3
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', );
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).
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.
$FORMAT
rdfxml
turtle
ntriples
$SOURCE
$MESSAGE
rdf_eq does not correctly handle reflexive statements involving bnodes. That is, statements where subject and object are the same blank node.
rdf_eq
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.
Test::RDF requires no configuration files or environment variables.
RDF::Redland
None known
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.
bug-test-rdf at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Test::RDF
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Test-RDF
CPAN Ratings
http://cpanratings.perl.org/d/Test-RDF
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Test-RDF
Search CPAN
http://search.cpan.org/dist/Test-RDF
Dave Beckett for Redland.
Michael Hendricks <michael@palmcluster.org>
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.
To install Test::RDF, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::RDF
CPAN shell
perl -MCPAN -e shell install Test::RDF
For more information on module installation, please visit the detailed CPAN module installation guide.