[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 25 22:10:26 UTC 2005


mwilkinson
Mon Jul 25 18:10:26 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv22004/MOBY

Modified Files:
	Central.pm service_instance.pm 
Log Message:
how do you know when you have done too much Perl coding?  When you start to say %args like a pirate...  This change might break things badly- I need to do a join in a dynamically generated SQL statement.  It looks OK now.  mySQL is weird in that you have to specify table names in natural joins.  UGH

moby-live/Perl/MOBY Central.pm,1.183,1.184 service_instance.pm,1.28,1.29
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.183
retrieving revision 1.184
diff -u -r1.183 -r1.184
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/25 21:52:25	1.183
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/25 22:10:25	1.184
@@ -3259,6 +3259,10 @@
 	my $OSns   = MOBY::OntologyServer->new( ontology => 'namespace' );
 	my $OSserv = MOBY::OntologyServer->new( ontology => 'service' );
 
+	# *********FIX
+	# this routine is using service instances by their database ID, rather than their LSID
+	# this is BAD BAD BAD
+
 	foreach (@ids) {
 		my $result = $adaptor->query_service_instance(service_instance_id => $_);
 		my $row = shift(@$result);
@@ -3266,7 +3270,7 @@
 		my $url = $row->{url};
 		my $servicename = $row->{servicename};
 		my $service_type_uri = $row->{service_type_uri};
-		my $authority_id = $row->{authority_id};
+		my $authority_uri = $row->{authority_uri};
 		my $desc = $row->{description};
 		my $authoritative = $row->{authoritative};
 		my $email = $row->{contact_email};
@@ -3281,10 +3285,10 @@
 		next unless ( $servicename && $authority_id );
 		my $service_type = $OSserv->getServiceCommonName($service_type_uri);
 
-		$result = $adaptor->query_authority({authority_id => $authority_id});
-		$row = shift(@$result);
-		my $authURI = $row->{authority_uri};		 
-		$output .= "\t<Service authURI='$authURI' serviceName='$servicename' lsid='$lsid'>\n";
+		#$result = $adaptor->query_authority({authority_id => $authority_id});
+		#$row = shift(@$result);
+		#my $authURI = $row->{authority_uri};		 
+		$output .= "\t<Service authURI='$authority_uri' serviceName='$servicename' lsid='$lsid'>\n";
 		$output .= "\t<serviceType>$service_type</serviceType>\n";
 		$output .= "\t<authoritative>$authoritative</authoritative>\n";
 		$output .= "\t<Category>$category</Category>\n";

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -r1.28 -r1.29
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/25 21:52:25	1.28
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/25 22:10:26	1.29
@@ -267,7 +267,7 @@
 # the routines below know too much about the database (e.g. that
 # the delete_simple_input routines are broken into two parts - by LSID and
 # by collecion ID...  BAD BAD BAD
-	$adaptor->delete_service_instance({service_instance_lsid => $self->lsid});
+	$adaptor->delete_service_instance(service_instance_lsid => $self->lsid);
 	$adaptor->delete_simple_input(service_instance_lsid => $self->lsid);
 	$adaptor->delete_simple_output(service_instance_lsid => $self->lsid);
 	
@@ -313,9 +313,8 @@
 	my $dbh = $self->dbh;
 	my $authority;
 	$CONFIG ||= MOBY::Config->new;
-	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-	
-	my $result = $adaptor->query_authority({authority_uri => $self->authority_uri});
+	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );	
+	my $result = $adaptor->query_authority(authority_uri => $self->authority_uri);
 	
 	if ( @$result[0]) {
 		my $row = shift(@$result);




More information about the MOBY-guts mailing list