[MOBY-guts] biomoby commit

Mark Wilkinson mwilkinson at pub.open-bio.org
Wed Feb 25 16:36:05 UTC 2004


mwilkinson
Wed Feb 25 11:36:05 EST 2004
Update of /home/repository/moby/moby-live/Perl/MOBY/Client
In directory pub.open-bio.org:/tmp/cvs-serv15488/MOBY/Client

Modified Files:
	Central.pm 
Log Message:
fixed bug to allow Namespaces without descriptions, as we have imported some of these from the latest GO xref abbs document

moby-live/Perl/MOBY/Client Central.pm,1.71,1.72
===================================================================
RCS file: /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm,v
retrieving revision 1.71
retrieving revision 1.72
diff -u -r1.71 -r1.72
--- /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2004/01/08 18:59:48	1.71
+++ /home/repository/moby/moby-live/Perl/MOBY/Client/Central.pm	2004/02/25 16:36:04	1.72
@@ -1231,7 +1231,8 @@
         my $ns = $namesp->item($x)->getAttributeNode('name')->getValue;
         my $desc;
         for my $elem($namesp->item($x)->getElementsByTagName('Description')){
-            $desc = $elem->getFirstChild->toString;
+            $desc = $elem->getFirstChild;
+			$desc = $desc?$desc->toString:"";
         }
         $namespaces{$ns} = $desc;
     }
@@ -1396,6 +1397,13 @@
 		@lsids = @$lsids;
 		$self->ISA_CACHE($lsid1, [@lsids]);
 		$self->ISA_CACHE($class1, [@lsids]);
+		my @hold = @lsids;
+		while (shift @hold){
+			$self->ISA_CACHE($_, [@hold]);
+			if ($_ =~ /^urn:lsid:biomoby.org.\w+\.(\S+)/){
+				$self->ISA_CACHE($1, [@lsids]);
+			}	
+		}
 	}
 	foreach (@lsids){
 		return 1 if $_ eq $lsid2;
@@ -1508,15 +1516,16 @@
 sub ObjLSID {
 	my ($self, $term) = @_;
 	return undef unless $term;
-	if (my $lsid = $self->LSID_CACHE($term)){
+	my $lsid;
+	if ($lsid = $self->LSID_CACHE($term)){
 		return $lsid;
 	} else {
 		my $os = MOBY::Client::OntologyServer->new;
-		my ($s, $m, $lsid) = $os->objectExists(term => $term);
-		if ($lsid){
-			$self->LSID_CACHE($term, $lsid);  # link both the term
-			$self->LSID_CACHE($lsid, $lsid);  # and the lsid to itself
-			return $lsid
+		my ($s, $m, $tlsid) = $os->objectExists(term => $term);
+		if ($tlsid){
+			$self->LSID_CACHE($term, $tlsid);  # link both the term
+			$self->LSID_CACHE($tlsid, $tlsid);  # and the lsid to itself
+			return $tlsid
 		} else {
 			return undef
 		}




More information about the MOBY-guts mailing list