Branch Coverage

blib/lib/RDF/Trine/Model.pm
Criterion Covered Total %
branch 134 180 74.4


line true false branch
48 940 5 if (@_) { }
50 1 939 unless &blessed($store)
108 773 0 if (&blessed($store) and $store->can('_begin_bulk_ops'))
123 7224 4 if (&blessed($store) and $store->can('_end_bulk_ops'))
138 1 4105 if (scalar @_)
152 4073 12 if ($args[0]->isa('RDF::Trine::Statement')) { }
154 0 1768 unless (&blessed($n) and $n->isa('RDF::Trine::Node::Resource') || $n->isa('RDF::Trine::Node::Literal') || $n->isa('RDF::Trine::Node::Blank') || $n->isa('RDF::Trine::Node::Nil'))
161 3338 735 if ($self->{'temporary'})
162 1 3337 if ($self->{'added'}++ >= $self->{'threshold'})
166 1 0 if ($store->can('_begin_bulk_ops'))
172 1 0 if ($store->can('_begin_bulk_ops'))
181 3 4070 if (my $log = $self->logger)
183 0 3 if (defined $context)
207 55 23 $s =~ /^_:(.*)$/ ? :
218 34 94 unless (ref $O)
219 0 34 if ($O =~ /^_:/) { }
0 34 elsif ($O =~ /^[a-z0-9._\+-]{1,12}:\S+$/i) { }
7 27 elsif ($O =~ /^(.*)\@([a-z]{2})$/) { }
230 74 54 if (lc $O->{'type'} eq 'literal') { }
236 28 26 $O->{'value'} =~ /^_:(.*)$/ ? :
239 128 0 if ($ts and $tp and $to)
258 0 0 unless (&blessed($iter) and $iter->is_graph)
279 0 0 if (scalar @elements == 0) { }
305 0 291 if ($seen{$head->as_string}++)
309 0 291 if (scalar @n != 1)
335 0 11 if ($seen{$head->as_string}++)
346 0 29 if $statement_type eq 'rdf:type' and not $st->object->equal($rdf->List)
350 3 8 if ($args{'orphan_check'})
351 1 2 if defined $statements{'other'} and scalar @{$statements{'other'};} > 0
352 1 1 if $self->count_statements(undef, undef, $head) > 0
354 1 8 unless (defined $statements{'rdf:first'} and defined $statements{'rdf:rest'} and scalar @{$statements{'rdf:first'};} == 1 and scalar @{$statements{'rdf:rest'};} == 1)
381 0 0 unless (scalar @elem)
384 0 0 if (scalar @elem > 1)
389 0 0 unless &blessed($elem)
405 1 25 if (my $log = $self->logger)
407 0 1 if (defined $context)
423 0 6 if (my $log = $self->logger)
453 3 0 if ($store)
470 0 0 if ($store)
487 58 652 if (scalar @_ >= 4)
489 1 21 if (&blessed($graph) and $graph->isa('RDF::Trine::Node::Resource') and $graph->uri_value eq 'tag:gwilliams@cpan.org,2010-01-01:RT:ALL')
517 2882 6585 unless defined $n
518 6581 4 if &blessed($n) and $n->isa('RDF::Trine::Node')
525 2169 353 if (scalar @_ >= 4)
527 0 803 if (&blessed($graph) and $graph->isa('RDF::Trine::Node::Resource') and $graph->uri_value eq 'tag:gwilliams@cpan.org,2010-01-01:RT:ALL')
558 18 937 $bgp->isa('RDF::Trine::Statement') || $bgp->isa('RDF::Query::Algebra::Filter') ? :
561 5 950 unless (@triples)
570 41 909 if (&blessed($store) and $store->can('get_pattern')) { }
573 903 6 if ($bgp->isa('RDF::Trine::Pattern'))
577 900 9 if (my $ob = $args{'orderby'})
579 1 899 if (scalar(@order) % 2)
598 1 2360 if $rev
599 1450 911 if $r
608 2597 34 if $seen{$var}
633 6 921 $bgp->isa('RDF::Trine::Statement') || $bgp->isa('RDF::Query::Algebra::Filter') ? :
636 918 9 if (1 == scalar @triples) { }
642 3438 104 if ($nodes[$n]->isa('RDF::Trine::Node::Variable'))
646 0 918 if ($context)
653 918 1723 unless $row
676 0 25 unless defined $val_a and defined $val_b
678 12 13 unless ($equal)
706 0 2 if (wantarray) { }
801 0 0 $n->isa('RDF::Trine::Node::Literal') ? :
803 0 0 unless ($seen{$label}++)
838 10 4 if (wantarray) { }
865 8 4 if (wantarray) { }
889 1319 0 @_ % 2 == 0 ? :
891 3 1316 if $options{'language'} or $options{'datatype'}
892 1 1318 if ($options{'datatype'} and not &blessed($options{'datatype'}))
896 6 1313 if (defined $type)
897 6 0 if ($type =~ /^(node|nil|blank|resource|literal|variable)$/) { }
908 30 1321 if (defined $type)
909 16 14 unless $obj->$type
910 3 11 if ($options{'language'}) { }
6 5 elsif ($options{'datatype'}) { }
912 2 1 unless $lang and $lang eq $options{'language'}
915 4 2 unless $dt and $dt eq $options{'datatype'}->uri_value
920 1315 4 if (wantarray) { }
945 0 137 if (not wantarray) { }
971 5 17 unless @statements or @nodes
973 20 13 unless (@statements)
975 3 17 unless scalar @nodes
978 1 16 if $seen{$n->sse}
1005 27 2 if scalar @statements
1007 0 27 unless scalar @statements
1009 9 18 if ($st->object->isa('RDF::Trine::Node::Blank') and not $seen{$st->object->sse})
1013 0 27 if ($st->subject->isa('RDF::Trine::Node::Blank') and not $seen{$st->subject->sse})
1065 0 0 if ($warn)
1071 0 0 if ($warn)
1076 0 0 if ($warn)