[MOBY-guts] biomoby commit

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


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

Modified Files:
	OntologyServer.pm 
Log Message:
don't assume that there will be has and hasa relationships at all

moby-live/Perl/MOBY OntologyServer.pm,1.75,1.76
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm,v
retrieving revision 1.75
retrieving revision 1.76
diff -u -r1.75 -r1.76
--- /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/08/23 18:04:59	1.75
+++ /home/repository/moby/moby-live/Perl/MOBY/OntologyServer.pm	2005/08/23 18:13:30	1.76
@@ -537,11 +537,15 @@
 			relationship => $hasalsid,
 			direction => 'root',
 			);
-		 #$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]]	
-		my ($hasa) = keys(%$hasarelationships); 
-		my @HASAlist = @{$hasarelationships->{$hasa}};
-		foreach my $HASA(@HASAlist){
-			$foundCommonArticleNameFlag = 1 if ($HASA->[1] eq $articleName);
+		if ($hasarelationships){
+			#$hasarelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]]	
+		       my ($hasa) = keys(%$hasarelationships);
+		       if ($hasarelationships->{$hasa}){
+				my @HASAlist = @{$hasarelationships->{$hasa}};
+				foreach my $HASA(@HASAlist){
+					$foundCommonArticleNameFlag = 1 if ($HASA->[1] eq $articleName);
+				}
+		       }
 		}
 		my $hasrelationships = $OS->Relationships(
 			ontology => 'object',
@@ -549,12 +553,16 @@
 			relationship => $haslsid,
 			direction => 'root',
 			);
-		 #$hasrelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]]	
-		my ($has) = keys(%$hasrelationships); 
-		my @HASlist = @{$hasrelationships->{$has}};
-		foreach my $HAS(@HASlist){
-			$foundCommonArticleNameFlag = 1 if ($HAS->[1] eq $articleName);
-		}	
+		if ($hasrelationships){
+			#$hasrelationships{relationship} = [[lsid1,articleNmae], [lsid2, articleName], [lsid3, articleName]]	
+		       my ($has) = keys(%$hasrelationships);
+		       if ($hasrelationships->{$has}){
+			my @HASlist = @{$hasrelationships->{$has}};
+			foreach my $HAS(@HASlist){
+				$foundCommonArticleNameFlag = 1 if ($HAS->[1] eq $articleName);
+			}
+		       }
+		}
 	}
 	return $foundCommonArticleNameFlag;
 }




More information about the MOBY-guts mailing list