[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Jul 27 15:58:37 UTC 2005


mwilkinson
Wed Jul 27 11:58:36 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory pub.open-bio.org:/tmp/cvs-serv29559/MOBY/Adaptor/moby/queryapi

Modified Files:
	mysql.pm 
Log Message:
simples of collections not being discovered properly

moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.51,1.52
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.51
retrieving revision 1.52
diff -u -r1.51 -r1.52
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2005/07/27 15:02:21	1.51
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2005/07/27 15:58:36	1.52
@@ -268,6 +268,7 @@
 sub query_simple_input{
     my ($self, %args) = @_;	
     my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid});
+    my $collid = $args{collection_input_id};
     my $dbh = $self->dbh;
     
     my $statement = "select
@@ -277,8 +278,12 @@
       article_name,
       service_instance_id,
       collection_input_id
-      from simple_input where service_instance_id = ? and collection_input_id IS NULL";
-    my $result = do_query($dbh, $statement, ($siid));
+      from simple_input where ";
+      
+	my $condition;
+      $siid && ($condition = " service_instance_id = ? and collection_input_id IS NULL");
+      $collid && ($condition = " service_instance_id IS NULL and collection_input_id = ?");
+    my $result = do_query($dbh, $statement, ($siid || $collid));
     return $result;
 }
 	
@@ -353,7 +358,7 @@
 sub query_simple_output{
     my ($self, %args) = @_;	
     my ($siid) = $self->_getSIIDFromLSID($args{service_instance_lsid});
-    my $collid = $args{collection_input_id};
+    my $collid = $args{collection_output_id};
     my $dbh = $self->dbh;
     
     my $statement = "select
@@ -363,8 +368,13 @@
       article_name,
       service_instance_id,
       collection_output_id
-      from simple_output where service_instance_id = ? and collection_output_id= ?";    
-    my $result = do_query($dbh, $statement, ($siid, $collid));
+      from simple_output where ";
+      my $condition;
+      $siid && ($condition = " service_instance_id = ? and collection_output_id IS NULL");
+      $collid && ($condition = " service_instance_id IS NULL and collection_output_id = ?");
+      
+
+    my $result = do_query($dbh, $statement, ($siid || $collid));
     return $result;
 }
 




More information about the MOBY-guts mailing list