NAME
OWL::Simple::Parser
SYNOPSIS
use OWL::Simple::Parser;
use Log::Log4perl qw(:easy);
Log::Log4perl->easy_init( { level => $INFO, layout => '%-5p - %m%n' } );
# load Experimental Factor Ontology
my $parser = OWL::Simple::Parser->new( owlfile => 'efo.owl',
synonym_tag => 'alternative_term' );
# parse file
$parser->parse();
INFO "Loaded "
. $parser->class_count()
. " classes and "
. $parser->synonyms_count()
. " synonyms";
# iterate through all the classes
# for each class print the id, label and synonyms
for my $OWLClass ( @{ $parser->termlist } ) {
INFO $OWLClass->id . ' ' . $OWLClass->label;
for my $syn (@{ $OWLClass->synonyms }){
INFO "\tsynonym - $syn";
}
}
DESCRIPTION
A simple OWL parser loading accessions, labels and synonyms and exposes them as a collection of OWL::Simple::Class objects.
In the constructor specify the owlfile to be loaded and an optional synonym_tag used in the ontology (example FULL_SYN for NCI Thesaurus).
METHODS
- class_count()
-
Number of classes loaded by the parser.
- synonyms_count()
-
Number of synonyms loaded by the parser.
- term_list
-
Returns an array with all the OWL::Simple::Class objects
AUTHOR
Tomasz Adamusiak 2010
COPYRIGHT AND LICENSE
Copyright (c) 2010 European Bioinformatics Institute. All Rights Reserved.
This module is free software; you can redistribute it and/or modify it under GPLv3.
This software is provided "as is" without warranty of any kind.