[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Thu Jun 19 00:47:35 UTC 2003


mwilkinson
Wed Jun 18 20:47:35 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv12376/Perl/MOBY/Client

Modified Files:
	Central.html Central.pm 
Log Message:
Doh\!  I didn't read the API properly when I wrote the code.  The API didn't make sense anyway, so I took the liberty of fixing the API call to make it sensible, and then coded to that.  This new version should fulfil what was intended in the API.  the 'expand' function is not yet implemented

moby-live/Perl/MOBY/Client Central.html,1.5,1.6 Central.pm,1.35,1.36
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.html,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.html	2003/06/18 22:57:02	1.5
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.html	2003/06/19 00:47:35	1.6
@@ -381,7 +381,9 @@
  Args      :    EITHER serviceType => $term_or_lsid
                 OR     objectType => $term_or_lsid
                 
-                Registry =&gt; $registry_name  (optional)</pre>
+                Relationships =&gt; \@relationship_types (optional, 'all' if parameter is missing)
+                Registry =&gt; $registry_name  (optional)
+                expandRelationships (NOT YET IMPLEMENTED)</pre>
 <p>
 </p>
 <h2><a name="dump">DUMP</a></h2>

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/06/18 22:57:02	1.35
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/06/19 00:47:35	1.36
@@ -1178,7 +1178,9 @@
  Args      :	EITHER serviceType => $term_or_lsid
                 OR     objectType => $term_or_lsid
                 
+                Relationships => \@relationship_types (optional, 'all' if parameter is missing)
                 Registry => $registry_name  (optional)
+                expandRelationships (NOT YET IMPLEMENTED)
 
 =cut
 
@@ -1187,32 +1189,38 @@
 	my ($self, %args) = @_;
 	my $object = $args{'objectType'};
 	my $service = $args{'serviceType'};
+	my @relationships;
+	@relationships = @{$args{'Relationships'}} if ($args{'Relationships'} && (ref($args{'Relationships'}) =~ /array/i));
 	my $reg = $args{'Registry'};
 	my $m; my $payload;
 	return {} unless ($object || $service);
 	if ($object){
 		$m = "
 		<Relationships>
-            <objectType>$object</objectType>
-	    </Relationships>";
+            <objectType>$object</objectType>\n";
+		foreach (@relationships){
+			$m .= "<relationshipType>$_</relationshipType>\n";
+		}
+	    $m .= "</Relationships>";
 		$reg =$reg?$reg:$self->default_MOBY_servername;
 		return undef unless ($self->SOAP_connection($reg));
-		my $payload = $self->SOAP_connection($reg)->call('Relationships' => ($m))->paramsall;
+		$payload = $self->SOAP_connection($reg)->call('Relationships' => ($m))->paramsall;
 	} elsif ($service){
 		$m = "
 		<Relationships>
-            <serviceType>$service</serviceType>
-	    </Relationships>";
+            <serviceType>$service</serviceType>\n";
+		foreach (@relationships){
+			$m .= "<relationshipType>$_</relationshipType>\n";
+		}
+	    $m .= "</Relationships>";
 		$reg =$reg?$reg:$self->default_MOBY_servername;
 		return undef unless ($self->SOAP_connection($reg));
-		my $payload = $self->SOAP_connection($reg)->call('Relationships' => ($m))->paramsall;
-		
-		
+		$payload = $self->SOAP_connection($reg)->call('Relationships' => ($m))->paramsall;
 	}
-	return &_relationshipsPayload($payload);
-	
+	return &_relationshipsPayload($payload);	
 }
 
+
 sub _relationshipsPayload{
 	my ($payload) = @_;
 	return undef unless $payload;




More information about the MOBY-guts mailing list