Move material from bibframe/README to manual
[mp-xquery-moved-to-github.git] / doc / book.xml
index 4669bdd..9dd568c 100644 (file)
@@ -31,7 +31,7 @@
     using W3C's XQuery language.
    </simpara>
    <simpara>
-    Metaproxy is covered by the GNU General Public License version 2.
+    MP-XQuery is covered by the GNU General Public License version 2.
    </simpara>
    <simpara>
     <inlinemediaobject>
    </simpara>
   </abstract>
  </bookinfo>
-
  <chapter id="introduction">
   <title>Introduction</title>
-
   <para>
-   MP-XQuery is a module for
-   <ulink url="&url.metaproxy;">Metaproxy</ulink>.
+   MP-XQuery is a <ulink url="&url.metaproxy;">Metaproxy</ulink> module
+   that allows record conversion using
+   <ulink url="http://www.w3.org/TR/xquery/">W3C XML XQuery</ulink>.
+   The initial motivations for the module was to be able to
+   <ulink url="http://bibframe.org">BIBFRAME</ulink> records
+   via SRU/Z39.50. By using the
+   <ulink
+       url="https://github.com/lcnetdev/marc2bibframe">
+    marc2bibframe
+    </ulink> utilities, this module can convert existing
+    MARCXML records to BIBFRAME records - on the fly - as part of retrieval.
   </para>
  </chapter>
-
  <chapter id="installation">
   <title>Installation</title>
