[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 25 20:55:35 UTC 2005


mwilkinson
Mon Jul 25 16:55:35 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv21506/MOBY

Modified Files:
	OntologyServer.pm secondary_input.pm service_instance.pm 
Log Message:
more of the same.  Pass hashes instead of hashrefs, and avoid passing database ids

moby-live/Perl/MOBY OntologyServer.pm,1.54,1.55 secondary_input.pm,1.7,1.8 service_instance.pm,1.26,1.27
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -r1.54 -r1.55
--- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/07/19 23:37:35	1.54
+++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/07/25 20:55:35	1.55
@@ -192,17 +192,10 @@
 	my $sth;
 	return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' );
 
-#    if ($term =~ /^urn:lsid/ && !($term =~ /^urn:lsid:biomoby.org:objecttype/)){
-#        return (1, "external ontology", $term);
-#    }
 	my $result;
-	if ( $term =~ /^urn\:lsid/ ) {
-		$result = $adaptor->query_object({object_lsid => $term});
-		
-	} else {
-		$result = $adaptor->query_object({object_type => $term});
-
-	}
+	
+	$result = $adaptor->query_object(type => $term);
+	
 	my $row = shift(@$result);
 	my $lsid = $row->{object_lsid};
 	my $type = $row->{object_type};
@@ -271,12 +264,7 @@
 	  : $self->setURI( $args{'node'} );
 	unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) }
 	my $result;
-	if ( $args{'node'} =~ /^urn\:lsid/ ) {
-
-	$result = $adaptor->query_object({object_lsid => $term});		
-	} else {
-	$result = $adaptor->query_object({object_type => $term});		
-	}
+	$result = $adaptor->query_object(type => $term);		
 	my $row = shift(@$result);
 	my $lsid = $row->{object_lsid};
 	my $type = $row->{object_type};
@@ -320,7 +308,7 @@
 	  ? $args{'node'}
 	  : $self->getObjectURI($term);
 	unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) }
-	my $result = $adaptor->query_object({object_lsid => $LSID});
+	my $result = $adaptor->query_object(type => $LSID);
 	my $row = shift(@$result);
 	my $id = $row->{object_id};
 	my $type = $row->{object_type};
@@ -372,7 +360,7 @@
 	return ( 0, q{Object type $term cannot be resolved to an LSID}, "" )
 	  unless $LSID;
 	
-	my $result = $adaptor->query_object({object_lsid => $LSID});
+	my $result = $adaptor->query_object(type => $LSID);
 	my $row = shift(@$result);
 	my $id = $row->{object_id};
 	my $lsid = $row->{object_lsid};
@@ -471,41 +459,20 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
 
 	return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' );
+	
 	my ( $subj_id, $subj_lsid, $obj_id, $obj_lsid );
-	if ( $args{subject_node} =~ /^urn:lsid/ ) {
-
-		my $result = $adaptor->query_object({object_lsid => $args{subject_node}});
-		my $row = shift(@$result);
-	        $subj_id = $row->{object_id};
-	        $subj_lsid = $row->{object_lsid};
-
-	} else {
-		my $result = $adaptor->query_object({object_type => $args{subject_node}});
-		my $row = shift(@$result);
-		$subj_id = $row->{object_id};
-		$subj_lsid = $row->{object_lsid};
-
-	}
-	return ( 0,
-			 qq{Object type $args{subject_node} does not exist in the ontology},
-			 '' )
+	my $result = $adaptor->query_object(type => $args{subject_node});
+	my $row = shift(@$result);
+	$subj_id = $row->{object_id};
+	$subj_lsid = $row->{object_lsid};
+	return ( 0, qq{Object type $args{subject_node} does not exist in the ontology}, '' )
 	  unless defined $subj_id;
