MOSES::MOBY::Data::Object - A base Moby data type
use MOSES::MOBY::Data::Object; # create a Moby object with a namespace of NCBI_gi and id 545454 my $data = MOSES::MOBY::Data::Object->new (namespace=>"NCBI_gi", id=>"545454"); # set/get an article name for this data object $data->name ('myObject'); print $data->name; # set/get an id for this data object $data->id ('myID'); print $data->id; # check if this data object is a primitive type print "a primitive" if $data->primitive; print "not a primitive" if not $data->primitive; # set an array of cross references my $xref = new MOSES::MOBY::Data::Xref; $xref->description ('He is looking at you, kid...'); $data->xrefs ($xref); # set more cross referneces for this data object my $xref1 = ... my $xref2 = ... my $xref3 = ... $data->xrefs ($xref1, $xref2, $xref3); # or: $data->xrefs ([$xref1, $xref2, $xref3]); # add cross references my $xref4 = ... my $xref5 = ... $data->add_xrefs ($xref4, $xref5); # or: $data->add_xrefs ([$xref4, $xref5]); # finally, get cross references back foreach $xref (@{ $data->xrefs }) { print $xref->toString; } # get a formatted string representation of this data object print $data->toString; # retrieve an XML::LibXML::Element representing the data object $xml = $data->toXML(); print $xml->toString;
An object representing a Moby object, a Moby base data type for all other Moby data types.
Edward Kawas (edward.kawas [at] gmail [dot] com) Martin Senger (martin.senger [at] gmail [dot] com)
Details are in MOSES::MOBY::Base. Here just a list of them:
An article name for this datatype. Note that the article name depends on the context where this object is used.
A provision information. A scalar of type MOSES::MOBY::Data::ProvisionInformation.
MOSES::MOBY::Data::ProvisionInformation
Cross-references. Can be a scalar (of type MOSES::MOBY::Data::Xref, an array, or a array reference.
MOSES::MOBY::Data::Xref
A boolean property indicating if this data type is a primitive Moby type or not.
Return an XML::LibXML::Element representing this data object. An optional attribute is an articleName that should be given to this object (in its XML representation).
To install MOSES::MOBY, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MOSES::MOBY
CPAN shell
perl -MCPAN -e shell install MOSES::MOBY
For more information on module installation, please visit the detailed CPAN module installation guide.