GOBO
    
    
  
  
  
view release on metacpan or search on metacpan
GOBO/Graph.pm view on Meta::CPAN
sub add_instance {
    my $self = shift;
    my $n = $self->instance_noderef(@_);
    $self->instance_h->{$n->id} = $n;
    return $n;
}
=head2 remove_node
 - Arguments: node GOBO::Node, cascade Bool[OPT]
unlinks the node from this graph
If cascade is 0 or undef, any links to or from this node will remain as dangling links.
If cascade is set, then links to and from this node will also be deleted
=cut
sub remove_node {
    my $self = shift;
    my $n = shift;
    my $cascade = shift;
    #my $id = ref($n) ? $n->id : $n;
    my $id = $n->id;
    if ($self->term_h->{$id}) {
        delete $self->term_h->{$id};
    }
    if ($self->instance_h->{$id}) {
        delete $self->instance_h->{$id};
    }
    if ($self->relation_h->{$id}) {
        delete $self->relation_h->{$id};
    }
    if ($cascade) {
        $self->remove_link($_) foreach @{$self->get_outgoing_links($n)};
        $self->remove_link($_) foreach @{$self->get_incoming_links($n)};
    }
    return $self->node_index->remove_node($n);
}
sub add_formula { my $self = shift; push(@{$self->formulae},@_) }
=head2 get_outgoing_links (subject GOBO::Node, relation GOBO::RelationNode OPTIONAL)
GOBO/Parsers/OBOParserDispatchHash.pm view on Meta::CPAN
=head1 NAME
GOBO::Parsers::OBOParserDispatchHash
=head1 DESCRIPTION
An GOBO::Parsers::Parser that parses OBO Files.
Mostly identical to GOBO::Parsers::OBOParser but uses a dispatch table rather than an if/else cascade
=cut
package GOBO::Parsers::OBOParserDispatchHash;
use Moose;
#use base 
extends 'GOBO::Parsers::OBOParser';
has header_check_sub => (is=>'rw', isa=>'CodeRef', writer => 'set_header_check_sub', reader => 'get_header_check_sub', default=>sub{ return sub { return 1 }; });
( run in 0.375 second using v1.01-cache-2.11-cpan-5dc5da66d9d )