[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Tue Aug 23 18:04:59 UTC 2005


mwilkinson
Tue Aug 23 14:04:59 EDT 2005
Update of /home/repository/moby/moby-live/Perl/MOBY
In directory pub.open-bio.org:/tmp/cvs-serv22488/MOBY

Modified Files:
	OntologyServer.pm 
Log Message:
not querying hasa relationships to correctly identify identical articlenames

moby-live/Perl/MOBY OntologyServer.pm,1.74,1.75
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v
retrieving revision 1.74
retrieving revision 1.75
diff -u -r1.74 -r1.75
--- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/08/23 17:37:46	1.74
+++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/08/23 18:04:59	1.75
@@ -514,10 +514,11 @@
 	# case insensitive?
 	my $OS = MOBY::OntologyServer->new(ontology => 'object');
 	my $OSrel = MOBY::OntologyServer->new(ontology => 'relationship');
-	my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa');
-	my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa');
-	my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has');
+	my ($exists1, $desc, $isalsid) = $OSrel->relationshipExists(term => 'isa', ontology => 'object');
+	my ($exists2, $desc2, $hasalsid) = $OSrel->relationshipExists(term => 'hasa', ontology => 'object');
+	my ($exists3, $desc3, $haslsid) = $OSrel->relationshipExists(term => 'has', ontology => 'object');
 	
+	return 1 unless ($exists1 && $exists2 && $exists3);  # this is bad, since it returns boolean suggesting that it found a common articlename rather than finding that a given relationship doesn't exist, but... hey....
 	my $relationships = $OS->Relationships(
 		ontology => 'object',
 		term => $args{term},
@@ -526,6 +527,7 @@
 		expand =>  1);
 	 #relationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]]	
 	my ($isa) = keys(%$relationships);  # can only be one key returned, and must be isa in this case
+	return 1 unless $relationships->{$isa};
 	my @ISAlist = @{$relationships->{$isa}};
 	foreach my $ISA(@ISAlist){  # $ISA = [lsid, articleName] (but articleName shuld be null anyway in this case)
 		my $what_it_is = shift @$ISA;




More information about the MOBY-guts mailing list