[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at dev.open-bio.org
Fri Sep 14 14:55:31 UTC 2007


mwilkinson
Fri Sep 14 10:55:31 EDT 2007
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory dev.open-bio.org:/tmp/cvs-serv22049/MOBY/Adaptor/moby/queryapi

Modified Files:
	mysql.pm 
Log Message:
modifying SQL layer to get more ontology information out of various calls.  Starting with the Service ontology
moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.83,1.84
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -r1.83 -r1.84
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2007/02/07 15:19:00	1.83
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm	2007/09/14 14:55:31	1.84
@@ -836,8 +836,49 @@
           service_type,
           description,
           authority,
-          contact_email
-          from service $condition";
+          contact_email,
+	  from
+	  service 
+          $condition";
+	my $result;
+	if ($type){
+	    $result = do_query($dbh, $statement, ($type));
+	} else {
+	    $result = do_query($dbh, $statement);
+	}
+ 	return $result;		
+}
+
+sub new_query_service{
+	my ($self, %args) = @_;
+	my $type = $args{type};
+	my $condition = "";
+	if ($type =~ /^urn\:lsid/){
+	    $condition = "where s1.service_lsid = ?";
+	} elsif ($type) {
+	    $condition = "where s1.service_type = ?";
+	} else {
+	    $condition = "";
+	}
+	
+	my $dbh = _getDBHandle("mobyservice");
+
+	my $statement = "select
+	  s1.service_id, 
+          s1.service_lsid,
+          s1.service_type,
+          s1.description,
+          s1.authority,
+          s1.contact_email,
+	  s2.service_type,
+	  s2.service_lsid 
+          from
+	  service as s1
+	  left join service_term2term as t
+	    on s1.service_id= t.service1_id
+	left join service as s2
+	on s2.service_id=t.service2_id
+        $condition";
 	my $result;
 	if ($type){
 	    $result = do_query($dbh, $statement, ($type));
@@ -847,6 +888,8 @@
  	return $result;		
 }
 
+
+
 # pass in ....
 sub insert_service{
 	my ($self, %args) = @_;	




More information about the MOBY-guts mailing list