cql_rpn — Metaproxy CQL to RPN Query Language Transforming Module
A query language transforming filter which catches Z39.50
searchRequest
packages containing CQL
queries, transforms
those to RPN
queries,
and sends the searchRequests
on to the next
filters.
The filter takes a list of conversion elements each of which can either
refer to an external file with the file
attribute
or it may be a single specification with the key
attribute and cdata as
value.
See the YAZ manual for configuration file syntax and details.
A common and well-known challenge is that the ZeeRex SRU
Explain config file used in the sru_z3950
filter and the CQL
translation configuration
file used in this filter must be kept in synchronization.
Synchronization can be eased by using the provided XSLT stylesheet,
xml/xslt/explain2cqlpqftxt.xsl
, which transforms
from ZeeReX Explain to the latter. The example configurations have
been created by running:
xsltproc xml/xslt/explain2cqlpqftxt.xsl etc/explain.xml > etc/cql2pqf.txt
# Metaproxy XML config file schemas
#
# Copyright (C) Index Data
# See the LICENSE file for details.
namespace mp = "http://indexdata.com/metaproxy"
filter_cql_rpn =
attribute type { "cql_rpn" },
attribute id { xsd:NCName }?,
attribute name { xsd:NCName }?,
element mp:conversion {
attribute file { xsd:string }?,
attribute key { xsd:string }?,
attribute reverse { xsd:boolean }?,
text
}+
In this example, the filter is used to transform CQL queries to RPN queries. The first conversion elements reads from an external file with presumably "core" definitions. This this extended in 2nd conversion element which specifies another search field.
<filter id="cql" type="cql_rpn"> <conversion file="etc/cql2pqf.txt"/> <conversion key="index.dc.any">1=1016</conversion> </filter>