[Bioperl-l] bioperl-db: rich queries implementation

Matthew Pocock mrp@sanger.ac.uk
Tue, 12 Jun 2001 23:04:00 +0100


Hi all,

You may like to look at the package org.biojava.utils.query in BioJava, 
and the demo under biojava-live/demos/query. This is an object model for 
an object-functional/declarative data-traversal/retrieval language 
supporting arbitrary order function binding (rather than 1st order e.g. 
to the instance binding), and total insulation of the query engine from 
the data storage. It is language-complete (can be implemented in 
itself), and will allow you to selectively compile portions of your 
query to SQL, method invocations and the like. It also potentialy allows 
you to represent constraints on your data that are not easy to represent 
in object-oriented or relational syntaxes (e.g. no feature can contain 
itself as a child directly/indirectly, the alignment in a homology 
feature must contain a sequence labeled by that feature, other nasties), 
and these constraints can be leveraged to provide faster query 
execution. Things like the compilers from query to SQL, native code etc. 
can be represented as queries in their own rite, allowing realy funkey 
optimizations to be automted.

I think that a perl implementation would be trivial (the Java 
interpreter is ~30 lines). Since it can be implemented in itself, you 
can use this simple interpreter to bootstrap in any 
code/query-optimizations that you come up with.

Anyway, I digress. The API and proof-of-concept code is there. If 
nothing else, it shows that you can create a realy flexible language 
with almost no constructs. It may give you some ideas about how to 
represent the DB queries in a more flexible way.

Matthew

Elia Stupka wrote:

> Wow, this sounds excellent. 
> 
> Since I am playing often and writing bioperl-db stuff, I would be very
> interested in seeing the code committed, and contributing to it. I was
> helping a team in Singapore with ensembl and incidentally we are also
> building there a very juicy bioperl-db, which they were going to use both
> for EnsEMBL and as a stand-alone db to query viaa the web, so that will be
> a perfect test case!
> 
> Elia
> 
> **************************
> tel:    +44 1223 49 44 31
> mobile: +44 7971 59 03 69
> fax:    +44 1223 49 44 68
> **************************
> 
> 
> 
> _______________________________________________
> Bioperl-l mailing list
> Bioperl-l@bioperl.org
> http://bioperl.org/mailman/listinfo/bioperl-l