> Date: Wed, 15 Feb 2006 09:51:31 -0500
> From: Rafe Rosen <[log in to unmask]>
>
> Sorry, my bad, I should have been more clear,
>
> My project is implementing a CQL interface to our database of
> 160,000 recordings of animal sound and video. My task is to build a
> system that translates a CQL query entered by a human into an
> appropriate (and potentially complex) SQL select statement to be
> sent to the database. Since there is (was?) an XML-CQL
> representation, and XML is pretty pervasive, I figured if there was
> a similar schema defined for SQL I could to the transformation with
> XSLT.
Oh, I see. Well, that makes sense. But --
> I have since been advised that the above strategy is a Bad Idea.
I'd have to agree. I think it would be going too far around the
houses, and that you'll need the idiomatic power of a Proper
Programming Language to do the job well, rather than the
super-powerful-in-the-right-context-but-unwieldy-otherwise wonder that
is XSLT.
> I'm probably going to use the parse tree structures created by
> CQL-java (for CQL) and either ZQL or hibernate (for SQL).
That sounds like a more promising approach.
> If anyone on the list has experience translating CQL to SQL, I would
> love to hear about it.
Part of the trick is translating from abstract CQL indexes to
correponding SQL columns. Another issue is that often you need to
make joins in the SQL that don't directly correspond to anything in
the CQL. It's one of those jobs that's fraught with many tiny issues
that you can't see coming until you trip over them.
Good luck :-)
> And what is the exact status of XCQL? I'm pretty new on this list
> and hadn't heard it had been dropped.
At one stage, it was possible (in SRW, and perhaps in SRU though it
would have been terrifyingly ugly) to submit the query in XCQL instead
of CQL. That facility has now been withdrawn. Where XCQL _is_ still
used is in echoing back the compiled query; but that doesn't help you
at all if you're a server implementor. Full details at
http://www.loc.gov/standards/sru/
and the linked pages.
_/|_ ___________________________________________________________________
/o ) \/ Mike Taylor <[log in to unmask]> http://www.miketaylor.org.uk
)_v__/\ "_Apatosaurus_ sort of looks like a pro wrestler when most of
the other sauropods tend to look like ballerinas" -- Matt Wedel.
|