[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Jul 25 17:50:02 UTC 2005


mwilkinson
Mon Jul 25 13:50:02 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv20439/MOBY

Modified Files:
	Central.pm collection_input.pm 
Log Message:
changing the adaptor API to be more perlish.  No longer passing a list of hashes, just a hash

moby-live/Perl/MOBY Central.pm,1.178,1.179 collection_input.pm,1.4,1.5
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.178
retrieving revision 1.179
diff -u -r1.178 -r1.179
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/22 23:20:26	1.178
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/25 17:50:02	1.179
@@ -3100,120 +3100,120 @@
 	return "<GETstring><![CDATA[$sprintf]]></GETstring>";
 }
 
-=head2 _traverseServiceDAG
-
- Title     :	_traverseServiceDAG
- Usage     :	@valid = $MOBY->_traverseServiceDAG($dbh, $serviceType, $sth_hash)
- Function  :	starting from $serviceType, find all child services non-redundantly
-                by traversing the DAG.
- Returns   :	list of Service.id database entries.
- Args      :	none
-
-=cut
-
-sub _traverseServiceDAG {
-
-	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
-	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-
-	my ( $dbh, $serviceType, $sth_hash ) = @_;
-	my %sth = %{$sth_hash};
-	my %ServiceIDs;
-
-	my $result = $adaptor->general_query({statement => $sth{get_service_type_id}}, {bind_values => [$serviceType]});
-  	my $row = shift(@$result);
-	my ($root_id) = @$row;
-	return undef unless $root_id;
-
-# we have to do a traversal of the DAG here to get all child nodes...
-# this is one UGLY piece of code written in a hurry!  Please, someone, shoot it and put it out of its misery...
-	$ServiceIDs{$root_id} = "untested";    # mark the one in-hand as untested
-	while ( grep /untested/, ( values %ServiceIDs ) )
-	{    # now, while there are untested services in our list...
-		foreach my $service ( keys %ServiceIDs )
-		{    # start parsing through the list
-			next
-			  if ( $ServiceIDs{$service} eq "tested" )
-			  ;    # if it has been tested already then move on
-
-			my $result = $adaptor->general_query({statement => $sth{get_service_hierarchy_list}}, {bind_values => [$service]} );
-			   # execute the query for child nodes
-			$ServiceIDs{$service} = "tested";    # mark it as tested
-			foreach my $row (@$result)
-			{    # now get each of the child nodes
-				my $new = @$row;
-				next
-				  if ( defined $ServiceIDs{$new} )
-				  ;    # if we have already heard about it then move on
-				$ServiceIDs{$new} = "untested"
-				  ;    #otherwise mark it as untested, and start all over again
-			}
-		}
-	}
-	return keys %ServiceIDs;
-}
-
-=head2 _traverseObjectDAG
-
- Title     :	_traverseObjectDAG
- Usage     :	@valid = $MOBY->_traverseObjectDAG( $dbh, $objectType, $sth_hash, "p|c")
- Function  :	from $objectType, find all parent/child objects non-redundantly
-                by traversing the DAG.
- Returns   :	list of Object.id database entries.
- Args      :	objectType (by name), $statement ahngles, "p" parent, or "c" child
-
-=cut
-
-sub _traverseObjectDAG {
-	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
-	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-
-	my ( $dbh, $objectType, $sth_hash, $dir ) = @_;
-	my %sth = %{$sth_hash};
-	my %ObjectIDs;
-
-	my $result = $adaptor->general_query({statement => $sth{get_object_type_id}}, {bind_values => [$objectType]});
-
-	my $row = shift (@$result);
-	my ($root_id) = @$row;
-	return undef unless $root_id;
-	
-# we have to do a traversal of the DAG here to get all child nodes...
-# this is one UGLY piece of code written in a hurry!  Please, someone, shoot it and put it out of its misery...
-	$ObjectIDs{$root_id} = "untested";    # mark the one in-hand as untested
-	while ( grep /untested/, ( values %ObjectIDs ) )
-	{    # now, while there are untested services in our list...
-		foreach my $object ( keys %ObjectIDs )
-		{    # start parsing through the list
-			next
-			  if ( $ObjectIDs{$object} eq "tested" )
-			  ;                     # if it has been tested already then move on
-
-			my $result;
-			if ( $dir eq "p" ) {
-				$debug && &_LOG("getting parents");
-				$result = $adaptor->general_query({statement => $sth{get_object_parent_list}}, {bind_values => [$object]});
-			}
-			else {
-				$debug && &_LOG("getting children");
-				$result = $adaptor->general_query({statement => $sth{get_object_child_list}}, {bind_values => [$object]});
-			}
-			# execute the query for child nodes
+#=head2 _traverseServiceDAG
+#
+# Title     :	_traverseServiceDAG
+# Usage     :	@valid = $MOBY->_traverseServiceDAG($dbh, $serviceType, $sth_hash)
+# Function  :	starting from $serviceType, find all child services non-redundantly
+#                by traversing the DAG.
+# Returns   :	list of Service.id database entries.
+# Args      :	none
+#
+#=cut
+#
+#sub _traverseServiceDAG {
+#
+#	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
+#	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+#
+#	my ( $dbh, $serviceType, $sth_hash ) = @_;
+#	my %sth = %{$sth_hash};
+#	my %ServiceIDs;
+#
+#	my $result = $adaptor->general_query({statement => $sth{get_service_type_id}}, {bind_values => [$serviceType]});
+#  	my $row = shift(@$result);
+#	my ($root_id) = @$row;
+#	return undef unless $root_id;
+#
+## we have to do a traversal of the DAG here to get all child nodes...
+## this is one UGLY piece of code written in a hurry!  Please, someone, shoot it and put it out of its misery...
+#	$ServiceIDs{$root_id} = "untested";    # mark the one in-hand as untested
+#	while ( grep /untested/, ( values %ServiceIDs ) )
+#	{    # now, while there are untested services in our list...
+#		foreach my $service ( keys %ServiceIDs )
+#		{    # start parsing through the list
+#			next
+#			  if ( $ServiceIDs{$service} eq "tested" )
+#			  ;    # if it has been tested already then move on
+#
+#			my $result = $adaptor->general_query({statement => $sth{get_service_hierarchy_list}}, {bind_values => [$service]} );
+#			   # execute the query for child nodes
+#			$ServiceIDs{$service} = "tested";    # mark it as tested
+#			foreach my $row (@$result)
+#			{    # now get each of the child nodes
+#				my $new = @$row;
+#				next
+#				  if ( defined $ServiceIDs{$new} )
+#				  ;    # if we have already heard about it then move on
+#				$ServiceIDs{$new} = "untested"
+#				  ;    #otherwise mark it as untested, and start all over again
+#			}
+#		}
+#	}
+#	return keys %ServiceIDs;
+#}
 
-			$ObjectIDs{$object} = "tested";    # mark it as tested
-			foreach my $row (@$result)
-			{                                  # now get each of the child nodes
-				my $new = @$row;
-				next
-				  if ( defined $ObjectIDs{$new} )
-				  ;    # if we have already heard about it then move on
-				$ObjectIDs{$new} = "untested"
-				  ;    #otherwise mark it as untested, and start all over again
-			}
-		}
-	}
-	return keys %ObjectIDs;
-}
+#=head2 _traverseObjectDAG
+#
+# Title     :	_traverseObjectDAG
+# Usage     :	@valid = $MOBY->_traverseObjectDAG( $dbh, $objectType, $sth_hash, "p|c")
+# Function  :	from $objectType, find all parent/child objects non-redundantly
+#                by traversing the DAG.
+# Returns   :	list of Object.id database entries.
+# Args      :	objectType (by name), $statement ahngles, "p" parent, or "c" child
+#
+#=cut
+#
+#sub _traverseObjectDAG {
+#	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
+#	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+#
+#	my ( $dbh, $objectType, $sth_hash, $dir ) = @_;
+#	my %sth = %{$sth_hash};
+#	my %ObjectIDs;
+#
+#	my $result = $adaptor->general_query({statement => $sth{get_object_type_id}}, {bind_values => [$objectType]});
+#
+#	my $row = shift (@$result);
+#	my ($root_id) = @$row;
+#	return undef unless $root_id;
+#	
+## we have to do a traversal of the DAG here to get all child nodes...
+## this is one UGLY piece of code written in a hurry!  Please, someone, shoot it and put it out of its misery...
+#	$ObjectIDs{$root_id} = "untested";    # mark the one in-hand as untested
+#	while ( grep /untested/, ( values %ObjectIDs ) )
+#	{    # now, while there are untested services in our list...
+#		foreach my $object ( keys %ObjectIDs )
+#		{    # start parsing through the list
+#			next
+#			  if ( $ObjectIDs{$object} eq "tested" )
+#			  ;                     # if it has been tested already then move on
+#
+#			my $result;
+#			if ( $dir eq "p" ) {
+#				$debug && &_LOG("getting parents");
+#				$result = $adaptor->general_query({statement => $sth{get_object_parent_list}}, {bind_values => [$object]});
+#			}
+#			else {
+#				$debug && &_LOG("getting children");
+#				$result = $adaptor->general_query({statement => $sth{get_object_child_list}}, {bind_values => [$object]});
+#			}
+#			# execute the query for child nodes
+#
+#			$ObjectIDs{$object} = "tested";    # mark it as tested
+#			foreach my $row (@$result)
+#			{                                  # now get each of the child nodes
+#				my $new = @$row;
+#				next
+#				  if ( defined $ObjectIDs{$new} )
+#				  ;    # if we have already heard about it then move on
+#				$ObjectIDs{$new} = "untested"
+#				  ;    #otherwise mark it as untested, and start all over again
+#			}
+#		}
+#	}
+#	return keys %ObjectIDs;
+#}
 
 #Eddie - converted
 sub _nodeTextContent {

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/collection_input.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- /home/repository/moby/moby-live/Perl/MOBY/collection_input.pm	2005/07/18 16:53:03	1.4
+++ /home/repository/moby/moby-live/Perl/MOBY/collection_input.pm	2005/07/25 17:50:02	1.5
@@ -94,9 +94,8 @@
 	my ($self) = @_;
 	$CONFIG ||= MOBY::Config->new;    # exported by Config.pm
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-	my $id = $adaptor->insert_collection_input(
-								 {service_instance => $self->service_instance_id},
-								 {article_name     => $self->article_name} );
+	my $id = $adaptor->insert_collection_input(service_instance => $self->service_instance_id,
+						   article_name     => $self->article_name);
 	return $id;
 }
 




More information about the MOBY-guts mailing list