Branch Coverage

blib/lib/RDF/Query.pm
Criterion Covered Total %
branch 146 240 60.8


line true false branch
203 43 166 if (@_ and ref $_[0]) { }
230 0 209 if ($base_uri)
235 0 209 if ($options{'canonicalize'})
238 15 194 delete $options{'update'} ? :
243 0 209 if (ref $query and $query->isa('RDF::Query::Algebra')) { }
245 0 0 if $query->isa('RDF::Query::Algebra::Ask')
246 0 0 if $query->isa('RDF::Query::Algebra::Construct')
248 0 0 if ($method eq 'SELECT')
249 0 0 unless ($query->isa('RDF::Query::Algebra::Project'))
275 0 209 if (exists $options{'load_data'}) { }
106 103 elsif ($pclass =~ /^RDF::Query::Parser::(RDQL|SPARQL)$/) { }
282 2 207 unless ($parsed->{'triples'})
288 0 207 if (defined $options{'defines'})
292 0 207 if ($options{'logger'})
297 0 207 if (my $opt = delete $options{'optimize'}) { }
304 0 207 if (my $opt = delete $options{'force_no_optimization'})
309 0 207 if (my $time = delete $options{'optimistic_threshold_time'})
315 17 190 if ($pclass eq 'RDF::Query::Parser::RDQL')
337 17 1 if (ref $row) { }
360 1 157 if ($args{'bind'})
365 0 158 if (defined $args{'delegate'})
367 0 0 if ($delegate and not &blessed($delegate))
371 0 158 $args{'strict_errors'} ? :
377 158 0 if ($model) { }
384 100 58 if ($self->{'load_data'})
391 1 157 $model->isa('RDF::Trine::Model::Dataset') ? :
412 157 1 unless $args{'planner_args'}
416 0 158 unless ($plan)
448 42 96 if ($parser->isa('RDF::Query::Parser::SPARQL11')) { }
83 13 elsif ($parser->isa('RDF::Query::Parser::SPARQL')) { }
449 5 37 if ($self->is_update) { }
464 0 138 if ($self->{'options'}{'allow_passthrough'} and $model->supports($lang_iri)) { }
469 0 138 if ($l->is_trace)
510 0 157 if ($self->{'options'}{'plan'})
517 4 153 if ($parsed->{'method'} eq 'DESCRIBE') { }
8 145 elsif ($parsed->{'method'} eq 'ASK') { }
526 19 138 if (wantarray) { }
544 0 0 if ($model) { }
551 0 0 &blessed($gdata) ? :
572 0 0 if (scalar @_)
573 0 0 if (not &blessed($_[0]) and &reftype($_[0]) eq 'ARRAY') { }
606 148 10 unless ($self->{'update'})
607 148 0 if (not exists $self->{'options'}{'rdf.query.plan.delegate'} or $self->{'options'}{'rdf.query.plan.delegate'})
609 0 148 $self->{'update'} ? :
611 0 148 if (scalar @bkeys == 0 and $model->supports($delegate_key))
624 3 155 if (my $b = $self->{'parsed'}{'bindings'})
635 1 5 unless defined $v
650 0 158 if (wantarray) { }
654 0 158 if ($l->is_debug)
696 6 1 if ($v->isa('RDF::Query::Node::Variable')) { }
1 0 elsif ($v->isa('RDF::Query::Node::Resource')) { }
698 6 0 &blessed($node) ? :
699 3 3 unless $seen{$string}++
701 1 0 &blessed($v) ? :
702 1 0 unless $seen{$string}++
717 144 4 if (defined $val) { }
721 4 0 unless @streams
744 5 3 $value ? :
760 429 3 if (scalar @triples == 1 and $triples[0]->isa('RDF::Query::Algebra::GroupGraphPattern') || $triples[0]->isa('RDF::Query::Algebra::Filter') || $triples[0]->isa('RDF::Query::Algebra::Sort') || $triples[0]->isa('RDF::Query::Algebra::Limit') || $triples[0]->isa('RDF::Query::Algebra::Offset') || $triples[0]->isa('RDF::Query::Algebra::Distinct') || $triples[0]->isa('RDF::Query::Algebra::Project') || $triples[0]->isa('RDF::Query::Algebra::Construct') || $triples[0]->isa('RDF::Query::Algebra::Load') || $triples[0]->isa('RDF::Query::Algebra::Clear') || $triples[0]->isa('RDF::Query::Algebra::Create') || $triples[0]->isa('RDF::Query::Algebra::Update')) { }
787 0 48 if $pat->subpatterns_of_type('RDF::Query::Algebra::Clear')
788 0 48 if $pat->subpatterns_of_type('RDF::Query::Algebra::Copy')
789 0 48 if $pat->subpatterns_of_type('RDF::Query::Algebra::Create')
790 0 48 if $pat->subpatterns_of_type('RDF::Query::Algebra::Move')
791 6 42 if $pat->subpatterns_of_type('RDF::Query::Algebra::Update')
805 1 34 unless $parsed->{'namespaces'}
808 4 31 if ($method =~ /^(DESCRIBE|ASK)$/i)
816 0 35 if ($method =~ /^(LOAD|CLEAR|CREATE|UPDATE)$/) { }
821 0 40 $_->isa('RDF::Query::Node::Resource') ? :
822 17 18 if ($pvars eq $svars)
827 0 39 $_ eq '__DEFAULT__' ? :
829 0 35 if (my $ob = $parsed->{'options'}{'orderby'})
832 0 0 $dir eq 'ASC' ? :
837 0 35 if (my $l = $parsed->{'options'}{'limit'})
840 0 35 if (my $o = $parsed->{'options'}{'offset'})
846 29 6 if ($method eq 'SELECT') { }
2 4 elsif ($method eq 'ASK') { }
2 2 elsif ($method eq 'DESCRIBE') { }
854 31 4 scalar @ns ? :
856 35 0 if ($methoddata or $ns) { }
906 1 12 if $base_uri
907 8 5 if $nscount
912 8 5 if ($nscount)
916 1 12 if ($base_uri)
963 1 2 $self->{'parsed'}{'custom_update_dataset'} ? :
983 158 0 ref $self ? :
986 2 156 if (not $store) { }
156 0 elsif ($store->isa('RDF::Trine::Model')) { }
0 0 elsif ($store->isa('RDF::Redland::Model')) { }
0 0 elsif ($store->isa('RDF::Core::Model')) { }
993 0 0 unless (&blessed($model))
1022 13 74 if (ref $sources and &reftype($sources) eq 'ARRAY' and scalar @$sources)
1054 0 334 unless &blessed($v)
1055 44 290 if ($v->isa('RDF::Query::Expression')) { }
263 27 elsif ($v->isa('RDF::Trine::Node::Variable')) { }
27 0 elsif ($v->isa('RDF::Query::Node')) { }
1079 1 1 if (ref $self) { }
1121 0 0 if (&blessed($self))
1145 356 0 if (&blessed($uri) and $uri->isa('RDF::Query::Node::Resource'))
1150 0 356 if (&blessed($uri) and $uri->isa('RDF::Query::Node::Resource'))
1155 257 99 if (ref $self) { }
1161 356 0 if ($func)
1202 0 1 if (scalar @_ == 1)
1207 0 1 if (&blessed($pred))
1208 0 0 if ($pred->can('uri_value')) { }
1225 409 0 if (@_) { }
1227 0 409 if (&blessed($pred))
1228 0 0 if ($pred->can('uri_value')) { }
1253 0 0 unless ($self->{'hooks_once'}{$token}++)
1272 0 0 if (ref $self) { }
1339 16 7 if ($named) { }
1361 58 424 unless $_->isa('RDF::Query::Node::Variable')
1374 0 498 if (@_)
1388 171 194 if (@_)
1392 0 365 unless (defined $model)
1409 0 0 if (my $ua = $self->{'useragent'}) { }
1430 0 0 if (&blessed(my $l = $self->{'logger'}))
1455 0 0 if (&blessed($self)) { }
1467 883 121 unless $seen{$_}++
1486 0 2 if (&blessed($self))
1506 0 209 if (&blessed($self))