Branch Coverage

blib/lib/RDF/aREF/Decoder.pm
Criterion Covered Total %
branch 128 142 90.1


line true false branch
53 5 115 if (&blessed($callback) and $callback->isa('RDF::Trine::Model'))
60 1 11 if $@
77 10 92 ref $self->{'ns'} ? :
79 4 98 if (ref $map)
80 3 1 if (ref $map eq 'HASH') { }
82 0 3 if $prefix eq '_'
83 1 2 if (not $prefix =~ /^[a-z][a-z0-9]*$/) { }
1 1 elsif (not $namespace =~ /^[a-z][a-z0-9+.-]*:/) { }
102 102 0 unless ($options{'keep_bnode_map'})
109 30 69 if (exists $map->{'_id'}) { }
113 2 27 if $self->is_null($id, '_id')
115 26 1 $id ne '' ? :
116 22 1 if (defined $subject and $subject ne '') { }
1 0 elsif ($self->{'strict'}) { }
124 73 0 if $_ ne '_'
125 2 69 if $self->is_null($key, 'subject')
128 7 61 unless ($subject)
134 3 58 if (exists $predicates->{'_id'} and ($self->resource($predicates->{'_id'}) // '') ne $subject) { }
149 24 85 if $_ eq '_id' or $_ eq '_ns'
151 0 81 unless my $predicate = do { if ($_ eq 'a') { 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type'; } elsif ($_ =~ /^<(.+)>$/) { $self->iri($1); } elsif ($_ =~ /^([a-z][a-z0-9]*)_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*)$/) { $self->prefixed_name($1, $2); } elsif ($_ =~ /^[a-z][a-z0-9+.-]*:/) { $self->iri($_); } else { $self->error("invalid predicate IRI $_") if $_ ne '' or $self->{'strict'}; next; } }
152 31 54 if ($_ eq 'a') { }
21 33 elsif ($_ =~ /^<(.+)>$/) { }
27 6 elsif ($_ =~ /^([a-z][a-z0-9]*)_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*)$/) { }
4 2 elsif ($_ =~ /^[a-z][a-z0-9+.-]*:/) { }
162 2 0 if $_ ne '' or $self->{'strict'}
170 9 72 ref $value eq 'ARRAY' ? :
171 5 80 if ($self->is_null($o, 'object')) { }
68 12 elsif (not ref $o) { }
10 2 elsif (ref $o eq 'HASH') { }
174 67 0 if (my $object = $self->object($o))
180 5 5 exists $o->{'_id'} ? :
185 7 0 unless (ref $object and $self->{'visited'}{&refaddr($object)})
198 13 181 if (not defined $value or defined $self->{'null'} and $value eq $self->{'null'}) { }
199 4 9 if ($check and $self->{'strict'})
210 24 5 if (my $resource = $self->resource($r)) { }
213 5 0 unless ($self->is_null($r, $expect))
214 2 3 ref $r ? :
224 1 71 unless defined $r
226 21 50 if ($r =~ /^<(.+)>$/) { }
2 48 elsif ($r =~ /^_:([a-zA-Z0-9]+)$/) { }
2 46 elsif ($r =~ /^([a-z][a-z0-9]*)_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*)$/) { }
38 8 elsif ($r =~ /^[a-z][a-z0-9+.-]*:/) { }
242 0 69 unless defined $s
244 57 12 if ($s =~ /^[a-z][a-z0-9+.-]*:/) { }
2 10 elsif ($s =~ /^([a-z][a-z0-9]*)_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*)$/) { }
3 7 elsif ($s =~ /^_:([a-zA-Z0-9]+)$/) { }
258 0 133 if (not defined $o) { }
7 126 elsif ($o =~ /^<(.+)>$/) { }
3 123 elsif ($o =~ /^_:([a-zA-Z0-9]+)$/) { }
21 102 elsif ($o =~ /^([a-z][a-z0-9]*)_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*)$/) { }
22 80 elsif ($o =~ /^(.*)@([a-z]{2,8}(-[a-z0-9]{1,8})*)$/i) { }
23 57 elsif ($o =~ /^(.*)[\@]$/) { }
16 41 elsif ($o =~ /^(.*?)[\^] ((([a-z][a-z0-9]*)?_([A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}][A-Z_a-z\N{U+00C0}-\N{U+00D6}\N{U+00D8}-\N{U+00F6}\N{U+00F8}-\N{U+02FF}\N{U+0370}-\N{U+037D}\N{U+037F}-\N{U+1FFF}\N{U+200C}-\N{U+200D}\N{U+2070}-\N{U+218F}\N{U+2C00}-\N{U+2FEF}\N{U+3001}-\N{U+D7FF}\N{U+F900}-\N{U+FDCF}\N{U+FDF0}-\N{U+FFFD}\N{U+10000}-\N{U+EFFFF}0-9\-\.\N{U+00B7}\N{U+0300}-\N{U+036F}\N{U+203F}-\N{U+2040}]*))|<([a-z][a-z0-9+.-]*:.*)>)$/x) { }
29 12 elsif ($o =~ /^[a-z][a-z0-9+.-]*:/) { }
271 6 10 if ($6) { }
273 2 4 if ($datatype eq 'http://www.w3.org/2001/XMLSchema#string') { }
280 3 6 if ($datatype eq 'http://www.w3.org/2001/XMLSchema#string') { }
296 2 4 if @$obj == 1
303 1 245 if (not $iri =~ /^[a-z][a-z0-9+.-]*:/) { }
312 5 0 $prefix // !1 ? :
321 6 68 ref $_[0] ? :
324 10 64 if ref $object[0]
333 8 26 if (defined $value)
334 0 8 ref $value ? :
337 0 34 if (not $self->{'complain'}) { }
1 33 elsif ($self->{'complain'} == 1) { }
347 1 1 if @_ > 1
356 8 5 if (defined $id) { }
380 5 17 substr($_[0], 0, 2) eq '_:' ? :
381 15 7 if (@_ == 3) { }
382 5 10 if (substr($_[2], 0, 2) eq '_:') { }