File Coverage

blib/lib/OWL/Simple/Class.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             #!/usr/bin/env perl
2             package OWL::Simple::Class;
3              
4 1     1   5135 use Moose 0.89;
  0            
  0            
5              
6             =head1 NAME
7              
8             OWL::Simple::Class
9              
10             =head1 DESCRIPTION
11              
12             Helper class to store information for a single owl:Class parsed by
13             the OWL::Simple::Parser. Not to be used directly.
14              
15             Public properties label, id, synonyms, definition and subClassOf return
16             array references.
17              
18             =head1 AUTHOR
19              
20             Tomasz Adamusiak <tomasz@cpan.org>
21              
22             =head1 COPYRIGHT AND LICENSE
23              
24             Copyright (c) 2010 European Bioinformatics Institute. All Rights Reserved.
25              
26             This module is free software; you can redistribute it and/or modify it
27             under GPLv3.
28              
29             This software is provided "as is" without warranty of any kind.
30              
31             =cut
32              
33             our $VERSION = 0.05;
34              
35             has 'label' => ( is => 'rw', isa => 'Str' );
36             has 'synonyms' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
37             has 'definitions' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
38             has 'annotation' => ( is => 'rw', isa => 'Str', default => '');
39             has 'xrefs' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
40             has 'subClassOf' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
41             has 'part_of' => ( is => 'ro', isa => 'ArrayRef', default => sub { [] } );
42             has 'id' => (
43             is => 'rw',
44             isa => 'Str',
45             trigger => sub {
46             my ( $self, $id ) = @_;
47             $self->{id} =~ s!http://www.ebi.ac.uk/efo/!!; # strip the efo namespace from id
48             }
49             );
50              
51             1;