[Bioperl-l] ontology help

Hilmar Lapp hlapp at gmx.net
Fri Jun 25 10:49:19 EDT 2004

I believe the current implementation of delegation from the 
Bio::Ontology::Ontology methods to their counterparts in the currently 
used engine implementation expects that only terms and rel.ships from 
the same ontology will be asked for.

The original rationale behind this was to make it possible to use one 
and the same engine instance to back multiple OntologyI instances. If 
you did this, you would need to filter out terms from other ontologies 
co-using the engine instance.

At hindsight I think this is probably over-engineered and trying to 
solve a non-existing problem. So, we could as well demand that one 
engine instance only serve one ontology instance and you're on your own 
if you do otherwise. This would then allow us to remove the 
post-filtering code that filters hits returned from the engine.

You could try and see whether that will solve your problem as well.


On Thursday, June 24, 2004, at 10:05  AM, Marc Logghe wrote:

> 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
Hilmar Lapp                            email: lapp at gnf.org
GNF, San Diego, Ca. 92121              phone: +1-858-812-1757

More information about the Bioperl-l mailing list