Branch Coverage

blib/lib/RDF/NLP/SPARQLQuery/Query.pm
Criterion Covered Total %
branch 86 228 37.7


line true false branch
123 54 0 if (@_)
137 54 0 if (@_)
151 0 12 if (@_)
170 11 1 unless (defined $wherePart)
193 0 0 if ($position eq 'last')
196 0 0 if ($position eq 'first')
217 11 0 if ($position eq 'last')
220 0 11 if ($position eq 'first')
240 1 0 if ($position eq 'last')
244 0 1 if ($position eq 'first')
261 0 0 if ($position eq 'last')
264 0 0 if ($position eq 'first')
283 0 0 if ($position eq 'last')
286 0 0 if ($position eq 'first')
307 81 0 if ($self->verbose == 0)
313 0 0 if ($$line{'SUBJECT'}[1] ne '') { }
319 0 0 if ($$line{'PREDICATE'}[1] ne '') { }
325 0 0 if ($$line{'OBJECT'}[1] ne '') { }
360 0 9 if ($self->conjunction == 1)
416 9 0 if ($$line{'SUBJECT'}[1] eq '')
418 7 2 if ($self->questionTopic eq $$line{'SUBJECT'}[0])
430 0 35 if (exists $self->aggregation->{'QT'}{$aggregOp}{$self->questionTopic})
438 2 0 if ($$line{'OBJECT'}[1] eq '')
441 2 0 if ($self->questionTopic eq $$line{'OBJECT'}[0])
454 0 10 if (exists $self->aggregation->{'QT'}{$aggregOp}{$self->questionTopic})
477 12 0 unless (exists $invnegation{$i})
479 1 11 if ($$line{'SUBJECT'}[1] eq '')
482 0 0 if ($self->questionTopic eq $$line{'SUBJECT'}[0] or exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} eq $self->questionTopic or exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$self->questionTopic} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$self->questionTopic} eq $$line{'SUBJECT'}[0])
488 0 1 if (scalar @{$self->selectPart;} == 0) { }
499 0 5 if (exists $self->aggregation->{'QT'}{$aggregOp}{$self->questionTopic})
506 1 11 if ($$line{'OBJECT'}[1] eq '')
509 0 1 if ($self->questionTopic eq $$line{'OBJECT'}[0] or exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} eq $self->questionTopic or exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$self->questionTopic} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$self->questionTopic} eq $$line{'OBJECT'}[0])
515 0 0 if (scalar @{$self->selectPart;} == 0) { }
526 0 0 if (exists $self->aggregation->{'QT'}{$aggregOp}{$self->questionTopic})
545 0 9 if (scalar keys %{$self->negation;} > 0)
547 0 0 if (scalar @{$self->wherePart;} == 1)
555 0 0 if ($self->wherePart->[$lineNb]{'SUBJECT'}[1] eq $self->selectPart->[0]) { }
0 0 elsif ($self->wherePart->[$lineNb]{'OBJECT'}[1] eq $self->selectPart->[0]) { }
583 3 8 if ($$line{'SUBJECT'}[1] eq '')
586 1 0 if (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} eq $$line2{'SUBJECT'}[0]) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'SUBJECT'}[0]} eq $$line2{'OBJECT'}[0]) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'SUBJECT'}[0]} and $$line{'SUBJECT'}[0] eq $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'SUBJECT'}[0]}) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'OBJECT'}[0]} and $$line{'SUBJECT'}[0] eq $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'OBJECT'}[0]}) { }
609 1 10 if ($$line{'OBJECT'}[1] eq '')
612 0 0 if (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} eq $$line2{'SUBJECT'}[0]) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} and $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line{'OBJECT'}[0]} eq $$line2{'OBJECT'}[0]) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'OBJECT'}[0]} and $$line{'OBJECT'}[0] eq $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'OBJECT'}[0]}) { }
0 0 elsif (exists $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'SUBJECT'}[0]} and $$line{'OBJECT'}[0] eq $self->semanticCorrespondance->{$self->language}{'SAMEAS'}{'CORRESP'}{$$line2{'SUBJECT'}[0]}) { }
652 6 17 if ($$line{'SUBJECT'}[1] eq '')
655 1 3 if ($$line2{'SUBJECT'}[1] eq '' and $$line{'SUBJECT'}[0] eq $$line2{'SUBJECT'}[0]) { }
1 4 elsif ($$line2{'OBJECT'}[1] eq '' and $$line{'SUBJECT'}[0] eq $$line2{'OBJECT'}[0]) { }
670 2 21 if ($$line{'OBJECT'}[1] eq '')
673 0 0 if ($$line2{'SUBJECT'}[1] eq '' and $$line{'OBJECT'}[0] eq $$line2{'SUBJECT'}[0]) { }
0 0 elsif ($$line2{'OBJECT'}[1] eq '' and $$line{'OBJECT'}[0] eq $$line2{'OBJECT'}[0]) { }
705 0 12 if ($$line{'SUBJECT'}[1] eq '')
711 0 12 if ($$line{'OBJECT'}[1] eq '')
737 0 12 if ($$line{'SUBJECT'}[1] eq '' and $$line{'SUBJECT'}[0] eq 'STRING')
745 0 0 if (exists $self->semFeaturesIndex->{$indexCat}{'TERM'}{$$term{'id'}} and ($self->semFeaturesIndex->{$indexCat}{'SEEN_S'} == -1 and $self->semFeaturesIndex->{$indexCat}{'SEEN_O'} == -1))
748 0 0 if ($self->_regexForm == 1) { }
754 0 0 if ($self->conjunction == 1)
757 0 0 if ($$term2{'id'} ne $$term{'id'})
759 0 0 if ($self->_regexForm == 1) { }
773 0 0 if ($found == 1)
778 1 11 if ($$line{'OBJECT'}[1] eq '' and $$line{'OBJECT'}[0] eq 'STRING')
786 1 0 if (exists $self->semFeaturesIndex->{$indexCat}{'TERM'}{$$term{'id'}} and ($self->semFeaturesIndex->{$indexCat}{'SEEN_S'} == -1 and $self->semFeaturesIndex->{$indexCat}{'SEEN_O'} == -1))
789 1 0 if ($self->_regexForm == 1) { }
795 0 1 if ($self->conjunction == 1)
798 0 0 if ($$term2{'id'} ne $$term{'id'})
800 0 0 if ($self->_regexForm == 1) { }
814 1 0 if ($found == 1)
840 9 2 if ($self->semanticCorrespondance->{$self->language}{'PREDICATE'}{$$line{'PREDICATE'}[0]}{'OBJECT_TYPE'} ne '' and $$line{'OBJECT'}[1] eq '')
846 8 1 if (exists $self->semFeaturesIndex->{$tmp} and $self->semFeaturesIndex->{$tmp}{'SEEN_O'} == -1)
852 6 2 if (exists $self->semanticCorrespondance->{$self->language}{'RESOURCE'}{$self->semFeaturesIndex->{$tmp}{'ROOT'}}{'ROOT'}) { }
868 0 8 if ($self->conjunction == 1)
872 0 0 if ($t[0] eq 'drug' and $self->_unionOpt == 1)
879 0 0 if ($semCat ne join('/', @t))
895 4 7 if ($self->semanticCorrespondance->{$self->language}{'PREDICATE'}{$$line{'PREDICATE'}[0]}{'SUBJECT_TYPE'} ne '' and $$line{'SUBJECT'}[1] eq '')
899 1 0 if (exists $self->semFeaturesIndex->{$tmp} and $self->semFeaturesIndex->{$tmp}{'SEEN_S'} == -1 and $replacedPredicate == 0)
910 0 1 if ($self->conjunction == 1)
914 0 0 if ($t[0] eq 'drug' and $self->_unionOpt == 1)
921 0 0 if ($semCat ne join('/', @t))
1023 0 9 if ($$aggregation{'ASK'} == 1) { }
1028 9 0 if (scalar @{$self->selectPart;} >= 1) { }
1029 9 0 if (scalar @$wherePart != 0) { }
1033 0 9 if (exists $$aggregation{'QTVAR'}{'count'} and exists $$aggregation{'QTVAR'}{'count'}{$self->selectPart->[0]}) { }
1036 0 0 if (exists $$aggregation{'QTVAR'}{'distinct'}{$self->selectPart->[0]} and not exists $$aggregation{'QTVAR'}{'per'}{$self->selectPart->[0]}) { }
1040 0 0 if ($embeded == 1) { }
1056 9 0 if (scalar @{$self->union;} == 0) { }
1076 0 0 if (exists $$aggregation{'QTVAR'}{'count'}{$self->selectPart->[0]} and !exists($$aggregation{'QTVAR'}{'distinct'}{$self->selectPart->[0]}) || exists $$aggregation{'QTVAR'}{'per'}{$self->selectPart->[0]})
1106 0 12 if (exists $$aggregation{'PREDICATE'}{$$line{'PREDICATE'}[0]})
1112 0 12 if ($$line{'NEGATION'} == 1)
1117 0 12 if ($$line{'NEGATION'} == 1)
1140 0 0 if ($aggregOp ne 'count' and $aggregOp ne 'distinct')
1141 0 0 if (exists $self->semanticCorrespondance->{$self->language}{'VARIABLE'}{$$line{'PREDICATE'}[0]} and $self->semanticCorrespondance->{$self->language}{'VARIABLE'}{$$line{'PREDICATE'}[0]} eq 'INT') { }
1144 0 0 if ($$line{'SUBJECT'}[0] eq 'INT') { }
0 0 elsif ($$line{'OBJECT'}[0] eq 'INT') { }
1159 0 0 if ($$line{$aggregRole}[0] eq 'INT')
1173 0 0 if ($aggregOp eq 'min' or $aggregOp eq 'max')
1206 12 0 if (defined $$line{'SUBJECT'})
1210 12 0 if (defined $$line{'PREDICATE'})
1214 12 0 if (defined $$line{'OBJECT'})
1228 0 36 if ($$queryElement[1] =~ /:NODEREGEX:/) { }
1 35 elsif ($$queryElement[1] =~ /:LABELREGEX:/) { }
20 15 elsif ($$queryElement[1] =~ /^http:/) { }
0 15 elsif ($$queryElement[1] =~ m[^const/(?.*)]) { }
14 1 elsif ($$queryElement[1] =~ /^\?/) { }
0 1 elsif ($$queryElement[1] =~ /^rdf/) { }
1 0 elsif ($$queryElement[1] =~ /^STRING/) { }
0 0 elsif ($$queryElement[1] =~ /^\"/) { }
1231 0 0 if (not exists $$regexvar{$$queryElement[1]}) { }
1244 1 0 if (not exists $$regexvar{$$queryElement[1]}) { }
1276 148 76 unless (defined $level)
1280 0 224 if ($self->verbose > 0 and $self->verbose >= $level)
1310 0 2 if ($response->is_success) { }