-  <para/>
+  <para>
+   MP-XQuery is available as packages for CentOS/RHEL 6 and most recent
+   Ubuntu/Debian versions. For other systems, the module must be build
+   from source.
+  </para>
+  <sect1 id="installation.packages">
+   <title>Installing packages</title>
+   <para>
+    You need to enable the relevant software repositories.
+    For setting up refer to one of:
+    <ulink
+       url="http://ftp.indexdata.dk/pub/mp-xquery/redhat/centos/6/README">CentOS 6</ulink>
+    ,
+    <ulink
+       url="http://ftp.indexdata.dk/pub/mp-xquery/redhat/centos/7/README">CentOS 7</ulink>
+    ,
+    <ulink
+       url="http://ftp.indexdata.dk/pub/mp-xquery/ubuntu/README">Ubuntu</ulink>
+    and
+    <ulink
+       url="http://ftp.indexdata.dk/pub/mp-xquery/debian/README">Debian</ulink>
+   </para>
+   <para>
+    The package is called <literal>mp-xquery</literal> on RHEL/Debian systems.
+    Install that package and you are ready to use filter "xquery" in your
+    setup.
+   </para>
+  </sect1>
+  <sect1 id="installation.source">
+   <title>Installing from source</title>
+   <para>
+    To build from source, you need zorba and metaproxy development
+    packages. <ulink url="http://www.zorba.io">Zorba</ulink>
+    might be installed in <filename>/opt/zorba</filename> as follows:
+    <screen>
+    tar zxf zorba-3.0.tar.gz
+    cd zorba-3.0
+    mkdir build
+    cd build
+    cmake -Wno-dev \
+        -D CMAKE_INSTALL_PREFIX=/opt/zorba \
+        -D ZORBA_SUPPRESS_SWIG:BOOL=ON  \
+        ..
+    sudo make install
+    </screen>
+    Consult the Zorba documentation for more information.
+   </para>
+   <para>
+    Metaproxy can be installed as follows:
+    <screen>
+     ./configure
+     make
+     sudo make install
+    </screen>
+    But consult the Metaproxy documentation for requirements and
+    options.
+   </para>
+   <para>
+    We are now ready to build the MP-XQuery module with:
+    <screen>
+     cd mp-xquery-version
+     make ZORBA=/opt/zorba MP_CONFIG=/usr/local/bin/mp-config
+    </screen>
+    Adjust <literal>ZORBA</literal> and <literal>MP_CONFIG</literal> values
+    above for the correct location of installed
+    Zorba and Metaproxy's mp-config respectively. MP_CONFIG can be omitted
+    if Metaproxy was installed in the system PATH.
+   </para>
+   <para>
+    You can now install the <filename>metaproxy_filter_xquery.so</filename>
+    in a directory searched by Metaproxy daemon.
+    Specifically, that's the directories
+    given by the <literal>dlpath</literal> configuration.
+   </para>
+   <para>
+    If dlpath includes <filename>/usr/lib/metaproxy6/modules</filename>,
+    the module can be installed with:
+    <screen>
+     cp src/metaproxy_filter_xquery.so /usr/lib/metaproxy6/modules
+    </screen>
+   </para>
+   <note>
+    <para>
+     For RHEL/CentOS systems on 64-bit architectures, the correct paths is:
+     <filename>/usr/lib64/metaproxy6/modules</filename>.
+    </para>
+   </note>
+  </sect1>
+  <sect1>
+   <title>BIBFRAME</title>
+   <para>
+    The MARC to BIBFRAME was the primary purpose of the XQuery
+    module for Metaproxy, but generally the module is a just an alternative
+    to record_transform filter of Metaproxy which primarily performs XSLT.
+   </para>
+   <para>
+    The <filename>bibframe directory</filename> of the source tar
+    contains sample file for performing MARC to BIBFRAME conversions.
+    Upon <literal>make install</literal> these are installed to directory
+    <filename>/usr/share/mp-xquery/bibframe</filename> and they are also
+    part of the package <literal>mp-xquery</literal>.
+   </para>
+   <para>
+    <literal>config.xml</literal> is a complete Metaproxy configuration file.
+    It includes a standalone configuration that makes Metaproxy offe
+    Z39.50 and SRU support on port 9070. The modules in use are http_file
+    (to serve XSL files), sru_z3950 (SRU service), cql_rpn (CQL to RPN
+    conversion), xquery (to convert MARCXML to BIBFRAME), record_transform
+    (to convert MARC21 to MARCXML), virt_db (for database rewrite), log
+    (to perform backend logging) and, finally, z3950_client to interface
+    a Z39.50 target.
+   </para>
+   <para>
+    It is important that the XQuery module comes before the
+    "record_transform" so that the XQuery module sees XML
+    <emphasis>only</emphasis> and not ISO2709-records.
+    If it does, they will be ignored (passed through) by the XQuery module.
+   </para>
+   <para>
+    The XQuery module script name points to the full path of
+    <filename>zorba3-0.xqy</filename> part
+    of marc2bibframe . Do not move <filename>zorba3-0.xqy</filename>
+    from its place within the
+    marc2bibframe directory as other files are referred to and their relative
+    location must be preserved.
+   </para>
+   <para>
+    File <filename>cql2pqf.txt</filename> contains a simple DC/CQL profile
+    for driving a CQL to RPN conversion.
+    It is referred to from the cql_rpn filter in config.xml .
+   </para>
+   <para>
+    File <filename>explain.xml</filename> is SRU explain configuration.
+    It is referred to from the sru_z3950 filter in config.xml .
+   </para>
+   <para>
+    Directory <filename>xsl/..</filename> is client side XSL for brief -
+    and full display. These must be located so that the http_file filter
+    can fetch them. For example, if these files are located in
+    <filename>/usr/share/mp-xquery/bibframe/xsl</filename> , then
+    http_file would hold
+    <screen><![CDATA[
+      <filter type="http_file">
+        <area>
+          <documentroot>/usr/share/mp-xquery/bibframe/xsl</documentroot>
+          <prefix></prefix>
+          <passthru>true</passthru>
+        </area>
+      </filter>
+]]>
+    </screen>
+   </para>
+   <note>
+    <para>
+     Do not modify the files below <filename>/usr/share/mp-xquery</filename>.
+     They will be  overwritten by a package update and if
+     <literal>make install</literal> is executed.
+     Use them if they can be used as-is but copy them away if you want to
+     modify them (such as <filename>config.xml</filename>).
+    </para>
+   </note>
+  </sect1>
  </chapter>
-
  <reference id="reference">
   <title>Reference</title>
    <partintro id="reference-introduction">