[BioSQL-l] query problem

Marc Logghe Marc.Logghe at devgen.com
Mon Nov 10 15:34:06 EST 2003


> > seqfeature has two foreign keys to term, one for type 
> > ($feature->primary_tag) and one for source ($feature->source_tag). 
> > Without context, the OR mapper cannot know which one you're 
> referring 
> > to in a join. The mechanism for supplying context is appending the 
> > contextual keyword to the alias of the ambiguous parent, 
> delimited by 
> > '::'. For seqfeature's foreign keys to term, the context 
> keywords are 
> > primary_tag and source_tag. I.e., you need to write
> > 
> > 	...,
> > 	"Bio::Ontology::TermI=>Bio::SeqFeatureI t",
> > 	...
> > 
> > as
> > 
> > 	...,
> > 	"Bio::Ontology::TermI=>Bio::SeqFeatureI t::primary_tag",
> > 	...
> > 
> Pfuuu, I could't have found out that for myself. Thanks a lot.
> Unfortunatly in my case it did not work. The resulting SQL 
> looked like:
> SELECT f.oid, f.display_name, f.rank, f.ent_oid, 
> f.type_trm_oid, f.source_trm_oid FROM seqfeature f, bioentry 
> s, term t, biodatabase db WHERE f.ent_oid = s.oid AND f. = 
> t.oid AND s.db_oid = db.oid AND (db.name = 'test' AND t.name 
> = 'source' AND s.accession = 'ABC')
> Note the "f. = t.oid"
> Tried this with a freshly installed bioperl-db from cvs (MAIN 
> trunk) to rule out version problems.

I could only make "Bio::Ontology::TermI=>Bio::SeqFeatureI t::primary_tag" work when the "primary_tag" => "type_trm_oid" key/val pair was added to the 'term' key in the %slot_attribute_map of Bio::DB::BioSQL::Oracle::BasePersistenceAdaptorDriver.
It works, but I still have the feeling it does not really belong there, does it ?
Cheers,
Marc



More information about the BioSQL-l mailing list