NAME

MOSES::MOBY::Data::Object - A base Moby data type

SYNOPSIS

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;

DESCRIPTION

An object representing a Moby object, a Moby base data type for all other Moby data types.

AUTHORS

Edward Kawas (edward.kawas [at] gmail [dot] com)
Martin Senger (martin.senger [at] gmail [dot] com)

ACCESSIBLE ATTRIBUTES

Details are in MOSES::MOBY::Base. Here just a list of them:

namespace
id
name

An article name for this datatype. Note that the article name depends on the context where this object is used.

provision

A provision information. A scalar of type MOSES::MOBY::Data::ProvisionInformation.

xrefs

Cross-references. Can be a scalar (of type MOSES::MOBY::Data::Xref, an array, or a array reference.

primitive

A boolean property indicating if this data type is a primitive Moby type or not.

SUBROUTINES

toXML

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).