File: 02parse_and_serialise.t

package info (click to toggle)
librdf-trinex-functions-perl 0.002-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 340 kB
  • sloc: perl: 3,541; makefile: 14
file content (15 lines) | stat: -rw-r--r-- 437 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use Test::More tests => 2;

use RDF::Trine;
use RDF::TrineX::Functions
	parse     => {},
	serialize => { -type => RDF::Trine::Serializer::NTriples::Canonical->new };

my $in    = "<http://example.com/s> <http://example.com/p> <http://example.com/o> .\r\n";
my $model = parse($in, as => 'NTriples', base => 'http://example.net/');

is($model->count_statements, 1, "rdf_parse OK");

my $type;

is(serialize($model), $in, "rdf_string OK");