[Bioperl-l] ontology help

Marc Logghe Marc.Logghe at devgen.com
Thu Jun 24 04:05:45 EDT 2004


Hi Hilmar !

> As for what's causing the error, it is most likely the 
> following call  
> at line# 503.
> 
> 		     	$relfact->create_object(-object_term    
> => $parent_term,
> 					     	-subject_term   =>
> 					         	
> $self->get_term_by_identifier(
> 							        
>     $child_id),
> 					     	-predicate_term 
> => $rel_info,
> 					     	-ontology 
> =>$parent_term->ontology
> 					     	);
> 
> get_term_by_identifier() returns an array, not a scalar, and 
> an array  
> in scalar context evaluates to the number of elements (a 
> scalar, not a  
> term object). I've fixed this in cvs HEAD. Let me know if 
> this solves  
> the problem
Correct diagnosis !
At least I don't get the exception anymore. But it is still not working properly for me (but I am still not sure whether I've set it all up in the correct way).
my @rels = $ONTa2ONTbMap->get_relationships($key)
return me all the relations but when I want to print them like such:
foreach my $rel (@rels)
{
  printf "%s %s %s\n", 
  eval{$rel->subject_term->name} || 'unknown subject', 
  $rel->predicate_term->name,
  $rel->object_term->name;
}

The subject_term object seems to be undef in all cases. I think this is due to the fact that the terms actually do not belong to the ONTa2ONTbMap ontology. The subject terms are probably not in the store, while the object terms are. The only two instatiated terms in this ontology are 2 predicate terms.
Another observations: when $ONTa2ONTbMap->get_relationships() is run (without arguments) no relationship objects are returned.
Marc



More information about the Bioperl-l mailing list