FW: [MOBY] [MOBY-l] Output of a service

Mark Wilkinson markw at illuminae.com
Mon Mar 22 16:44:32 UTC 2004


On Sat, 2004-03-20 at 08:28, Catherine Letondal wrote:

> We prefer to do it right.

:-)

>  Are there already some sub-classes planned for
> analysis services? I know people working on ontologies of bioinformatics
> tools, they have probably some good ideas?

I recall that in one of our very first MOBY meetings we designed a
prototype service ontology (Suzi Lewis and Jason Stewart, actually,
sitting in the pub with a pint and a laptop!).  I believe a second
version came from Richard Bruskiewich at the Singapore hackathon. 
Unfortunately, neither of these have ever been implemented.  I think
they are still on my drive somewhere - let me go hunting to see if I can
find them.  If I do, I will send them out to the list and we can, as a
group, go through it.  This might also be a good task to tackle at the
upcoming MOBY meeting in CSHL.  We can also look at the myGrid service
ontology for ideas.

> what is the Relationships like in:
> 
> $c->registerServiceType (
>                   Relationships => {$relationshipType1 => \@services,
>                                     $relationshipType2 => \@services}

Services currently only have an ISA relationship, so it would look like:

Relationships => {'ISA' => ['Analysis']}

> Again, I really wish to start with the right code, but are there some
> examples I can copy?

all of the services in /moby-live/scripts/services/LocalServices.pm are
the ones that I am running from MOBY Central, and they are all now
compliant (thanks to debugging by Rebecca and Beatrice!).  There is also
a "template" service that you could perhaps copy/paste and then edit to
your own needs.


> What is the second argument? Do you have an example?

The second argument is the articleName for the outgoing Simple, however
I don't think anyone is using this attribute yet.  There are examples in
the CommonSubs pod documentation.  This attribute is only really useful
for cases where you might be outputting several objects of the same
type, but which are intended to have different meanings.... off the top
of my head, let's say you were searching for a certain functional
domain, and the service returned to you all examples of that domain as
sequence objects, plus a consensus sequence object.  This output would
be difficult to interpret without the individual pieces of the output
being somehow "tagged" using an articleName attribute.


> > Ken has this tool in his "encyclopedia":
> > 
> > http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?obj=PutYourObjectHere
> 
> Very convenient!! But when calling:
> 
> http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?text-plain
> or:
> http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?NucleotideSequence
> I just get:
> 
> <Object namespace='' id='' articleName=''>
> </Object>

???  I can't duplicate this error.  For me, the URL

http://plantsp.sdsc.edu/cgi-bin/MOBY/MOBY_display_object_xml.cgi?obj=NucleotideSequence

resolves to:

<NucleotideSequence namespace='' id='' articleName=''>
  <String namespace='' id='' articleName='SequenceString'>
  </String>
  <Integer namespace='' id='' articleName='Length'>
  </Integer>
</NucleotideSequence>

...which is completely correct :-)


> Ok. So the sequence been passed to the service *must* have an id?

uh...no, not necessarily.  Incomnig objects will always have a namespace
and id *attribute*, but it is perfectly fine to have "anonymous" objects
where these have no value.  I guess what I meant to say is that you
simply take whatever the incoming namespace/id were (even if they are
null), and output your object with the same values.


> I have an additional question. When calling a service asking for several
> parameters, you put them in different articles, right? 

Yes, that's correct.  There are some things to watch out for in this
regard, but without knowing your exact service I don't know what to warn
you about...  Just be aware that there are <Collection> inputs as well
as <Simple> inputs for passing multiple arguments into a service (though
from your example, I think you are using multiple <Simples> with the
correct intention!), and note also that there are "Secondary" arguments
that can be passed to a service, though no existing client program
supports them yet :-(

  my $result = $S->execute(
>     XMLinputlist => [
>   ['sequence', qq{<moby:NucleotideSequence namespace='' id=''>
>   <moby:Integer namespace='' id='' articleName='Length'>19</moby:Integer>
>   <moby:String namespace='' id='' articleName='SequenceString'>acggtagctaggtaccc
> at</moby:String>
>   </moby:NucleotideSequence>}],
>   ['anotherparam', qq{<moby:Integer namespace='' id='' articleName='AnotherParam'>4</moby:Integer>}]
>   ]
>   ) ;
> 

It sounds to me like you are well on your way to getting some very
complex services up and running!  

I'm looking forward to using them!

Mark



-- 
Mark Wilkinson (mwilkinson at mrl.ubc.ca)
University of British Columbia iCAPTURE Centre



More information about the moby-l mailing list