clean removes local.ent
[mp-sparql-moved-to-github.git] / doc / book.xml
index 074516f..5826b16 100644 (file)
     </para>
    </note>
   </sect1>
+  <sect1 id="configuration">
+   <title>Configuration</title>
+   <para>
+    If you have installed mp-sparql as a package or have executed
+    <literal>make install</literal> from source, sample configuration
+    can be found in <filename>/usr/share/mp-sparql/bibframe</filename> or
+    <filename>/usr/local/share/mp-sparql/bibframe</filename>. In the
+    the following /usr/share prefix assumed. Adjust accordingly.
+    The directory contains these files:
+    <variablelist>
+     <varlistentry>
+      <term><filename>triplestore.xml</filename></term>
+      <listitem>
+       <para>
+       A mature PQF to SPARQL configuration illustrating a lot of the
+       configuration facilities that are described in the manual
+       page of <xref linkend="sparql"/>.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><filename>config-sparql.xml</filename></term>
+      <listitem>
+       <para>
+       A full metaproxy configuration file that includes
+       <filename>triplestore.xml</filename> cofiguration for the
+       mp-sparql filter, enables SRU and CQL to PQF conversion.
+       </para>
+      </listitem>
+     </varlistentry>
+     <varlistentry>
+      <term><filename>filter-sparql.xml</filename></term>
+      <listitem>
+       <para>
+       A partial metaproxy configuration suitable to be enabled in
+       <filename>/etc/metaproxy/filters-enabled</filename>.
+       This includes <filename>triplestore.xml</filename> as well.
+       </para>
+      </listitem>
+     </varlistentry>
+    </variablelist>
+   </para>
+   <para>
+    If you want to use the package layout and modular configuration we
+    suggest you use filter-sparql.xml and perform something along the lines of:
+    <screen>
+     cp /usr/share/mp-sparql/bibframe/filter-sparql.xml /etc/metaproxy/filters-available
+     cp /usr/share/mp-sparql/bibframe/triplestore.xml /etc/metaproxy
+     vi /etc/metaproxy/triplestore.xml
+     ln -s ../filters-available/filter-sparql.xml /etc/metaproxy/filters-enabled
+     service metaproxy restart
+    </screen>
+    A copy of triplestore.xml is made. Adjust the
+    <literal>&lt;defaults uri=.. </literal> value to the URI of your
+    triplestore.
+   </para>
+   <para>
+    If you want to create your own top-level configuration, you can copy
+    <filename>config-sparql.xml</filename> to any location you like and
+    run metaproxy with that. Something like this:
+    <screen>
+     mkdir /etc/myconfig
+     cp /usr/share/mp-sparql/bibframe/* /etc/myconfig
+     sudo vi /etc/myconfig/triplestore.xml
+     metaproxy -c /etc/myconfig/config-sparql.xml
+    </screen>
+    Again, a copy of triplestore.xml is made. Adjust the
+    <literal>&lt;defaults uri=.. </literal> value to the URI of your
+    triplestore.
+   </para>
+   <note>
+    <para>
+     Do not edit files in <filename>/usr/share/mp-sparql/bibframe</filename>.
+     They are only samples and will be overwritten by a package update.
+     Instead copy the files away from there if you need to modify them.
+    </para>
+   </note>
+  </sect1>
+  <sect1 id="using">
+   <title>Using the service</title>
+   <para>
+    Either way, unless you have adjusted the metaproxy configuration,
+    Metaproxy can be reached on port 9000. Example using yaz-client and
+    PQF/Type-1:
+    <screen><![CDATA[
+adam@tuna:~$ yaz-client localhost:9000/work
+Connecting...OK.
+Sent initrequest.
+Connection accepted by v3 target.
+ID     : 81
+Name   : sparql
+Version: 1.9.0/5.14.6 87faebe8ef5cab8f6df86f387e8b919b7b9897a8
+Options: search present namedResultSets
+Elapsed: 0.000961
+Z> f @attr 1=bf.anytitle water
+Sent searchRequest.
+Received SearchResponse.
+Search was a success.
+Number of hits: 1, setno 1
+records returned: 0
+Elapsed: 0.279441
+Z> s
+Sent presentRequest (1+1).
+Records: 1
+[work]Record type: XML
+<?xml version="1.0" encoding="utf-8" ?>
+<rdf:RDF
+       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+       xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"
+       xmlns:ns2="http://bibframe.org/vocab/" >
+  <rdf:Description rdf:about="http://bibframe.org/resources/sample-lc-2/15513351">
+  ...
+  </rdf:Description>
+</rdf:RDF>nextResultSetPosition = 0
+Elapsed: 0.256142
+]]></screen>
+   </para>
+   <para>
+   Example using SRU:
+   <ulink url="http://localhost:9000/work?query=bf.anytitle%3Dwater&amp;maximumRecords=1"/>
+   </para>
+  </sect1>
  </chapter>
  <reference id="reference">
   <title>Reference</title>
    along with Metaproxy; see the file LICENSE.  If not, write to the
    Free Software Foundation,
    51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
-   </para>
+  </para>
 
  </appendix>