InterMine::Model - the representation of an InterMine model
use InterMine::Model; my $model_file = 'flymine/dbmodel/build/model/genomic_model.xml'; my $model = InterMine::Model->new(file => $model_file); my $gene = $model->make_new( Gene => { primaryIdentifier => "FBgn0004053", secondaryIdentifier => "CG1046", symbol => "zen", name => "zerknullt", length => "3474", organism => { shortName => "D. melanogaster", } ncbiGeneNumber => 40828, }); $gene->getName(); # "zerknullt" ...
The class is the Perl representation of an InterMine data model. The new() method can parse the model file. The get_classdescriptor_by_name() method will return an InterMine::Model::ClassDescriptor object for the class with the given name.
For an example model see: http://trac.flymine.org/browser/trunk/intermine/objectstore/model/testmodel/testmodel_model.xml
Title : new Usage : $model = new InterMine::Model(file => $model_file); or $model = new InterMine::Model(string => $model_string); Function: return a Model object for the given file Args : file - the InterMine model XML file
Title : get_classdescriptor_by_name Usage : $cd = $model->get_classdescriptor_by_name("Gene"); Function: return the InterMine::Model::ClassDescriptor for the given class or undef if the class isn't in the model Args : the classname
Return an object of the desired class, with the attributes given
my $gene = $model->make_new(Gene => {symbol => "zen", organism => {name => 'D. melanogaster}}); say $gene->get_symbol # "zen" say $gene->get_organism->get_name # "D. melanogaster"
Title : get_all_classdescriptors Usage : @cds = $model->get_all_classdescriptors(); Function: return all the InterMine::Model::ClassDescriptor objects for this model Args : none
Usage : my $cd = $model->get_referenced_classdescriptor($ref); Function : get the class descriptor at the other end of a reference Args : The reference
Usage : my @classes = $model->find_classes_declaring_field($str); Function : get the class descriptors that declare fields of a certain name Args : The field's name
Title : package_name Usage : $package_name = $model->package_name(); Function: return the package name derived from the name space eg. "org.intermine.model" Args : none
Title : model_name Usage : $model_name = $model->model_name(); Function: return the model name from the model file eg. "testmodel" Args : none
FlyMine <support@flymine.org>
<support@flymine.org>
Please report any bugs or feature requests to support@flymine.org.
support@flymine.org
You can find documentation for this module with the perldoc command.
perldoc InterMine::Model
You can also look for information at:
FlyMine
http://www.flymine.org
Copyright 2006,2007,2008,2009, 2010, 2011 FlyMine, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install InterMine::Model, copy and paste the appropriate command in to your terminal.
cpanm
cpanm InterMine::Model
CPAN shell
perl -MCPAN -e shell install InterMine::Model
For more information on module installation, please visit the detailed CPAN module installation guide.