| 1 | package Catmandu::RDF; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 18 | ▶ | use namespace::clean; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 18 | ▶ | use Catmandu::Sane; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | 18 | ▶ | use Catmandu::Util qw(is_instance); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 6 | 18 | ▶ | use Moo::Role; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 7 | 18 | ▶ | use RDF::NS; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 8 | |||||||||||||||||||||
| 9 | 18 | our $VERSION = '0.32'; | |||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 18 | our %TYPE_ALIAS = ( | |||||||||||||||||||
| 12 | Ttl => 'Turtle', | ||||||||||||||||||||
| 13 | N3 => 'Notation3', | ||||||||||||||||||||
| 14 | Xml => 'RDFXML', | ||||||||||||||||||||
| 15 | XML => 'RDFXML', | ||||||||||||||||||||
| 16 | Json => 'RDFJSON', | ||||||||||||||||||||
| 17 | ); | ||||||||||||||||||||
| 18 | |||||||||||||||||||||
| 19 | has type => ( | ||||||||||||||||||||
| 20 | is => 'ro', | ||||||||||||||||||||
| 21 | 27 | ▶ | coerce => sub { my $t = ucfirst($_[0]); $TYPE_ALIAS{$t} // $t }, | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=7.1
Condition66%2/3
$Catmandu::RDF::TYPE_ALIAS{$t} // $t
MC/DC0%0/2
$Catmandu::RDF::TYPE_ALIAS{$t} // $t
$Catmandu::RDF::TYPE_ALIAS{$t}
$t
Truth table66%2/3
A // B
A= $Catmandu::RDF::TYPE_ALIAS{$t}B= $t
| |||||||||||||||||||||
| 22 | 18 | ); | |||||||||||||||||||
| 23 | |||||||||||||||||||||
| 24 | has ns => ( | ||||||||||||||||||||
| 25 | is => 'ro', | ||||||||||||||||||||
| 26 | 30 | ▶ | default => sub { RDF::NS->new }, | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 27 | 65 | ▶ | coerce => sub { | ||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
| |||||||||||||||||||||
| 28 | 65 | ▶ | return $_[0] if is_instance($_[0],'RDF::NS'); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 29 | 35 | ▶ | return $_[0] if !$_[0]; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 30 | 26 | return RDF::NS->new($_[0]); | |||||||||||||||||||
| 31 | }, | ||||||||||||||||||||
| 32 | 18 | handles => ['uri'], | |||||||||||||||||||
| 33 | ); | ||||||||||||||||||||
| 34 | |||||||||||||||||||||
| 35 | 18 | 1; | |||||||||||||||||||
| 36 | __END__ | ||||||||||||||||||||