[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Mon Sep 15 00:09:13 EDT 2003


mwilkinson
Sun Sep 14 23:09:13 EDT 2003
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv21530/Client

Modified Files:
	Central.pm 
Log Message:
added a client-side function called ISA that returns a boolean for questions like 'does this object inherit from this other object type'

moby-live/Perl/MOBY/Client Central.pm,1.52,1.53
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/09/15 02:44:40	1.52
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2003/09/15 03:09:13	1.53
@@ -10,6 +10,7 @@
 use MOBY::Client::Registration;
 use MOBY::Client::SimpleArticle;
 use MOBY::Client::CollectionArticle;
+use MOBY::Client::OntologyServer;
 
 use vars qw($AUTOLOAD @ISA $MOBY_server $MOBY_uri);
 
@@ -1294,7 +1295,8 @@
 	my $object = $args{'objectType'};
 	my $service = $args{'serviceType'};
 	my $expand = $args{'expandRelationships'};
-	
+	$expand = $args{'expandRelationship'} unless defined($expand); # be forgiving of typos
+
 	my @relationships;
 	@relationships = @{$args{'Relationships'}} if ($args{'Relationships'} && (ref($args{'Relationships'}) =~ /array/i));
 	my $reg = $args{'Registry'};
@@ -1373,13 +1375,16 @@
 sub ISA {
 	my ($self, $class1, $class2) = @_;
 	my $OS = MOBY::Client::OntologyServer->new;
-	my ($s, $d, $lsid1) = $OS->objectExists($class1);
+	my ($s, $d, $lsid1) = $OS->objectExists(term => $class1);
+	print "class1 is $lsid1\n";
 	return 0 unless $s;
-	my ($s2, $d2, $lsid2) = $OS->objectExists($class2);
+	my ($s2, $d2, $lsid2) = $OS->objectExists(term => $class2);
+	print "class2 is $lsid2\n";
 	return 0 unless $s2;
 	my $resp = $self->Relationships(objectType => $lsid1, expandRelationship => 1);
 	my $lsids = $resp->{'urn:lsid:biomoby.org:objectrelation:isa'};
 	foreach (@$lsids){
+		print "testing is $_ vs $lsid2\n";
 		return 1 if $_ eq $lsid2;
 	}
 	return 0;



More information about the MOBY-guts mailing list