added files for OAI-PMH example
authorMarc Cromme <marc@indexdata.dk>
Fri, 1 Feb 2008 09:45:17 +0000 (09:45 +0000)
committerMarc Cromme <marc@indexdata.dk>
Fri, 1 Feb 2008 09:45:17 +0000 (09:45 +0000)
examples/oai-pmh/conf/explain.xml [new file with mode: 0644]
examples/oai-pmh/conf/explain2cqlpqftxt.xsl [new file with mode: 0644]
examples/oai-pmh/conf/oai2dc.xsl [new file with mode: 0644]
examples/oai-pmh/conf/oai2index.xsl [new file with mode: 0644]
examples/oai-pmh/conf/oai2zebra.xsl [new file with mode: 0644]
examples/oai-pmh/conf/yazserver.xml [new file with mode: 0644]
examples/oai-pmh/conf/zebra.cfg [new file with mode: 0644]

diff --git a/examples/oai-pmh/conf/explain.xml b/examples/oai-pmh/conf/explain.xml
new file mode 100644 (file)
index 0000000..0568fe7
--- /dev/null
@@ -0,0 +1,359 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- $Id: explain.xml,v 1.1 2008-02-01 09:45:17 marc Exp $ -->
+
+<!-- this file configures the SRU/SRW explain response -->
+<!-- see: http://explain.z3950.org/dtd/commentary.html -->
+<!-- validate this using zeerex-2.0.xsd -->
+<!-- Extensions see: http://explain.z3950.org/dtd/extensions.html -->
+
+<explain xmlns="http://explain.z3950.org/dtd/2.0/">
+
+  <serverInfo protocol="SRW/SRU/Z39.50">
+
+    <host>localhost</host>
+
+    <port>9999</port>
+
+    <!-- <database numRecs="1314" lastUpdate="2006-03-15 09-05-33">
+         Default</database> -->
+    <database>Default</database>
+
+    <!--
+        <authentication>
+        <user>azaroth</user>
+        <group>agroup</group>
+        <password>squirrelfish</password>
+        </authentication>
+    -->
+  </serverInfo>
+
+  <databaseInfo>
+
+    <title lang="en" primary="true">OAI record  SRU/SRW/Z39.50 server</title>
+
+    <description lang="en" primary="true">
+      OAI harvested article and preprint metadata records 
+    </description>
+
+    <author>
+      Marc Cromme, Index Data Aps, 
+      http://www.indexdata.dk
+    </author>
+
+    <contact>Marc Cromme, marc(at)indexdata(dot)com</contact>
+
+    <!--<langUsage codes="en fr">
+        The records are in English and French.
+        </langUsage>  -->
+
+    <history>
+      Part of the open source Zebra information retrieval database
+      example configurations, see http://www.indexdata.com/zebra
+    </history>
+
+    <implementation  identifier="zebra" version="2.0">
+      <title>Index Data YAZ/ZEBRA http://www.indexdata.dk/zebra</title>
+    </implementation>
+    
+    <links> 
+      <link type="z39.50">http://localhost:9999</link>
+      <link type="srw">http://localhost:9999</link>
+      <link type="sru">http://localhost:9999</link>
+    </links>
+    
+  </databaseInfo>
+
+  <!--
+  <metaInfo>
+    <dateModified>2002-03-29 19:00:00</dateModified>
+    <aggregatedFrom> z39.50r://gondolin.hist.liv.ac.uk:210/IR-Explain-1?
+                   id=ghlau-1;esn=F;rs=XML </aggregatedFrom>
+    <dateAggregated>2002-03-30 06:30:00</dateAggregated>
+  </metaInfo>
+  -->
+
+
+  <indexInfo>
+    <set name="cql" identifier="info:srw/cql-context-set/1/cql-v1.1">
+      <title>CQL Standard Set</title>
+    </set>
+    <set name="rec" identifier="info:srw/cql-context-set/2/rec-1.0">
+      <title>Record Standard Set</title>
+    </set>
+    <set name="oai" identifier="info:srw/cql-context-set/1/oai-v1.1">
+      <title>Open Archive Metadata Set</title>
+    </set>
+    <set name="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
+      <title>Dublin Core Set</title>
+    </set>
+
+    <!-- CQL standard index -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">CQL Server Choice</title>
+      <map><name set="cql">serverChoice</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_all</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">CQL All</title>
+      <map><name set="cql">all</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_all</attr>
+      </map>
+    </index>
+
+    <!-- Record ID index -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">Record ID</title>
+      <map><name set="rec">id</name></map>
+      <map>
+        <attr type="1" set="bib1">rec:id</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+
+    <!-- Open Archive Metadata indexes -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">OAI Identifier</title>
+      <map><name set="oai">identifier</name></map>
+      <map>
+        <attr type="1" set="bib1">oai_identifier</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">OAI Datestamp</title>
+      <map><name set="oai">date</name></map>
+      <map>
+        <attr type="1" set="bib1">oai_datestamp</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">OAI Set Specification</title>
+      <map><name set="oai">set</name></map>
+      <map>
+        <attr type="1" set="bib1">oai_setspec</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+
+    <!-- Dublin Core Indexes -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Title</title>
+      <map><name set="dc">title</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_title</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Creator</title>
+      <map><name set="dc">creator</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_creator</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Subject</title>
+      <map><name set="dc">subject</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_subject</attr>
+        <!-- <attr type="6" set="bib1">3</attr> -->
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Description</title>
+      <map><name set="dc">description</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_description</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Publisher</title>
+      <map><name set="dc">publisher</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_publisher</attr>
+        <!-- <attr type="6" set="bib1">3</attr> -->
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Contributor</title>
+      <map><name set="dc">contributor</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_contributor</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Date</title>
+      <map><name set="dc">date</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_date</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <!--
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Type</title>
+      <map><name set="dc">type</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_type</attr>
+      </map>
+    </index>
+    -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Format</title>
+      <map><name set="dc">format</name></map>
+      <map>
+        <attr type="1" set="bib1"></attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Identifier</title>
+      <map><name set="dc">identifier</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_identifier</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Source</title>
+      <map><name set="dc">source</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_source</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Language</title>
+      <map><name set="dc">language</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_language</attr>
+      </map>
+    </index>
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Relation</title>
+      <map><name set="dc">relation</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_relation</attr>
+        <attr type="4" set="bib1">3</attr>
+      </map>
+    </index>
+    <!--
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Coverage</title>
+      <map><name set="dc">coverage</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_coverage</attr>
+      </map>
+    </index>
+    -->
+    <index search="true" scan="true" sort="false">
+      <title lang="en">DC Rights</title>
+      <map><name set="dc">rights</name></map>
+      <map>
+        <attr type="1" set="bib1">dc_rights</attr>
+        <!-- <attr type="6" set="bib1">3</attr> -->
+      </map>
+    </index>
+
+  </indexInfo>
+
+  <schemaInfo>
+
+    <schema identifier="http://www.loc.gov/zing/srw/dcschema/v1.0/"
+            location="http://www.loc.gov/zing/srw/dc.xsd" 
+            name="dc"
+            retrieve="true">
+      <title lang="en">Dublin Core</title>
+    </schema>
+
+    <schema identifier="http://indexdata.dk/dc-short"
+            location="" 
+            name="oai"
+            retrieve="true">
+      <title lang="en">Open Archives Initiative</title>
+    </schema>
+
+    <schema identifier="http://indexdata.dk/zebra/xslt/retrieve"
+            location="" 
+            name="zebra"
+            retrieve="true">
+      <title lang="en">Zebra Retrieve</title>
+    </schema>
+
+    <schema identifier="http://indexdata.dk/zebra/xslt/1"
+            location="" 
+            name="index"
+            retrieve="true">
+      <title lang="en">Zebra Indexing</title>
+    </schema>
+
+  </schemaInfo>
+
+  <configInfo>
+
+    <!-- default context set -->
+    <default type="contextSet">cql</default>
+
+    <default type="index">all</default>
+
+    <!-- default relation -->
+    <default type="relation">=</default>
+    <supports type="relation">&lt;</supports> <!-- 2=1 OK -->
+    <supports type="relation">&lt;=</supports> <!-- 2=2 OK -->
+    <supports type="relation">=</supports> <!-- 2=3 OK -->
+    <supports type="relation">&gt;=</supports> <!-- 2=4 OK -->
+    <supports type="relation">&gt;</supports> <!-- 2=5 OK -->
+    <!-- <supports type="relation">&lt;&gt;</supports> --><!-- 2=6 DEAD !!! -->
+    <!-- <supports type="relation">all</supports> --><!-- 2=3 OK -->
+    <!-- <supports type="relation">any</supports> --><!-- 2=3 OK -->
+
+    <supports type="relationModifier">relevant</supports><!-- -->
+    <supports type="relationModifier">phrase</supports><!-- -->
+
+
+
+
+    <!-- masking character supported (* or ?) -->
+    <supports type="maskingCharacter">*</supports>
+    <supports type="maskingCharacter">?</supports>
+
+    <!-- zebra happily accepts empty terms, if escaped in quotes -->
+    <supports type="emptyTerm"></supports>
+
+    <!-- presentation settings --> 
+
+    <!-- default number of records that a server will return at once  -->
+    <default type="numberOfRecords">0</default>
+
+    <!-- default schema used for retrieved records -->
+    <default type="retrieveSchema">oai</default>
+
+    <!-- default record packing returned (string or xml) -->
+    <default type="recordPacking">xml</default>
+
+    <!-- maximum number of records that a server will return at once -->
+    <!-- <setting type="maximumRecords">1000</setting> -->
+
+    <!-- support result sets (Empty) -->
+    <!-- <supports type="resultSets"></supports>  --> 
+
+
+    <!-- scan settings -->
+
+    <!-- scan operation supported -->
+    <supports type="scan"></supports>
+
+    <!-- default number of terms to be returned in scan -->
+    <default type="numberOfTerms">20</default>
+
+    <!-- number of seconds that a result set will be maintained for -->
+    <setting type="resultSetTTL">0</setting>
+
+  </configInfo>
+   
+</explain>
diff --git a/examples/oai-pmh/conf/explain2cqlpqftxt.xsl b/examples/oai-pmh/conf/explain2cqlpqftxt.xsl
new file mode 100644 (file)
index 0000000..5ae5946
--- /dev/null
@@ -0,0 +1,216 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:e="http://explain.z3950.org/dtd/2.0/"
+                version="1.0">
+  <!--  $Id: explain2cqlpqftxt.xsl,v 1.1 2008-02-01 09:45:17 marc Exp $ -->
+  
+  <xsl:output method="text" encoding="UTF-8"/>
+  
+  <!-- disable all default text node output -->
+  <xsl:template match="text()"/>
+  
+  <!-- match zeerex xml record -->
+  <xsl:template match="e:explain">
+    <xsl:text>
+# Propeties file to drive org.z3950.zing.cql.CQLNode's toPQF()
+# back-end and the YAZ CQL-to-PQF converter.  This specifies the
+# interpretation of various CQL indexes, relations, etc. in terms
+# of Type-1 query attributes.
+#
+# This file is created from a valid ZeeRex Explain XML record using the 
+# XSLT transformation 'explain2cqlpqftxt.xsl'
+#
+# xsltproc explain2cqlpqf.xsl explain.xml
+    </xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>    
+    <xsl:apply-templates/>
+
+    <xsl:call-template name="static-text"/>
+
+  </xsl:template>
+  
+  <xsl:template match="e:databaseInfo">
+    <xsl:text># Title: </xsl:text><xsl:value-of select="e:title"/>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+  
+
+  <xsl:template match="e:indexInfo">
+    <xsl:variable name="set-default">
+      <xsl:value-of select="../e:configInfo/e:default[@type='contextSet']"/>
+    </xsl:variable>
+
+    <xsl:text># Set info</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:if test="$set-default">
+      <xsl:text># Default set</xsl:text>
+      <xsl:text>&#10;</xsl:text>       
+       <xsl:text>set = </xsl:text>
+       <xsl:value-of select="e:set[@name = $set-default]/@identifier"/>
+       <xsl:text>&#10;</xsl:text>
+      <xsl:text>&#10;</xsl:text>       
+    </xsl:if>
+
+    <xsl:for-each select="e:set">
+      <!--
+      <xsl:text># </xsl:text>
+      <xsl:value-of select="e:title"/>
+      <xsl:text>&#10;</xsl:text>
+      -->
+      <xsl:text>set.</xsl:text><xsl:value-of select="@name"/>
+      <xsl:text> = </xsl:text><xsl:value-of select="@identifier"/>
+      <xsl:text>&#10;</xsl:text>
+    </xsl:for-each>
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:text># Index info</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:for-each select="e:index">
+      <!--
+      <xsl:text># </xsl:text><xsl:value-of select="e:title"/>
+      <xsl:text>&#10;</xsl:text>
+      -->
+      <xsl:text>index.</xsl:text>
+      <xsl:value-of select="e:map/e:name/@set"/>
+      <xsl:text>.</xsl:text>
+      <xsl:value-of select="e:map/e:name/text()"/>
+      <xsl:text> = </xsl:text>
+      <xsl:for-each select="e:map/e:attr">
+        <xsl:value-of select="@type"/>
+        <xsl:text>=</xsl:text>
+        <xsl:value-of select="text()"/>
+        <xsl:text> </xsl:text>
+      </xsl:for-each>
+      <xsl:text>&#10;</xsl:text>
+    </xsl:for-each>
+    <xsl:text>&#10;</xsl:text>
+  </xsl:template>
+
+  <xsl:template match="e:configInfo">
+    <xsl:text># Relation info</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:for-each select="e:supports[@type='relation']">
+      <xsl:choose>
+        <xsl:when test="text()='&lt;'">
+          <xsl:text>relation.&lt;  = 2=1</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='le'">
+          <xsl:text>relation.le     = 2=2</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='='">
+          <xsl:text>relation.eq  = 2=3</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='eq'">
+          <xsl:text>relation.eq      = 2=3</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='exact'">
+          <xsl:text>relation.exact = 2=3</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='ge'">
+          <xsl:text>relation.ge  = 2=4</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='&gt;'">
+          <xsl:text>relation.&gt;  = 2=5</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='&lt;&gt;'">
+          <xsl:text>relation.&lt;&gt; = 2=6</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='all'">
+          <xsl:text>relation.all      = 2=3</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='any'">
+          <xsl:text>relation.any      = 2=3</xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:for-each>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:text># Default Relation</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>relation.scr = 2=3</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+
+    <xsl:text># RelationModifier info</xsl:text>
+    <xsl:text>&#10;</xsl:text>
+    <xsl:for-each select="e:supports[@type='relationModifier']">
+      <xsl:choose>
+        <xsl:when test="text()='relevant'">
+          <xsl:text>relationModifier.relevant = 2=102 </xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='fuzzy'">
+          <xsl:text>relationModifier.fuzzy = 2=100 </xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='stem'">
+          <xsl:text>relationModifier.stem = 2=101 </xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='phonetic'">
+          <xsl:text>relationModifier.phonetic  = 2=100 </xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+        <xsl:when test="text()='phrase'">
+          <xsl:text>relationModifier.phrase = 6=3 </xsl:text>
+          <xsl:text>&#10;</xsl:text>
+        </xsl:when>
+      </xsl:choose>
+    </xsl:for-each>
+    
+  </xsl:template>
+
+<xsl:template name="static-text">
+    <xsl:text>
+
+# Position attributes 
+position.first                          = 3=1 6=1
+position.any                            = 3=3 6=1
+position.last                           = 3=4 6=1
+position.firstAndLast                   = 3=3 6=3
+
+# Structure attributes may be specified for individual relations; a
+# default structure attribute my be specified by the pseudo-relation
+# "*", to be used whenever a relation not listed here occurs.
+#
+structure.exact                         = 4=108
+structure.all                           = 4=2
+structure.any                           = 4=2
+structure.*                             = 4=1
+structure.eq                            = 4=3
+
+# Truncation attributes used to implement CQL wildcard patterns.  The
+# simpler forms, left, right- and both-truncation will be used for the
+# simplest patterns, so that we produce PQF queries that conform more
+# closely to the Bath Profile.  However, when a more complex pattern
+# such as "foo*bar" is used, we fall back on Z39.58-style masking.
+#
+truncation.right                        = 5=1
+truncation.left                         = 5=2
+truncation.both                         = 5=3
+truncation.none                         = 5=100
+truncation.z3958                        = 5=104
+
+# Finally, any additional attributes that should always be included
+# with each term can be specified in the "always" property.
+#
+# always                                        = 6=1
+# 6=1: completeness = incomplete subfield
+    </xsl:text>
+  </xsl:template>
+
+
+</xsl:stylesheet>
diff --git a/examples/oai-pmh/conf/oai2dc.xsl b/examples/oai-pmh/conf/oai2dc.xsl
new file mode 100644 (file)
index 0000000..0226c9c
--- /dev/null
@@ -0,0 +1,62 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+  xmlns:dc="http://purl.org/dc/elements/1.1/"
+  xmlns:oai="http://www.openarchives.org/OAI/2.0/" 
+  xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 
+  exclude-result-prefixes="oai oai_dc"
+  version="1.0">
+
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+  
+  <!-- disable all default text node output -->
+  <xsl:template match="text()"/>
+  
+  <!-- match on oai xml record -->
+  <xsl:template match="/">
+    <dc:metadata>
+       <xsl:apply-templates/>
+    </dc:metadata>
+  </xsl:template>
+
+  <!--
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/node()">
+      <xsl:copy-of select="."/>
+  </xsl:template>
+  -->
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:date">
+      <dc:date><xsl:value-of select="."/></dc:date>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:description">
+      <dc:description><xsl:value-of select="."/></dc:description>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/format">
+      <format><xsl:value-of select="."/></format>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:identifier">
+      <dc:identifier><xsl:value-of select="."/></dc:identifier>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:publisher">
+      <dc:publisher><xsl:value-of select="."/></dc:publisher>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:relation">
+      <dc:relation><xsl:value-of select="."/></dc:relation>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/subject">
+      <subject><xsl:value-of select="."/></subject>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:title">
+      <dc:title><xsl:value-of select="."/></dc:title>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:type">
+      <dc:type><xsl:value-of select="."/></dc:type>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/examples/oai-pmh/conf/oai2index.xsl b/examples/oai-pmh/conf/oai2index.xsl
new file mode 100644 (file)
index 0000000..589f1f8
--- /dev/null
@@ -0,0 +1,123 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:z="http://indexdata.com/zebra-2.0"
+                xmlns:dc="http://purl.org/dc/elements/1.1/"
+                xmlns:oai="http://www.openarchives.org/OAI/2.0/" 
+                xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 
+                exclude-result-prefixes="oai oai_dc dc"
+                version="1.0">
+
+  <!-- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -->
+
+
+  <xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+  <!-- disable all default text node output -->
+  <xsl:template match="text()"/>
+  
+  <!-- match on oai xml record -->
+  <xsl:template match="/">    
+    <z:record z:id="{normalize-space(oai:record/oai:header/oai:identifier)}">
+
+      <xsl:apply-templates/>
+    </z:record>
+  </xsl:template>
+
+  <!-- OAI indexing templates -->
+  <xsl:template match="oai:record/oai:header/oai:identifier">
+    <z:index name="oai_identifier:0">
+      <xsl:value-of select="."/>
+    </z:index>    
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:header/oai:datestamp">
+    <z:index name="oai_datestamp:0">
+      <xsl:value-of select="."/>
+    </z:index>    
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:header/oai:setSpec">
+    <z:index name="oai_setspec:0">
+      <xsl:value-of select="."/>
+    </z:index>    
+  </xsl:template>
+
+  <!-- DC specific indexing templates -->
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:title">
+    <z:index name="any:w dc_title:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:creator">
+    <z:index name="any:w dc_creator:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:subject">
+    <z:index name="any:w dc_subject:p">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:description">
+    <z:index name="any:w dc_description:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:contributor">
+    <z:index name="any:w dc_contributor:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:publisher">
+    <z:index name="dc_publisher:p dc_publisher:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:date">
+    <z:index name="dc_date:0">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:format">
+    <z:index name="dc_format:0">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:identifier">
+    <z:index name="dc_identifier:0">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:source">
+    <z:index name="dc_source:0">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:language">
+    <z:index name="dc_language:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:relation">
+    <z:index name="dc_relation:0">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+  <xsl:template match="oai:record/oai:metadata/oai_dc:dc/dc:rights">
+    <z:index name="dc_rights:p dc_rights:w">
+      <xsl:value-of select="."/>
+    </z:index>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/examples/oai-pmh/conf/oai2zebra.xsl b/examples/oai-pmh/conf/oai2zebra.xsl
new file mode 100644 (file)
index 0000000..07d3799
--- /dev/null
@@ -0,0 +1,35 @@
+<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:z="http://indexdata.com/zebra-2.0"
+                xmlns:dc="http://purl.org/dc/elements/1.1/"
+                xmlns:oai="http://www.openarchives.org/OAI/2.0/" 
+                xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 
+                exclude-result-prefixes="oai oai_dc dc"
+                version="1.0">
+
+
+  <xsl:param name="id" select="''"/>
+  <xsl:param name="filename" select="''"/>
+  <xsl:param name="rank" select="''"/>
+  <xsl:param name="score" select="''"/>
+  <xsl:param name="schema" select="''"/>
+  <xsl:param name="size" select="''"/>
+
+<xsl:output indent="yes" method="xml" version="1.0" encoding="UTF-8"/>
+
+ <xsl:template match="/">
+   <z:record
+       z:id="{$id}"
+       z:filename="{$filename}"
+       z:rank="{$rank}"
+       z:score="{$score}"
+       z:schema="{$schema}"
+       z:size="{$size}"
+       >
+     <title>
+       <xsl:value-of select="oai:record/oai:metadata/oai_dc:dc/dc:title"/>
+     </title>
+   </z:record>
+
+ </xsl:template>
+
+</xsl:stylesheet>
diff --git a/examples/oai-pmh/conf/yazserver.xml b/examples/oai-pmh/conf/yazserver.xml
new file mode 100644 (file)
index 0000000..a37e4c7
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- this file configures the frontend YAZ server -->
+<!-- see: http://www.indexdata.com/yaz/doc/server.vhosts.tkl -->
+<yazgfs>
+
+  <!-- one or more ports to listen to -->
+  <listen id="tcp9999">tcp:@:9999</listen>
+  
+  <!-- one or more servers bound to ports - multiple servers on same
+       ports possible -->
+  <server id="oai" listenref="tcp9999">
+    
+    <!-- working directory for zebra -->
+    <directory>./</directory>
+    
+    <!-- ordinary config file for zebra -->
+    <config>conf/zebra.cfg</config>
+    
+    <!-- location of CQL-to-PQF file 
+         see: http://www.indexdata.com/yaz/doc/tools.tkl#tools.cql.map -->
+    <cql2rpn>conf/cql2pqf.txt</cql2rpn>
+    
+    <!-- explain message - send in SRW Explain
+         - yes, we understand Z39.50 and SRW on the same port !! -->
+    <xi:include href="conf/explain.xml"
+                xmlns:xi="http://www.w3.org/2001/XInclude">
+      <xi:fallback>
+        <explain xmlns="http://explain.z3950.org/dtd/2.0/">
+          <serverInfo>
+            <host>localhost</host>
+            <port>9999</port>
+            <database>Default</database>
+          </serverInfo>
+        </explain>
+      </xi:fallback>
+    </xi:include>
+    
+  </server>
+  
+</yazgfs>
diff --git a/examples/oai-pmh/conf/zebra.cfg b/examples/oai-pmh/conf/zebra.cfg
new file mode 100644 (file)
index 0000000..d20940a
--- /dev/null
@@ -0,0 +1,39 @@
+# Zebra configuration file for Alvis XSLT filter setup including
+# SRU/SRW Webservice setup and CQL-to-PQF configuration
+# 
+# $Id: zebra.cfg,v 1.1 2008-02-01 09:45:17 marc Exp $
+#
+
+# profilePath - where to look for config files
+profilePath: .:../../tab
+
+# modulePath - where to look for loadable zebra modules
+modulePath:  ../../index/.libs
+
+# store records and record keys internally
+storeData: 1
+storeKeys: 1
+
+# use the DOM XML filter with config file dom-conf.xml
+recordtype: dom.conf/dom-conf.xml
+
+
+# where to put registers, and other var content, and how large they may be
+register: tmp:10M
+shadow: tmp:10M
+lockdir: tmp
+keytmpdir: tmp
+
+# enable pre-sorting of hit lists according to static rank
+#staticrank: 1
+
+# use rank sorting filter
+#rank: rank1
+
+# add extended services - global access
+#perm.anonymous: rw
+
+# add extended services - login/password 
+#perm.anonymous: r
+#perm.admin: rw
+#passwd: passwordfile
\ No newline at end of file