Branch Coverage

blib/lib/RDF/Query/Functions/SPARQL.pm
Criterion Covered Total %
branch 160 406 39.4


line true false branch
142 6 1 if (&blessed($node) and $node->isa('RDF::Trine::Node::Literal')) { }
145 2 4 if ($type eq 'http://www.w3.org/2001/XMLSchema#boolean') { }
2 2 elsif ($node->is_numeric_type) { }
2 0 elsif (&looks_like_number($value)) { }
146 1 1 $value eq 'true' ? :
148 0 2 if ($type eq 'http://www.w3.org/2001/XMLSchema#double') { }
1 1 elsif (int $value != $value) { }
156 0 2 if ($value =~ /[eE]/) { }
0 2 elsif (int $value != $value) { }
177 22 1 if ($node->is_literal) { }
180 2 20 if ($type eq 'http://www.w3.org/2001/XMLSchema#boolean') { }
1 19 elsif ($node->is_numeric_type) { }
19 0 elsif (&looks_like_number($value)) { }
181 1 1 $value eq 'true' ? :
183 0 1 if ($type eq 'http://www.w3.org/2001/XMLSchema#double') { }
189 0 19 if ($value =~ /[eE]/)
208 31 1 if ($node->is_literal) { }
1 0 elsif ($node->is_resource) { }
211 2 29 if ($type eq 'http://www.w3.org/2001/XMLSchema#boolean') { }
19 10 elsif ($node->is_numeric_type) { }
9 1 elsif (not $node->has_datatype) { }
1 0 elsif (not $node->is_numeric_type) { }
212 1 1 $value eq 'true' ? :
216 9 0 if (&looks_like_number($value)) { }
239 4 1 if ($node->is_literal) { }
1 0 elsif ($node->is_resource) { }
0 0 elsif ($node->is_blank) { }
242 2 2 if ($type eq 'http://www.w3.org/2001/XMLSchema#boolean') { }
1 1 elsif ($node->is_numeric_type) { }
0 1 elsif (not $node->has_datatype) { }
1 0 elsif (not $node->is_numeric_type) { }
243 1 1 $value eq 'true' ? :
247 0 0 if (&looks_like_number($value)) { }
273 117 0 if ($node->is_literal) { }
0 0 elsif ($node->is_resource) { }
274 0 117 if ($node->is_numeric_type) { }
117 0 elsif ($node->has_datatype) { }
276 0 0 if $value
277 0 0 unless $value
281 117 0 if ($type eq 'http://www.w3.org/2001/XMLSchema#boolean') { }
282 69 48 $value eq 'true' ? :
290 0 0 length $value ? :
307 4 1 if ($node->is_literal) { }
308 2 2 if ($node->is_numeric_type) { }
2 0 elsif ($node->has_datatype) { }
310 1 1 if ($value) { }
318 1 1 if ($value eq 'true') { }
0 1 elsif ($value eq 'false') { }
327 0 0 if ($value eq 'true') { }
0 0 elsif ($value eq 'false') { }
346 3 5 if ($node->is_literal) { }
5 0 elsif ($node->is_resource) { }
363 2 3 ref $query ? :
365 1 4 unless ($value =~ /-?\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d([.]\d+)?(Z|[-+]\d\d:\d\d)?/)
369 4 0 if ($dt) { }
385 0 16 unless (&blessed($node))
389 6 10 if ($node->is_literal) { }
9 1 elsif ($node->is_resource) { }
408 0 0 unless (&blessed($str) and $str->isa('RDF::Query::Node::Literal') and &blessed($dt) and $dt->isa('RDF::Query::Node::Resource'))
412 0 0 unless ($str->is_simple_literal)
429 0 0 unless (&blessed($str) and $str->isa('RDF::Query::Node::Literal') and &blessed($lang) and $lang->isa('RDF::Query::Node::Literal'))
433 0 0 unless ($str->is_simple_literal)
449 0 1 unless (&blessed($node))
455 1 0 if ($node->is_literal) { }
0 0 elsif ($node->is_resource) { }
470 3 0 if (@_) { }
472 0 3 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
476 1 2 if (my $bnode = $query->{'_query_row_cache'}{'sparql:bnode'}{$value}) { }
508 16 3 if (defined $arg)
512 6 10 $value->literal_value eq 'true' ? :
519 3 16 unless defined $arg
520 6 10 if ($bool)
524 0 3 if ($error) { }
553 13 3 if (defined $arg)
557 9 4 $value->literal_value eq 'true' ? :
564 3 13 unless defined $arg
565 4 9 unless ($bool)
569 0 3 if ($error) { }
597 0 4 unless (&blessed($node))
608 6 2 if (defined $arg)
612 2 3 $value->literal_value eq 'true' ? :
619 2 6 unless defined $arg
620 2 4 if ($bool)
621 1 1 if ($op eq 'notin') { }
628 0 2 if ($error) { }
632 1 1 if ($op eq 'notin') { }
646 1 2 if (&blessed($node)) { }
659 5 3 if ($node->isa('RDF::Trine::Node::Resource')) { }
673 2 5 if ($node->isa('RDF::Trine::Node::Blank')) { }
687 1 2 if ($node->isa('RDF::Trine::Node::Literal')) { }
701 18 1 if ($node->is_literal) { }
702 5 13 $node->has_language ? :
723 0 6 if ($match eq '*') { }
725 0 0 $lang ? :
727 2 4 I18N::LangTags::is_dialect_of($lang, $match) ? :
740 0 3 if ($nodea->isa('RDF::Trine::Node::Resource')) { }
0 3 elsif ($nodea->isa('RDF::Trine::Node::Blank')) { }
3 0 elsif ($nodea->isa('RDF::Trine::Node::Literal') and $nodeb->isa('RDF::Trine::Node::Literal')) { }
745 1 2 if ($nodea->literal_value ne $nodeb->literal_value) { }
0 2 elsif (not $nodea->has_language == $nodeb->has_language) { }
0 2 elsif (not $nodea->has_datatype == $nodeb->has_datatype) { }
2 0 elsif ($nodea->has_datatype or $nodeb->has_datatype) { }
0 0 elsif ($nodea->has_language or $nodeb->has_language) { }
752 1 1 if ($nodea->literal_datatype ne $nodeb->literal_datatype) { }
758 0 0 if ($nodea->literal_value_language ne $nodeb->literal_value_language) { }
768 1 2 $bool ? :
780 0 8 unless (&blessed($node) and $node->isa('RDF::Query::Node'))
783 8 0 if ($node->is_literal) { }
784 0 8 if ($node->has_language) { }
5 3 elsif ($node->has_datatype) { }
807 0 13 unless ($node->is_literal)
813 0 13 if (index($pattern, '(?{') != -1 or index($pattern, '(??{') != -1)
816 1 12 if (@_)
819 0 1 unless ($flags =~ /^[smix]*$/)
825 10 3 $text =~ /$pattern/ ? :
841 0 4 unless &blessed($context)
846 1 3 if (my $row = $plan->next) { }
862 5 6 if (&blessed($node))
875 0 0 if ($node->isa('RDF::Query::Node::Literal') and $node->is_numeric_type and $node->is_valid_lexical_form)
888 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal') and $node->is_numeric_type) { }
904 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal') and $node->is_numeric_type) { }
920 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal') and $node->is_numeric_type) { }
936 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal') and $node->is_numeric_type) { }
939 0 0 if ($value < 0)
963 0 0 unless ($n->isa('RDF::Query::Node::Literal'))
966 0 0 if ($n->has_datatype) { }
0 0 elsif ($n->has_language) { }
969 0 0 if ($dt ne 'http://www.w3.org/2001/XMLSchema#string')
974 0 0 if (defined $lang and $lang ne $n->literal_value_language) { }
986 0 0 if ($all_lang) { }
0 0 elsif ($all_str) { }
1004 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1012 0 0 unless (&blessed($arg) and $arg->isa('RDF::Query::Node::Literal') and $arg->is_numeric_type)
1019 0 0 scalar @nums > 1 ? :
1031 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal')) { }
1047 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal')) { }
1063 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal')) { }
1110 0 0 if (&blessed($node) and $node->isa('RDF::Query::Node::Literal')) { }
1126 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1129 0 0 unless (&blessed($pat) and $pat->isa('RDF::Query::Node::Literal'))
1134 0 0 if ($node->has_language and $pat->has_language)
1135 0 0 if ($node->literal_value_language ne $pat->literal_value_language)
1143 0 0 if ($pos >= 0) { }
1158 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1161 0 0 unless (&blessed($pat) and $pat->isa('RDF::Query::Node::Literal'))
1166 0 0 if ($node->has_language and $pat->has_language)
1168 0 0 if ($node->literal_value_language ne $pat->literal_value_language)
1173 0 0 if (index($node->literal_value, $pat->literal_value) == 0) { }
1188 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1191 0 0 unless (&blessed($pat) and $pat->isa('RDF::Query::Node::Literal'))
1196 0 0 if ($node->has_language and $pat->has_language)
1198 0 0 if ($node->literal_value_language ne $pat->literal_value_language)
1206 0 0 if (rindex($lit, $plit) == $pos) { }
1291 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1295 0 0 if ($dt) { }
1309 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1313 0 0 if ($dt) { }
1327 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1331 0 0 if ($dt) { }
1345 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1349 0 0 if ($dt) { }
1363 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1367 0 0 if ($dt) { }
1381 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1385 0 0 if ($dt) { }
1399 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1403 0 0 if ($dt)
1405 0 0 if ($tz->is_floating)
1408 0 0 if ($tz)
1411 0 0 if ($offset < 0)
1417 0 0 if ($offset >= 3600)
1419 0 0 if $h > 0
1422 0 0 if ($offset >= 60)
1424 0 0 if $m > 0
1428 0 0 if $s > 0 or $duration eq 'PT'
1443 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1447 0 0 if ($dt)
1449 0 0 if ($tz->is_floating)
1452 0 0 if ($tz->is_utc)
1455 0 0 if ($tz) { }
1460 0 0 if ($offset < 0)
1465 0 0 if ($offset >= 3600)
1469 0 0 if ($offset >= 60)
1503 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1506 0 0 unless (&blessed($substr) and $substr->isa('RDF::Query::Node::Literal'))
1509 0 0 if ($node->has_datatype and $node->literal_datatype ne 'http://www.w3.org/2001/XMLSchema#string')
1517 0 0 if ($lhs_simple || $lhs_xsd and $rhs_simple || $rhs_xsd) { }
0 0 elsif ($node->has_language and $substr->has_language and $node->literal_value_language eq $substr->literal_value_language) { }
0 0 elsif ($node->has_language and $rhs_simple || $rhs_xsd) { }
1530 0 0 if ($i < 0) { }
1545 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1548 0 0 unless (&blessed($substr) and $substr->isa('RDF::Query::Node::Literal'))
1551 0 0 if ($node->has_datatype and $node->literal_datatype ne 'http://www.w3.org/2001/XMLSchema#string')
1559 0 0 if ($lhs_simple || $lhs_xsd and $rhs_simple || $rhs_xsd) { }
0 0 elsif ($node->has_language and $substr->has_language and $node->literal_value_language eq $substr->literal_value_language) { }
0 0 elsif ($node->has_language and $rhs_simple || $rhs_xsd) { }
1572 0 0 if ($i < 0) { }
1588 0 0 unless (&blessed($node) and $node->isa('RDF::Query::Node::Literal'))
1591 0 0 unless (&blessed($pat) and $pat->isa('RDF::Query::Node::Literal'))
1594 0 0 unless (&blessed($rep) and $rep->isa('RDF::Query::Node::Literal'))
1597 0 0 if ($node->has_datatype and $node->literal_datatype ne 'http://www.w3.org/2001/XMLSchema#string')
1603 0 0 if (index($pattern, '(?{') != -1 or index($pattern, '(??{') != -1)
1606 0 0 if (index($replace, '(?{') != -1 or index($replace, '(??{') != -1)