[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Mon Jul 18 22:32:20 UTC 2005
mwilkinson
Mon Jul 18 18:32:20 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi
In directory pub.open-bio.org:/tmp/cvs-serv17143/MOBY/Adaptor/moby/queryapi
Modified Files:
mysql.pm
Log Message:
fixing brackets and semicolons
moby-live/Perl/MOBY/Adaptor/moby/queryapi mysql.pm,1.14,1.15
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/18 16:54:29 1.14
+++ /home/repository/moby/moby-live/Perl/MOBY/Adaptor/moby/queryapi/mysql.pm 2005/07/18 22:32:20 1.15
@@ -173,7 +173,7 @@
my ($self, @args) = @_;
my $dbh = $self->dbh;
my $statement = get_value('statement', @args);
- my $sth = $dbh->prepare($statement};
+ my $sth = $dbh->prepare($statement);
if (@args > 1)
{
my $bindvalues = get_value('bind_values', @args);
@@ -183,7 +183,7 @@
$sth->execute;
}
my $result = $sth->fetchall_arrayref();
- return result;
+ return $result;
}
sub query_collection_input{
@@ -340,7 +340,7 @@
my @bindvalues = ();
($statement, @bindvalues) = add_condition($statement, @args);
$dbh->do( $statement,
- undef, @bindvalues )
+ undef, @bindvalues );
if (dbh->err){
return (1, dbh->errstr);
}
@@ -693,8 +693,8 @@
sub getUniqueAuthorityURI{
my ($self, @args) = @_;
my $dbh = $self->dbh;
- $statement = "select distinct authority_uri from authority";
- $bindvalues = ();
+ my $statement = "select distinct authority_uri from authority";
+ my @bindvalues = ();
my $result = do_query($dbh, $statement, @bindvalues);
return $result;
}
@@ -709,7 +709,7 @@
values (?,?,?)",
undef,
(get_value('authority_common_name', @args),
- get_value('authority_uri' @args),
+ get_value('authority_uri', @args),
get_value('contact_email', @args)));
my $id = $dbh->{mysql_insertid};
return $id;
@@ -976,9 +976,9 @@
my $dbh = $self->dbh;
my $existingURI = get_value('namespace_type_uris', @args);
my $term = get_value('term', @args);
+ my $errstr;
-my $sth =
- $dbh->prepare(
+ my $sth = $dbh->prepare(
"select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_input where INSTR(namespace_type_uris,'$existingURI')"
);
$sth->execute;
@@ -988,12 +988,11 @@
foreach (@nss) {
$_ =~ s/\s//g;
my $errstr = "Namespace Type $term ($_) is used by a service (service ID number $id) and may not be deregistered";
- return (1, $errstr);
+ return (1, $errstr)
if ( $_ eq $existingURI );
}
}
- $sth =
- $dbh->prepare(
+ $sth = $dbh->prepare(
"select service_instance.service_instance_id, namespace_type_uris from service_instance natural join simple_output where INSTR(namespace_type_uris,'$existingURI')"
);
$sth->execute;
@@ -1002,7 +1001,7 @@
foreach (@nss) {
$_ =~ s/\s//g;
my $errstr = "Namespace Type $term ($_) is used by a service (service ID number $id) and may not be deregistered";
- return (1, $errstr);
+ return (1, $errstr)
if ( $_ eq $existingURI );
}
}
@@ -1016,7 +1015,7 @@
foreach (@nss) {
$_ =~ s/\s//g;
my $errstr = "Namespace Type $term ($_) is used by a service (service ID number $id) and may not be deregistered";
- return (1, $errstr);
+ return (1, $errstr)
if ( $_ eq $existingURI );
}
}
@@ -1030,11 +1029,11 @@
foreach (@nss) {
$_ =~ s/\s//g;
my $errstr = "Namespace Type $term ($_) is used by a service (service ID number $id) and may not be deregistered";
- return (1, $errstr);
+ return (1, $errstr)
if ( $_ eq $existingURI );
}
}
- return (0, $errstr);
+ return (0, "");
}
# custom query routine for Moby::Central.pm -> findService()
@@ -1046,13 +1045,13 @@
my $searchstring;
foreach my $kw ( @{ $findme{keywords} } ) {
- $debug && &_LOG("KEYWORD $kw\n");
+# $debug && &_LOG("KEYWORD $kw\n");
$kw =~ s/\*//g;
$kw = $dbh->quote("%$kw%");
$searchstring .= " OR description like $kw ";
}
$searchstring =~ s/OR//; # just the first one
- $debug && &_LOG("search $searchstring\n");
+# $debug && &_LOG("search $searchstring\n");
my $statement = "select service_instance_id from service_instance where $searchstring";
my @bindvalues = ();
@@ -1103,7 +1102,7 @@
where
s.collection_${inout}_id IS NOT NULL
AND s.collection_${inout}_id = c.collection_${inout}_id
- AND object_type_uri = '$objectURI' "
+ AND object_type_uri = '$objectURI' ";
my $nsquery;
foreach my $ns ( @{$namespaceURIs} ) { # namespaces are already URI's
$nsquery .= " OR INSTR(namespace_type_uris, '$ns') ";
More information about the MOBY-guts
mailing list