[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Jul 10 20:07:10 UTC 2003


mwilkinson
Thu Jul 10 16:07:10 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv6141/Perl/MOBY/Client

Modified Files:
	OntologyServer.pm 
Log Message:
the OntologyServer will now translate your object names into LSID's, even if you send it LSID's in the first place.  This is useful because we allow both to be used in service calls, so usually you would need to do some tedious checking to figure out what namespace the client used in the objects it sent you.  now all you do is filter them through a call to the ontology server and what comes out will always be an LSID, so you only need to do one test to see if it is valid

moby-live/Perl/MOBY/Client OntologyServer.pm,1.1,1.2
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm	2003/07/10 19:51:23	1.1
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/OntologyServer.pm	2003/07/10 20:07:09	1.2
@@ -15,6 +15,9 @@
  my $OS = MOBY::Client::OntologyServer->new();
 
  my ($success, $message, $existingURI) = $OS->objectExists(term => "Object");
+ my ($success, $message, $existingURI) = $OS->serviceExists(term => "Retrieval");
+ my ($success, $message, $existingURI) = $OS->namespaceExists(term => "NCBI_gi");
+ my ($success, $message, $existingURI) = $OS->relationshipExists(term => "ISA");
 
  if ($success){
      print "object exists and it has the LSID $existingURI\n";
@@ -27,6 +30,14 @@
 
 =head1 DESCRIPTION
 
+This module is used primarily as a way of dealing with the
+flexibility MOBY allows in the use of "common" names
+versus LSID's.  Calling the ontology server using this
+module will return the LSID of whatever it is you send it,
+even if you send the LSID itself.  As such, you can now simply
+filter your terms through the ontologyserver and know that
+what is returned will be an LSID, and skip the checking step
+yourself.
 
 =head1 AUTHORS
 
@@ -124,13 +135,13 @@
     
     my $term = $args{'term'};    
     my $ua = LWP::UserAgent->new;
-    my $req = HTTP::Request->new(GET => $self->host);
-    $req->content('objectExists=$term');
+    my $req = HTTP::Request->new(POST => $self->host);
+    $req->content("objectExists=$term");
     my $res = $ua->request($req);
     if ($res->is_success) {
         return split "\n", $res->content;
     } else {
-        return (0,"Request Failed for unknown reasons",undef);
+        return (0,"Request Failed for unknown reasons","");
     }
 }
 
@@ -145,13 +156,13 @@
     
     my $term = $args{'term'};    
     my $ua = LWP::UserAgent->new;
-    my $req = HTTP::Request->new(GET => $self->host);
-    $req->content('serviceExists=$term');
+    my $req = HTTP::Request->new(POST => $self->host);
+    $req->content("serviceExists=$term");
     my $res = $ua->request($req);
     if ($res->is_success) {
         return split "\n", $res->content;
     } else {
-        return (0,"Request Failed for unknown reasons",undef);
+        return (0,"Request Failed for unknown reasons","");
     }
 }
 
@@ -165,13 +176,13 @@
     
     my $term = $args{'term'};    
     my $ua = LWP::UserAgent->new;
-    my $req = HTTP::Request->new(GET => $self->host);
-    $req->content('namespaceExists=$term');
+    my $req = HTTP::Request->new(POST => $self->host);
+    $req->content("namespaceExists=$term");
     my $res = $ua->request($req);
     if ($res->is_success) {
         return split "\n", $res->content;
     } else {
-        return (0,"Request Failed for unknown reasons",undef);
+        return (0,"Request Failed for unknown reasons","");
     }
 }
 
@@ -185,13 +196,13 @@
     
     my $term = $args{'term'};    
     my $ua = LWP::UserAgent->new;
-    my $req = HTTP::Request->new(GET => $self->host);
-    $req->content('relationshipExists=$term');
+    my $req = HTTP::Request->new(POST => $self->host);
+    $req->content("relationshipExists=$term");
     my $res = $ua->request($req);
     if ($res->is_success) {
         return split "\n", $res->content;
     } else {
-        return (0,"Request Failed for unknown reasons",undef);
+        return (0,"Request Failed for unknown reasons","");
     }
 }
 




More information about the MOBY-guts mailing list