[MOBY-l] String & text-plain

Ken Steube steube at sdsc.edu
Mon Apr 12 18:49:46 UTC 2004


On Mon, 12 Apr 2004, Gabriel Berriz wrote:

> Hi all.
>
> I'm trying to code a toy service that all it does is to echo back
> *verbatim* (through a text-plain object) the raw XML that it received
> as input.

Just return the query string exactly:

sub test_SequenceToFASTA {
  my ($caller, $query) = @_;
  return $query; # echo back the input
}

>
> One thing I have not been able to figure out is the correspondence
> between an object's definition (as given in registerObject) and the
> raw XML string corresponding to this object.  My immediate questions
> are

Here's a CGI that shows the XML for any object:

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

>
> 1. What exactly is the difference between String and text-plain?

text-plain ISA String, so they are identical in all except name (and
therefore interpretation).

An object only becomes different in content from its immediate parent
when is HAS-A or HAS some item(s).

>
> 2. It is my understanding that the raw XML representation for the
> String object corresponding to "my favorite string" is something like:
>
>    <String namespace="some/namespace" id="my favorite string"/>

It's more like this:

<String namespace="SGD" id="N1322445">
  my fav string
</String>

id is some kind of ID describing where the string came from (it may be
empty if that's appropriate).  e.g.  a string containing a sequence
usually has the ID of the gene from which it came.

>
> What is the raw XML representation for the text-plain object
> corresponding to "my favorite string"?

<text-plain namespace="SGD" id="N1322445">
  my fav string
</text-plain>

>
> The larger question is that from the point of view of someone coding a
> service, how do I know the structure of the XML that my script will
> receive as input?

In the API document read about queryInput tags and Simple and Collection
tags. Inside each simple/collection are MOBY XML objects.

>
> An even larger concern is that I'm surprised by the amount of XML
> munging that I see in sample BioMOBY code.  I thought the whole point
> of using SOAP modules was to insulate oneself from having to do much
> (or any) parsing and munging of XML.

I tried to relieve us of some of that with my MobyXmlObject.pm object
used in my FASTA example at
http://plantgenome.sdsc.edu/mobyed2/Fasta_Service It needs some
further development (to supply queryIDs + other things), but is very
usable as-is.

>
> Gabriel
>
>
>
>
>
> A far more important question has to do with a client's ability to
> handle a given output from a service.  This output presumably comes
> back as XML.  How does the client figure out how to parse this output
> to get the desired information?  I thought the whole idea was that
> this should be transparent to the client, but

I have an example of chaining services together on my page
http://plantgenome.sdsc.edu/mobyed2/Talks/discovering_executing_services.html

It shows how to extract XML output from a service and feed it into another
service.

Ken

-- 
--
--
Ken Steube
San Diego Supercomputer Center
University of California, San Diego, MC 0505
9500 Gilman Drive
San Diego, California, 92093-0505  USA
FAX (858) 822-3610




More information about the moby-l mailing list