Source

p5-moosex-semantic / t / rdf_import / import_all.t

use Test::More tests => 5;
use RDF::Trine;
use MooseX::Semantic::Test::StrictPerson;

my $model = RDF::Trine::Model->new;
RDF::Trine::Parser::Turtle
	->new
	->parse_file_into_model('http://example.com/', 't/data/multiple_persons.ttl', $model);

my @people = 
	sort { $a->name cmp $b->name }
	MooseX::Semantic::Test::StrictPerson->import_all_from_model($model);

is(scalar @people, 4, "Correct number of people found.");
is($people[0]->name, "Alice");
is($people[1]->name, "Bob");
is($people[2]->name, "Carol");
is($people[3]->name, "Dave");