[MOBY-l] namespace, objects, etc help with INPUT/OUTPUT

Ken Steube steube at sdsc.edu
Mon Nov 17 21:00:02 UTC 2003


You don't have to deal with that XML. It's just what MOBY uses internally
to transmit your registration request to MOBY-Central. If you're really
interested in understanding that XML the best source I know of is
http://www.biomoby.org/twiki/bin/view/TWiki/BioMOBYAPI. It's pretty
sparse on the details.

Instead of messing with this XML, you register a service with the
registerService call as shown below.

  my $C = MOBY::Client::Central->new();
  my $reg = $C->registerService(
    serviceName  => 'test_SequenceToFASTA',
    authURI      => $authURI,
    contactEmail => $email,
    description  => "Example service: formats a sequence in FASTA format",
    URL          => $url,
    input        => [ ['', ["GenericSequence" => []]], ],
    output       => [ ['', ["FASTA" => []]], ],
    category     => "moby",
    serviceType  => "Retrieval",
  );
  die "Bad return value from registerService" unless $reg;
  if ($reg->success == 1){
    print "Registration successful\n\n";
  }
  else {
    print "Registration failed: ", $reg->message, "\n";
  }

The input of this service is a GenericSequence object and the output
is a FASTA object, which is just a string containing a namespace+id
and a string containing a FASTA formatted sequence.

An articleName is required when a service specifies an input or output
object is named. Such as

<GenericSequence namespace='NCBI_gi' id='163483' articleName='mySequence'>
  <Integer namespace='' id='' articleName='Length'>975</Integer>
  <String  namespace='' id='' articleName='SequenceString'>TAGC...</String>
</GenericSequence>

The GenericSequence object is named mySequence and the length and
sequence components are also named Length and SequenceString.  If a
service has only one input, then a name is not required and many
service providers leave articleName blank.  The GenericSequence object
is registered to require only the names Length and SequenceString.

In the example GenericSequence above the namespace/id parameters tell where
the sequence came from and gives the ID used to retrieve it.

I think I answered all the questions...ask again if not!

Ken

On Mon, 17 Nov 2003, Michael Jensen wrote:

> I am trying to understand the XML for registering a service, but I am
> not sure where to map what such as when using existing objects and
> namespaces. I know I don't have to build this by hand, but I want to
> understand what each part is doing, etc. Is there some sort of list
> that says "this is an objectType" and this is the "Namespace" it is in,
> and what an articleName is, etc.?
>
> <registerService>
>           <Category>moby</Category>
>           <serviceName>GoGene</serviceName>
>           <serviceType>Retrieval</serviceType>
>           <authURI>gogene.missouri.edu</authURI>
>           <URL>http://gogene.missouri.edu/cgi-bin/gogene.pl</URL>;
>           <contactEmail>mdjgf8 at mizzou.edu</contactEmail>
>           <authoritativeService>1</authoritativeService>
>           <Description><![CDATA[
>                 some description here
>                 ]]>
>           </Description>
>           <Input>
>              <Simple articleName="gene">
>                  <objectType>Gene</objectType>
>                  <Namespace>Genbank:Gene</Namespace>
>              </Simple>
>              <Collection articleName="myname">
>                  <Simple articleName="myname">
>                      <objectType>TotalCrap</objectType>
>                      <Namespace>Genbank:Crap</Namespace>
>                  </Simple>
>                  <Simple articleName="myname">
>                      <objectType>YetMoreCrap</objectType>
>                      <Namespace>Genbank:Crap</Namespace>
>                  </Simple>
>              </Collection>
>           </Input>
>           <secondaryArticles>
>              <Parameter articleName="limit_by">
>                 <datatype>INT</datatype>
>                 <default>10</default>
>                 <max>100</max>
>                 <min>1</min>
>                 <enum>1</enum>
>                 <enum>2</enum>
>                 <enum>10</enum>
>                 <enum>100</enum>
>              </Parameter>
>           </secondaryArticles>
>           <Output>
>              <Simple articleName="myoutputname">
>                  <objectType>TotalCrap</objectType>
>                  <Namespace>Genbank:Crap</Namespace>
>              </Simple>
>           </Output>
>        </registerService>
>
> The input and output is what I am trying to understand mostly. For the
> input there is a simple articlename, and then a collection with a
> simple articlename. I assume I could just use the first simple without
> a "collectioN", but then my question is what would an example
> articlename be and accompanying objecttype and namespace.
>
> Thanks!
>
> -Michael Jensen
> mdjgf8 at mizzou.edu
>
>
> _______________________________________________
> moby-l mailing list
> moby-l at biomoby.org
> http://biomoby.org/mailman/listinfo/moby-l
>

-- 
-------------------------------------
Ken Steube            steube at sdsc.edu
San Diego Supercomputer Center @ UCSD
San Diego, California             USA




More information about the moby-l mailing list