[MOBY-dev] update - lots of activity :-)

Mark Wilkinson markw at illuminae.com
Thu Jul 10 22:05:38 UTC 2003


Hi guys, 

Sorry to fill your inboxes with CVS commit messages :-)

I thought it was time to give a quick overview of what is going on in
the code so that the service providers and the other coders (Hi Martin!)
can know/use the things I am building.

Okay, most importantly I have started building tools that help,
somewhat, deal with the flexibility that we have allowed in this version
of the API in using "common names" for objects, namespaces, and so
forth, or alternately using the equivalent LSID's.  The
MOBY::OntologyServer module did not have a public interface up to now,
but for the sake of Client programs and Service Providers I have started
to create an *excruciatingly* simple GET based interface into the MOBY
Ontologies.

Here's the problem:  let's say you have a service that consumes ID's
within the NCBI_gi or NCBI_Acc namespace.  You receive an object, and
now you need to do your query.  Well, the first thing you need to know
is the namespace of the object you were given so that you can construct
the query properly.  Unfortunately, this can arrive in *four* different
(but equivalent) forms:

namespace="moby:NCBI_gi"
namespace="moby:uri:lsid:www.biomoby.org:mobynamespace:ncbi_gi"
namespace="NCBI_gi"
namespace="uri:lsid:www.biomoby.org:mobynamespace:ncbi_gi"

...and then the other four possibilities for the NCBI_Acc namespace.
Ack!

If you are using XML::DOM, you are left with the problem of dealing with
each and every possibility all by yourself.  Moreover, you might not
know the LSID of the namespace you are dealing with.  OntologyServer to
the rescue!  

The CGI interface has (so far) four different GET calls:

http://mobycentral.cbr.nrc.ca/cgi-bin/OntologyServer.cgi?namespaceExists=TERM
http://mobycentral.cbr.nrc.ca/cgi-bin/OntologyServer.cgi?objectExists=TERM
http://mobycentral.cbr.nrc.ca/cgi-bin/OntologyServer.cgi?relationshipExists=TERM
http://mobycentral.cbr.nrc.ca/cgi-bin/OntologyServer.cgi?serviceExists=TERM

in the "TERM" position you can put any one of the four different
representations of a MOBY ontology term, and it will send you back a
text/plain document with three lines:

       0 | 1     for success or failure in the lookup
       message   indicating the reason for failure or success
       LSID      LSID of the object (on success) with no moby: prefix.

The MOBY::Client::OntologyServer module does exactly the same thing, but
Perlifies things as one might expect:

   $OS = MOBY::Client::OntologyServer->new
   my ($success, $message, $lsid) = $OS->objectExists(term => 'Blast');


So, what Service Providers should do **every time** is the following:

 ($s,$m,$valid_lsid) = $OS->namespaceExists(term => "ValidNamespace");
  foreach (incoming object){
	$this_ns = get namespace somehow;
	($s,$m,$this_lsid) = $OS->namespaceExists(term => $this_ns)
	if ($this_lsid eq $valid_lsid){
		PROCESS OBJECT
	}
  }


I've registered a service that behaves the way all good services should
behave :-)  (touch wood).  It takes a variety of namespaces as input,
gives a variety of object types as output, and sends CrossReferences to
boot!  Start with an NCBI_gi or Acc and you will discover it in the CGI
client.  The code is also in the /scripts/Services/LocalServices.pm
module.

Cheers all!

Mark


-- 
Mark Wilkinson <markw at illuminae.com>
Illuminae




More information about the MOBY-dev mailing list