zoom — Metaproxy ZOOM Module
This filter implements a generic client based on ZOOM of YAZ. The client implements the protocols that ZOOM C does: Z39.50, SRU (GET, POST, SOAP) and SOLR .
This filter only deals with Z39.50 on input. The following services are supported: init, search, present and close. The backend target is selected based on the database as part of this search and not as part of init.
This filter is an alternative to the z3950_client filter but also shares properties of the virt_db - in that the target is selected for a specific database
The ZOOM filter relies on a target profile description, which is
XML based. It picks the profile for a given database from a web service
or it may be locally given for each unique database (AKA virtual database
in virt_db). Target profiles are directly and indrectly given as part
of the torus
element in the configuration.
The configuration consists of three parts: torus
,
fieldmap
and cclmap
.
The torus
element specifies target profiles
and takes the following content:
url
URL of Web service to be used to fetch target profile
for a given database (udb). The special sequence
%db
of the URL is replaced by the
actual database specified as part of Search.
xsldir
Directory that is searched for XSL stylesheets. Stylesheets
are specified in the target profile by the
transform
element.
records
Local target profiles. This element may includes zero or
more record
elements (one per target
profile). See section TARGET PROFILE.
The fieldmap
may be specified zero or more times and
specifies the map from CQL fields to CCL fields and takes the
following content:
cql
CQL field.
ccl
CCL field.
The final part of the configuration consists of zero or more
cclmap
elements that specifies a <emphais>base</emphais>
CCL profile to be used for all targets. This configuration, thus, will
be combined with cclmap-definitions from the target profile.
The ZOOM filter accepts three query types: RPN(Type-1), CCL and CQL.
Queries are converted in two separate steps. In the first step the input query is converted to RPN/Type-1. This is always the common internal format between step 1 and step 2. In step 2 the query is converted to the native query type of the target.
Step 1: for RPN, the query is passed unmodified to the target.
Step 1: for CCL, the query is converted to RPN via
cclmap
elements part of the target profile.
Step 1: For CQL, the query is converted to CCL. The mappings of
CQL fields to CCL fields are handled by fieldmap
elements as part of the target profile. The resulting query, CCL,
is the converted to RPN using the schema mentioned earlier (via
cclmap
).
Step 2: If the target is Z39.50-based, it is passed verbatim (RPN). If the target is SRU-based, the RPN will be converted to CQL. If the target is SOLR-based, the RPN will be converted to SOLR's query type.
The following elements are honored by the ZOOM module of Metaproxy. Note that unknown elements are silently ignored. There are several elements in use that makes no sense to the ZOOM module.
Authentication parameters to be sent to the target. For Z39.50 targets, this will be sent as part of the Init Request.
If this value is omitted or empty, not authentication information is simply omitted.
A value of 1/true is a hint to the ZOOM module that this Z39.50 target supports piggyback searches, ie Search Response with records. Any other value (false) will prevent the ZOOM module to make use of piggyback (all records part of Present Response).
If this value is defined, all queries will be converted to this encoding. This should be used for all Z39.50 targets that do not use UTF-8 for query terms.
This value is required and specifies the unique database for this profile . All target profiles should hold a unique database.
This value specifies CCL field (qualifier) definition for some field. For Z39.50 targets this most likely will specify the mapping to a numeric use attribute + a structure attribute. For SRU targets, the use attribute should be string based, in order to make the RPN to CQL conversion work properly (step 2).
Specifies the elementSet to be sent to the target if record
transform is enabled (not to be used with the record_transform
module). The record transform is enabled only if the client uses
record syntax = XML and element set =
pz2
. If record transform is not enabled, this
setting is not used and the element set specified by the client
is passed verbatim.
Specifies the character encoding of records that are returned by the target. This is primarily used for targets were records are not UTF-8 encoded already. This setting is only used if the record transform is enabled (see description of elementSet).
Specifies the record syntax to be specified for the target if record transform is enabled; see description of elementSet. If record transform is not enabled, the record syntax of the client is passed verbatim to the target.
If this setting is set, it specifies that the target is web service
based and must be one of : get
,
post
, soap
or solr
.
Specifies a XSL stylesheet filename to be used if record transform is anabled; see desciprion of elementSet.
This is setting is mandatory and specifies the ZURL of the targetin the form of host/database.
# Metaproxy XML config file schema
namespace mp = "http://indexdata.com/metaproxy"
filter_zoom =
attribute type { "zoom" },
attribute id { xsd:NCName }?,
attribute name { xsd:NCName }?,
element mp:torus {
attribute url { xsd:string },
attribute xsldir { xsd:string }?,
element mp:records {
element mp:record {
element mp:authentication { xsd:string }?,
element mp:piggyback { xsd:string }?,
element mp:queryEncoding { xsd:string }?,
element mp:udb { xsd:string },
element mp:cclmap_au { xsd:string }?,
element mp:cclmap_date { xsd:string }?,
element mp:cclmap_isbn { xsd:string }?,
element mp:cclmap_su { xsd:string }?,
element mp:cclmap_term { xsd:string }?,
element mp:cclmap_ti { xsd:string }?,
element mp:elementSet { xsd:string }?,
element mp:recordEncoding { xsd:string }?,
element mp:requestSyntax { xsd:string }?,
element mp:sru { xsd:string }?,
element mp:transform { xsd:string }?,
element mp:zurl { xsd:string }
}*
}?
}?,
element mp:fieldmap {
attribute cql { xsd:string },
attribute ccl { xsd:string }?
}*,
element mp:cclmap {
element mp:qual {
attribute name { xsd:string },
element mp:attr {
attribute type { xsd:string },
attribute value { xsd:string }
}+
}*
}?
The following configuration illustrates most of the facilities:
<filter type="zoom"> <torus url="http://torus.indexdata.com/src/records/?query=udb%3D%db" xsldir="." /> <fieldmap cql="cql.anywhere"/> <fieldmap cql="cql.serverChoice"/> <fieldmap cql="dc.creator" ccl="au"/> <fieldmap cql="dc.title" ccl="ti"/> <fieldmap cql="dc.subject" ccl="su"/> <cclmap> <qual name="ocn"> <attr type="u" value="12"/> <attr type="s" value="107"/> </qual> </cclmap> </filter>