OME::SemanticType - data object representing attribute types
use OME::SemanticType;
# Load object via primary key
my $atype = $factory->loadObject("OME::SemanticType",1);
# Ensure that instance package is created
my $pkg = $atype->requireAttributeTypePackage();
# Create a new instance of this attribute type via primary key
my $attribute = $pkg->load(1);
OME::SemanticType serves two purposes. First, it functoins just like any other OME DBObject, representing rows from the semantic_types table in the OME database. More importantly, though, it serves as the means of creating data classes for each attribute type, similar to how OME::DataTable create data classes for each attribute table.
The following methods are available in addition to those defined by the OME::DBObject manpage.
my $name = $type->name();
$type->name($name);
Returns or sets the name of this semantic type.
my $description = $type->description();
$type->description($description);
Returns or sets the description of this semantic type.
my $granularity = $type->granularity();
$type->granularity($granularity);
Returns or sets the granularity of this semantic type. Will be either 'G', 'D', 'I', or 'F'.
my @columns = $type->semantic_elements();
my $column_iterator = $type->semantic_elements();
Returns or iterates, depending on context, a list of all of the
Columns associated with this module_execution.
# Get the label of this semantic type in the default language for this system
my $label = $type->label();
# Get the label of this semantic type in the specified language
my $label = $type->label( $lang );
Looks in the configuration table for a default language. Returns a label
in that language if available. If not avaiable, returns the ST name.
# Get the description of this semantic type in the default language for this system
my $description = $type->lang_description();
# Get the description of this semantic type in the specified language
my $description = $type->lang_description( $lang );
Looks in the configuration table for a default language. Returns a description
in that language if available. If not avaiable, returns the ST's description.
Douglas Creager <dcreager@alum.mit.edu>, Open Microscopy Environment, MIT