-	if ( $args{object_node} =~ /^urn:lsid/ ) {
-
-		my $result = $adaptor->query_object({object_lsid => $args{object_node}});
-		my $row = shift(@$result);
-	        $obj_id = $row->{object_id};
-		$obj_lsid = $row->{object_lsid};
-		
-	} else {
-		my $result = $adaptor->query_object({object_type => $args{object_node}});
-		my $row = shift(@$result);
-		$obj_id = $row->{object_id};
-		$obj_lsid = $row->{object_lsid};
-	}
-	return ( 0,
-			 qq{Object type $args{object_node} does not exist in the ontology},
-			 '' )
+	  
+	$result = $adaptor->query_object(type => $args{object_node});
+	$row = shift(@$result);
+	$obj_id = $row->{object_id};
+	$obj_lsid = $row->{object_lsid};
+	return ( 0,qq{Object type $args{object_node} does not exist in the ontology},'' )
 	  unless defined $obj_id;
 	my $isa = $adaptor->query_object_term2term({object2_id => $subj_id});
 
@@ -967,7 +934,7 @@
 	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
 	return undef unless $URI =~ /urn\:lsid/;
-	my $result = $adaptor->query_object({object_lsid => $URI});
+	my $result = $adaptor->query_object(type => $URI);
 	my $row = shift(@$result);
 	my $name = $row->{object_type};
 
@@ -1033,7 +1000,7 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
 	return $term if $term =~ /urn\:lsid/;
 
-	my $result = $adaptor->query_object({object_type => $term});
+	my $result = $adaptor->query_object(type => $term);
 	my $row = shift(@$result);
 	my $id = $row->{object_lsid};
 

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/secondary_input.pm,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- /home/repository/moby/moby-live/Perl/MOBY/secondary_input.pm	2005/07/25 19:53:35	1.7
+++ /home/repository/moby/moby-live/Perl/MOBY/secondary_input.pm	2005/07/25 20:55:35	1.8
@@ -115,13 +115,13 @@
 	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
 	my $dbh = $self->dbh;
-	my $insertid = $adaptor->insert_secondary_input({default_value => $self->default_value},
-							{maximum_value => $self->maximum_value},
-							{minimum_value => $self->minimum_value},
-							{enum_value => $self->enum_value},
-							{datatype => $self->datatype},
-							{article_name => $self->article_name},
-							{service_instance_lsid => $self->service_instance_id});
+	my $insertid = $adaptor->insert_secondary_input(default_value => $self->default_value,
+							maximum_value => $self->maximum_value,
+							minimum_value => $self->minimum_value,
+							enum_value => $self->enum_value,
+							datatype => $self->datatype,
+							article_name => $self->article_name,
+							service_instance_lsid => $self->service_instance_id);
 	
 	return $insertid;
 }

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/25 20:14:34	1.26
+++ /home/repository/moby/moby-live/Perl/MOBY/service_instance.pm	2005/07/25 20:55:35	1.27
@@ -269,24 +269,24 @@
 # by collecion ID...  BAD BAD BAD
 	$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});
+	$adaptor->delete_simple_output(service_instance_lsid => $self->lsid);
 	
 	my $result = $adaptor->query_collection_input({service_instance_lsid => $self->lsid});
 	
 	foreach my $row (@$result) {
 		my $id = $row->{collection_input_id};
-		$adaptor->delete_simple_input({collection_input_id => $id});
+		$adaptor->delete_simple_input(collection_input_id => $id);
 	}
 	$result = $adaptor->query_collection_output(service_instance_lsid => $self->lsid);
 	
 	foreach my $row (@$result) {
 		my $id = $row->{collection_output_id};
 		
-		$adaptor->delete_simple_output({collection_output_id => $id});
+		$adaptor->delete_simple_output(collection_output_id => $id);
 	}
 	$adaptor->delete_collection_input(service_instance_lsid => $self->lsid);
 	$adaptor->delete_collection_output(service_instance_lsid => $self->lsid);
-	$adaptor->delete_secondary_input({service_instance_lsid => $self->lsid});
+	$adaptor->delete_secondary_input(service_instance_lsid => $self->lsid);
 			
 	return 1;
 }




More information about the MOBY-guts mailing list