InterMine::Item - Representation of InterMine items
my $factory = new InterMine::ItemFactory(model => $model); my $gene = $factory->make_item("Gene"); $gene->set("identifier", "CG10811");
(See InterMine::ItemFactory for a longer Synopsis)
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::Item
You can also look for information at:
FlyMine
http://www.flymine.org
Documentation
http://www.intermine.org/wiki/ItemsAPIPerl
Copyright 2006,2007,2008 FlyMine, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Title : new Usage : $item = $factory->make_item("Gene"); # calls Item->new() implicitly Function: create a new Item Args : model - the InterMine::Model object to use to check field validity Note : use this method indirectly using an ItemFactory
Title : set Usage : $gene_item->set("name", "wtf7"); or: $gene_item->set("organism", $organism_item); Function: set a field in the Item, checking that this object can have a field with that name Args : $name - the name of the field to set $value - the new value (must not be undefined)
Title : get Usage : $gene_name = $gene_item->get("name"); or: $organism_item = $gene_item->get("organism"); Function: get the value of a field from an Item Args : $name - the name of the field to get Return : the value
Title : model Usage : $model = $item->model(); Function: return the model that this Item obeys
Title : classname Usage : $classname = $item->classname(); Function: return the class name of this Item - ie the class name that will be used when creating the object in InterMine
Title : classdescriptor Usage : $cd = $item->classdescriptor(); Function: return the ClassDescriptor object from the model for this Item
Title : all_class_descriptors Usage : @cds = $item->all_class_descriptors(); Function: return a list of ClassDescriptor objects from the model for this Item, including the classdescriptors of all parent objects
Title : valid_field Usage : if ($item->valid_field('someFieldName')) { ... }; Function: return true if and only if the given field name is valid for this object according to the model
Title : has_field_called Usage : if ($item->has_field_called('someFieldName')) { ... }; Function: return true if the item has a field slot of the given name. This is the new and recommended name for "valid_field".
Title : instance_of Usage : my $gene_cd = $model->get_classdescriptor_by_name("Gene"); if ($some_item->instance_of($gene_cd)) { ... } Function: Return true if and only if this Item represents an object that has the given class, or is a sub-class.
Title : to_string Usage : warn('item: ', $item->to_string()); Function: return a text representation of this Item
Title : as_xml Usage : $xml = $item->as_xml(); Function: return an XML representation of this Item
Title : destroy Usage : $item = $item->destroy; Function: deletes the item object and its contents
To install InterMine::Item, copy and paste the appropriate command in to your terminal.
cpanm
cpanm InterMine::Item
CPAN shell
perl -MCPAN -e shell install InterMine::Item
For more information on module installation, please visit the detailed CPAN module installation guide.