[MOBY-guts] biomoby commit
Mark Wilkinson
mwilkinson at pub.open-bio.org
Tue Jul 19 22:54:10 UTC 2005
mwilkinson
Tue Jul 19 18:54:10 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv22194/MOBY
Modified Files:
OntologyServer.pm
Log Message:
most calls in OntologyServer were mis-directed to the mobycentral data adaptor instead of teh mobyobject, mobyservice, mobynamespace etc adaptors. They should all direct properly now
moby-live/Perl/MOBY OntologyServer.pm,1.52,1.53
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/07/18 22:32:20 1.52
+++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm 2005/07/19 22:54:10 1.53
@@ -185,7 +185,7 @@
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
my $term = $args{term};
$term =~ s/^moby://; # if the term is namespaced, then remove that
@@ -248,7 +248,7 @@
sub createObject {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
#node => $term,
#desc => $desc,
#authURI => $auth,
@@ -310,7 +310,7 @@
sub retrieveObject {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
my $term = $args{'node'};
return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' );
return ( 0, "requires a object type node as an argument", '' )
@@ -359,7 +359,7 @@
sub deprecateObject {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
return ( 0, "WRONG ONTOLOGY", '' ) unless ( $self->ontology eq 'object' );
my $term = $args{term};
@@ -418,8 +418,7 @@
# ontology => $ontology
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
-
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' );
return ( 0, "WRONG ONTOLOGY!", '' )
unless ( $self->ontology eq 'relationship' );
my $term = lc( $args{term} );
@@ -469,7 +468,7 @@
#contact_email => $email
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' );
return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'object' );
my ( $subj_id, $subj_lsid, $obj_id, $obj_lsid );
@@ -552,7 +551,7 @@
#contact_email => $email);
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' );
@@ -613,7 +612,7 @@
sub serviceExists {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' );
my $term = $args{term};
@@ -657,7 +656,7 @@
sub createServiceType {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
#node => $term,
#descrioption => $desc,
@@ -701,7 +700,7 @@
sub deleteServiceType {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
return ( 0, "WRONG ONTOLOGY!", '' ) unless ( $self->ontology eq 'service' );
my $term = $args{term};
@@ -766,7 +765,7 @@
sub namespaceExists {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
return ( 0, "WRONG ONTOLOGY!", '' )
unless ( $self->ontology eq 'namespace' );
@@ -811,7 +810,7 @@
sub createNamespace {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
#node => $term,
#descrioption => $desc,
#authority => $auth,
@@ -855,7 +854,7 @@
sub deleteNamespace {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
return ( 0, "WRONG ONTOLOGY!", '' )
unless ( $self->ontology eq 'namespace' );
my $term = $args{term};
@@ -913,7 +912,7 @@
sub retrieveAllServiceTypes {
my ($self) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
my $types = $adaptor->query_service();
my %response;
@@ -930,7 +929,7 @@
sub retrieveAllNamespaceTypes {
my ($self) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
my $types = $adaptor->query_namespace();
my %response;
@@ -947,7 +946,7 @@
sub retrieveAllObjectClasses {
my ($self) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
my $types = $adaptor->query_object();
my %response;
@@ -966,7 +965,7 @@
sub getObjectCommonName {
my ( $self, $URI ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
return undef unless $URI =~ /urn\:lsid/;
my $result = $adaptor->query_object({object_lsid => $URI});
my $row = shift(@$result);
@@ -982,7 +981,7 @@
sub getNamespaceCommonName {
my ( $self, $URI ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
return undef unless $URI =~ /urn\:lsid/;
my $result = $adaptor->query_namespace({namespace_lsid => $URI});
my $row = shift(@$result);
@@ -998,7 +997,7 @@
sub getServiceCommonName {
my ( $self, $URI ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
return undef unless $URI =~ /urn\:lsid/;
my $result = $adaptor->query_service({service_lsid => $URI});
my $row = shift(@$result);
@@ -1014,7 +1013,7 @@
sub getServiceURI {
my ( $self, $term ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyservice' );
return $term if $term =~ /urn\:lsid/;
my $result = $adaptor->query_service({service_type => $term});
@@ -1031,7 +1030,7 @@
sub getObjectURI {
my ( $self, $term ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyobject' );
return $term if $term =~ /urn\:lsid/;
my $result = $adaptor->query_object({object_type => $term});
@@ -1048,7 +1047,7 @@
sub getNamespaceURI {
my ( $self, $term ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobynamespace' );
return $term if $term =~ /urn\:lsid/;
@@ -1066,7 +1065,7 @@
sub getRelationshipURI {
my ( $self, $ontology, $term ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' );
return $term if $term =~ /urn\:lsid/;
@@ -1084,7 +1083,7 @@
sub getRelationshipTypes {
my ( $self, %args ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobyrelationship' );
my $ontology = $args{'ontology'};
my $OS = MOBY::OntologyServer->new( ontology => "relationship" );
@@ -1150,7 +1149,8 @@
sub _doRelationshipsQuery {
my ( $self, $ontology, $term, $relationship, $direction ) = @_;
$CONFIG ||= MOBY::Config->new; # exported by Config.pm
- my $adaptor = $CONFIG->getDataAdaptor( datasource => 'mobycentral' );
+ my $datasource = "moby$ontology"; # like mobyobject, or mobyservice
+ 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});
More information about the MOBY-guts
mailing list