[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Jul 26 23:32:48 UTC 2005


mwilkinson
Tue Jul 26 19:32:48 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv25766/MOBY

Modified Files:
	Central.pm OntologyServer.pm 
Log Message:
adaptor API should now be complete

moby-live/Perl/MOBY Central.pm,1.185,1.186 OntologyServer.pm,1.58,1.59
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Central.pm,v
retrieving revision 1.185
retrieving revision 1.186
diff -u -r1.185 -r1.186
--- /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/25 23:45:29	1.185
+++ /home/repository/moby/moby-live/Perl/MOBY/Central.pm	2005/07/26 23:32:48	1.186
@@ -22,7 +22,7 @@
 use MOBY::secondary_input;
 use MOBY::central_db_connection;
 use MOBY::Config;
-#use MOBY::Client::Central;
+use MOBY::Client::Central;
 
 #use MOBY::RDF::ServiceInstanceRDF;
 #use RDF::Core;
@@ -1996,12 +1996,10 @@
 		$debug
 		  && _LOG("Keywords added; criterion count is now $criterion_count\n");
 		  
-		my ($ids, $searchstring) = $adaptor->checkKeywords({findme => %findme});
+		my ($ids) = $adaptor->check_keywords(keywords => \@{$findme{keywords}});
 		$ids = _extract_ids($ids);  # this is the hash-list that comes back from do_query
 		  
 		unless ( scalar @{$ids} ) {
-			$debug
-			  && &_LOG("found no ids @{$ids}!\nselect service_instance_id from service_instance where $searchstring\n");
 			return &_serviceListResponse( $dbh, undef );
 		}
 		$debug
@@ -2193,7 +2191,9 @@
 	}
 	$ancestor_string =~ s/\,$//;
 	
-	my $result = $adaptor->getFromSimple({inout => $inout}, {ancestor_string => $ancestor_string}, {namespaceURIs => $namespaceURIs});
+	my $result = $adaptor->find_by_simple(inout => $inout,
+					     ancestor_string => $ancestor_string,
+					     namespaceURIs => $namespaceURIs);
 
 	my @valid_services;
 	
@@ -2244,7 +2244,9 @@
 		my ( $objectURI, $namespaceURIs ) =
 		  &_extractObjectTypesAndNamespaces($simple);
 
-		my $result = $adaptor->getFromCollection({inout => $inout}, {objectURI => $objectURI}, {namespaceURIs => $namespaceURIs});
+		my $result = $adaptor->find_by_collection(inout => $inout,
+							 objectURI => $objectURI,
+							 namespaceURIs => $namespaceURIs);
 
 		foreach my $row (@$result )
 		{    # get the service instance ID and the namespaces that matched
@@ -2508,7 +2510,7 @@
 
 	my ($pkg) = shift;
 	my $dbh   = MOBY::central_db_connection->new()->dbh;
-	my $result = $adaptor->getServiceNames();
+	my $result = $adaptor->get_service_names();
 	my $names = "<serviceNames>\n";
 	foreach my  $row (@$result) {
 		$names .= "<serviceName name='$row->{servicename}' authURI='$row->{authority_uri}'/>\n";
@@ -2948,7 +2950,8 @@
 	# and flatten it into a list of parent terms
 	my ( $dbh, $type, $term, $seen ) = @_;
 
-	my $result = $adaptor->getParentTerms({relationship_type_id => $type}, {term => $term});
+	my $result = $adaptor->get_parent_terms(relationship_type_id => $type,
+						term => $term);
 
 	foreach my $row (@$result) {
 		my $term = $row->{term};

===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v
retrieving revision 1.58
retrieving revision 1.59
diff -u -r1.58 -r1.59
--- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/07/25 23:45:29	1.58
+++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/07/26 23:32:48	1.59
@@ -303,18 +303,18 @@
 	unless ($LSID) { return ( 0, "Failed during creation of an LSID", '' ) }
 	my $result = $adaptor->query_object(type => $LSID);
 	my $row = shift(@$result);
-	my $id = $row->{object_id};
+#	my $id = $row->{object_id};
 	my $type = $row->{object_type};
 	my $lsid = $row->{object_lsid};
 	my $desc = $row->{description};
 	my $auth = $row->{authority};
 	my $contact = $row->{contact_email};
 
-	unless ($id) { return ( 0, "Object doesn't exist in ontology", "" ) }
+	unless ($lsid) { return ( 0, "Object doesn't exist in ontology", "" ) }
 
 	# my $OS = MOBY::OntologyServer->new(ontology => "relationship");
 
-	$result = $adaptor->getObjectRelationships({object1_id => $id});
+	$result = $adaptor->get_object_relationships(type => $lsid);
 	my %rel;
 	foreach my $row (@$result)
 	{
@@ -688,7 +688,7 @@
 				 $lsid );
 	}
 
-	($err, $errstr) = $adaptor->delete_service_term2term({service1_id => $id});
+	($err, $errstr) = $adaptor->delete_service_term2term(service1_id => $lsid);
 
 	if ( $err ) {
 		return (
@@ -828,7 +828,7 @@
 				 $lsid );
 	}
 
-	($err, $errstr) = $adaptor->delete_namespace_term2term({namespace1_id => $id});
+	($err, $errstr) = $adaptor->delete_namespace_term2term(namespace1_id => $lsid);
 
 	if ( $err ) {
 		return (
@@ -1088,7 +1088,10 @@
 	my $adaptor = $CONFIG->getDataAdaptor( datasource => $datasource );
 	my $defs;
 	# query returns a reference to an array containing array references
-	$defs = $adaptor->getRelationship({direction => $direction}, {ontology => $ontology}, {term => $term}, {relationship => $relationship});
+	$defs = $adaptor->get_relationship(direction => $direction,
+					   ontology => $ontology,
+					   term => $term,
+					   relationship => $relationship);
 	# a very long piece of SQL statements have been refactored into Moby::Adaptor::moby::queryapi::mysql.pm
 	return $defs;
 }




More information about the MOBY-guts mailing list