NAME

InterMine::Model - the representation of an InterMine model

SYNOPSIS

use InterMine::Model;
use InterMine::ItemFactory;

my $model_file = 'flymine/dbmodel/build/model/genomic_model.xml';
my $model = new InterMine::Model(file => $model_file);
my $factory = new InterMine::ItemFactory(model => $model);

...

DESCRIPTION

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

AUTHOR

FlyMine <support@flymine.org>

BUGS

Please report any bugs or feature requests to support@flymine.org.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc InterMine::Model;

You can also look for information at:

COPYRIGHT & LICENSE

Copyright 2006,2007,2008,2009 FlyMine, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

FUNCTIONS

new

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

get_classdescriptor_by_name

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

get_all_classdescriptors

Title   : get_all_classdescriptors
Usage   : @cds = $model->get_all_classdescriptors();
Function: return all the InterMine::Model::ClassDescriptor objects for this
          model
Args    : none

get_referenced_classdescriptor

Usage    : my $cd = $model->get_referenced_classdescriptor($ref);
Function : get the class descriptor at the other end of a reference
Args     : The reference

find_classes_declaring_field

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

package_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

model_name

Title   : model_name
Usage   : $model_name = $model->model_name();
Function: return the model name from the model file eg. "testmodel"
Args    : none