11

I have a biology database that I would like to query. There is also a given terminology bank I have access to that has formalizable predicates. I would like to build a query language for this DB using the predicates mentioned. How would you go about it? My solution is the following:

  1. formalize the predicates
  2. translate into a query language (sql, sparql, depends)
  3. Build a specific language with ANTLR or other such tools
  4. Translate from 3 to 2.

Is this a valid approach? Are there better ones? Any pointers would be much appreciated.

Dervin Thunk
  • 17,583
  • 26
  • 110
  • 202

4 Answers4

5

Take a look at Booleano.

PaulMcG
  • 56,194
  • 14
  • 81
  • 122
4

Use BNF to get a head-start into the language semantics..GoldParser will help you by playing around with the semantics and syntax (link here: http://www.devincook.com/). Once you have the BNF semantics sorted out, you can then build up actions based on the inputs, for example, a bnf grammar section dealing with extracting a composition of a limb's genetic makeup classification (I do not know if that is in existence, abstract example here but you get the gist) for a particular query...'fetch stats on limb where limb is leg', then behind the scenes you would issue a SQL select on a column alias or name from a predefined table ... I could be wrong on the approach... Hope it helps?

t0mm13b
  • 32,846
  • 7
  • 71
  • 106
  • So you suggest I define the syntax of the dsl first, and then the rest. Maybe this is the right way to go, it will guide the rest of the efforts. Is that your take? Thanks! – Dervin Thunk Nov 18 '09 at 11:19
  • Yes, that would be my take on it. Glad to be of help! :) – t0mm13b Nov 18 '09 at 18:22
2

I suggest you take a look at the i2b2 framework, it's a graphical query language and query engine platform for patient databases.

It's probably hard to grasp all first but do take a look at the CRC cell or webservice in there, you'll see how they approached SQL generation from a clinical graphical query language in an interesting way (albeit, not so performance friendly :))

Rimian
  • 32,654
  • 13
  • 106
  • 109
wsb3383
  • 3,715
  • 11
  • 41
  • 59
-1

Consider using Irony.NET from here: Irony.NET

Babu James
  • 2,431
  • 4
  • 29
  • 48