| 1 | 11 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | 11 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | package DAIA::Entity; | ||||||||||||||||||||||||||||
| 4 | #ABSTRACT: Abstract base class of Department, Institution, Storage, and Limitation | ||||||||||||||||||||||||||||
| 5 | 11 | our $VERSION = '0.43'; #VERSION | |||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 11 | ▶ | use Data::Validate::URI qw(is_uri is_web_uri); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 11 | ▶ | use base 'DAIA::Object'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | our %PROPERTIES = ( | ||||||||||||||||||||||||||||
| 11 | content => { | ||||||||||||||||||||||||||||
| 12 | default => '', | ||||||||||||||||||||||||||||
| 13 | 53 | ▶ | filter => sub { defined $_[0] ? "$_[0]" : "" }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.6
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 14 | }, | ||||||||||||||||||||||||||||
| 15 | href => { | ||||||||||||||||||||||||||||
| 16 | 26 | ▶ | filter => sub { my $v = "$_[0]"; $v =~ s/^\s+|\s$//g; is_web_uri($v) ? $v : undef; }, | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | }, | ||||||||||||||||||||||||||||
| 18 | id => { | ||||||||||||||||||||||||||||
| 19 | 29 | ▶ | filter => sub { my $v = "$_[0]"; $v =~ s/^\s+|\s$//g; is_uri($v) ? $v : undef; } | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 11 | ); | |||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | 42 | ▶ | sub _buildargs { | ||||||||||||||||||||||||||
|
Subroutine
_buildargs: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||
| 24 | 42 | shift; | |||||||||||||||||||||||||||
| 25 | 42 | ▶ | return @_ % 2 ? (content => @_) : @_; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 0 | ▶ | sub rdfhash { | ||||||||||||||||||||||||||
|
Subroutine
rdfhash: not called CC=6 SCAR=37.4
Pod
documented
| |||||||||||||||||||||||||||||
| 29 | 0 | my $self = shift; | |||||||||||||||||||||||||||
| 30 | |||||||||||||||||||||||||||||
| 31 | # plain literal | ||||||||||||||||||||||||||||
| 32 | return { type => 'literal', value => $self->{content} } | ||||||||||||||||||||||||||||
| 33 | 0 | ▶ | unless $self->{id} or $self->{href}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
$self->{"id"} or $self->{"href"}
MC/DC0%0/2
$self->{"id"} or $self->{"href"}
$self->{"id"}
$self->{"href"}
Truth table0%0/3
A or B
A= $self->{"id"}B= $self->{"href"}
| |||||||||||||||||||||||||||||
| 34 | |||||||||||||||||||||||||||||
| 35 | 0 | ▶ | my $me = { 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' => [{ | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 36 | type => 'uri', value => $self->rdftype | ||||||||||||||||||||||||||||
| 37 | }] } if $self->rdftype ; | ||||||||||||||||||||||||||||
| 38 | |||||||||||||||||||||||||||||
| 39 | $me->{'http://www.w3.org/2000/01/rdf-schema#label'} = [{ | ||||||||||||||||||||||||||||
| 40 | value => $self->{content}, type => 'literal' | ||||||||||||||||||||||||||||
| 41 | 0 | ▶ | }] if $self->{content}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 42 | |||||||||||||||||||||||||||||
| 43 | $me->{'http://xmlns.com/foaf/0.1/page'} = [{ | ||||||||||||||||||||||||||||
| 44 | value => $self->{href}, type => 'uri' | ||||||||||||||||||||||||||||
| 45 | 0 | ▶ | }] if $self->{href}; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 46 | |||||||||||||||||||||||||||||
| 47 | 0 | return { $self->rdfuri => $me }; | |||||||||||||||||||||||||||
| 48 | } | ||||||||||||||||||||||||||||
| 49 | |||||||||||||||||||||||||||||
| 50 | 11 | 1; | |||||||||||||||||||||||||||
| 51 | |||||||||||||||||||||||||||||
| 52 | __END__ | ||||||||||||||||||||||||||||