The SRU/SRW interfaces from LOC use CQL as a formal language to represent queries:
CQL is a formal language for representing queries to information retrieval systems such as web indexes, bibliographic catalogs and museum collection information. The design objective is that queries be human readable and writable, and that the language be intuitive while maintaining the expressiveness of more complex languages.
Our CQL Parser reliably converts CQL queries to other representations required by Search Engines such as Lucene or FDS or any other system. The parser is Level 1 compliant and supports Context Sets.
The code for the CQL parser is Open Source and available for download or directly from version control:
It has been accepted by the Library of Congress (LOC) as tool for SRU/SRW and they have it on their website: http://www.loc.gov/standards/sru/tools.html.
It runs production on the KennisNet EduRep platform (Dutch), the DAREnet platform and several others.