added full RelaxNG based config file syntax checking
authorMarc Cromme <marc@indexdata.dk>
Tue, 10 Oct 2006 15:10:16 +0000 (15:10 +0000)
committerMarc Cromme <marc@indexdata.dk>
Tue, 10 Oct 2006 15:10:16 +0000 (15:10 +0000)
which checks every filter according to it's own rules.
These are exported by the 'make' target to RelaxNG XML and XML Schema instances using the nifty 'trang' utility.
added check of all config files in etc dir according to both RelaxNG XML and XML Schema instances.
check targets are 'make check_xsd' and 'make check_rng' when standing in 'etc' directory.
Still missing to integrate XML checks into 'make check' target.

15 files changed:
Makefile.am
configure.ac
etc/Makefile.am
etc/config-imagine.xml [deleted file]
etc/config-sru-to-z3950.xml
etc/config-zurg.xml
etc/experiment-query-config-translate.php [deleted file]
etc/queryinfo.xml [deleted file]
etc/retrievalinfo.xml [deleted file]
etc/zeerex-explain.xml [deleted file]
xml/Makefile.am [new file with mode: 0644]
xml/experiments/config-imagine.xml [new file with mode: 0644]
xml/experiments/experiment-query-config-translate.php [new file with mode: 0755]
xml/schema/Makefile.am [new file with mode: 0644]
xml/schema/metaproxy.rnc

index 766e8ef..ea1a3c9 100644 (file)
@@ -1,8 +1,8 @@
 ## This file is part of Metaproxy
 ## Copyright (C) 2005-2006, Index Data ApS
-## $Id: Makefile.am,v 1.17 2006-09-29 09:43:56 marc Exp $
+## $Id: Makefile.am,v 1.18 2006-10-10 15:10:16 marc Exp $
 
-SUBDIRS = src doc etc
+SUBDIRS = src xml doc etc
 
 ACLOCAL_AMFLAGS = -I m4
 
index ed7d326..99acb1e 100644 (file)
@@ -105,6 +105,9 @@ AC_CONFIG_FILES([
        Makefile
        src/Makefile
        src/Jamfile
+       xml/Makefile
+       xml/schema/Makefile
+       xml/xslt/Makefile
        doc/Makefile
        doc/local.ent
         doc/common/Makefile
index 7b3c811..4c4a498 100644 (file)
@@ -1,26 +1,41 @@
-# $Id: Makefile.am,v 1.3 2006-06-19 13:29:30 adam Exp $
+# $Id: Makefile.am,v 1.4 2006-10-10 15:10:16 marc Exp $
 
 # This doesn't actually build anything, it just tests whether the
 # configuration files here correspond with the schema.
 
 etcdatadir = $(pkgdatadir)/etc
 
-config = config0.xml config1.xml config2.xml \
-       config3.xml config4.xml config5.xml \
-       config-simple-multi.xml config-local.xml \
-       config-shared1.xml
+xmlconfig = config-bytarget.xml \
+    config-local.xml \
+    config-record-transform.xml \
+    config-shared1.xml \
+    config-simple-multi.xml \
+    config-sru-to-z3950.xml \
+    config-zurg.xml \
+    config0.xml \
+    config1.xml \
+    config2.xml \
+    config3.xml \
+    config4.xml \
+    config5.xml
 
-misc = example.simple-auth example.target-auth pqf2pqf.xsl
+config = example.simple-auth example.target-auth pqf2pqf.xsl
 
-etcdata_DATA = $(config) $(misc)
+
+rng = ../xml/schema/metaproxy.rng
+xsd = ../xml/schema/metaproxy.xsd
+
+etcdata_DATA = $(xmlconfig) $(config)
 
 EXTRA_DIST = $(etcdata_DATA)
 
-test: test-config0 test-config1 test-config2 \
-      test-config3 test-config4 test-config5 \
-      test-config-simple-multi test-config-local \
-       test-config-shared1
+.PHONY: check_rng
+check_rng: 
+       xmllint --noout --relaxng $(rng) $(xmlconfig)
+
+.PHONY: check_xsd
+check_xsd: 
+       xmllint --noout --schema $(xsd) $(xmlconfig)
+
 
-test-%: %.xml config.xsd 
-       xmllint --noout --schema config.xsd $<
 
diff --git a/etc/config-imagine.xml b/etc/config-imagine.xml
deleted file mode 100644 (file)
index 7879f5a..0000000
+++ /dev/null
@@ -1,117 +0,0 @@
-<?xml version="1.0"?>
-<!-- imagined config for yp2..
-  The router system understands yp2, sequence and filter elements.
-  Everything else interpreted by filters.
-  Each filter is invoked in a sequence (unless a filter invokes another
-  sequence.. A start sequence must be determined somehow.
-  -->
-<yp2 xmlns="http://indexdata.dk/yp2/config/1">
-  <start route="id_hytg"/>
-  <filters>
-    <filter id="front_default" type="frontend-net">
-      <!-- the Z39.50/HTTP frontend -->
-      <port>@:210</port>
-    </filter>
-    <filter id="log_out" type="log">          <!-- apply logging always -->
-      <logfile>out.log</logfile>
-    </filter>
-    <filter id="log_cerr" type="log">          <!-- apply logging always -->
-      <logfile>std::cerr</logfile>
-    </filter>
-  </filters>
-
-  <routes>  
-    <route id="start">
-      <filter refid="log_cout"/>
-      <filter type="cond">           <!-- conditional -->
-       <if test="port=210 and db=public" route="A"/> 
-       <if test="port=210 and db=other" route="B"/> 
-        <switch>
-          <case test="blabla" route="C"/>
-          <case test="blabla2" route="C2"/>
-          <default route="C3"/>
-       </switch>
-      </filter>
-      <filter refid="log_out"/>
-      <filter refid="log_cerr"/>
-      <filter type="log">          <!-- apply logging always -->
-       <logfile>mylog.log</logfile>
-      </filter>   
-    <filter name="reject">        <!-- reject .. -->
-    </filter>
-    <filter type="bounce"/>
-    </route>
-    <route id="public">
-      <filter type="z3950-client">
-       <target>localhost:9999/A</target>
-    </filter>
-    <filter type="bounce"/>
-    </route>
-    <route id="internal">
-      <filter type="z3950-client">
-       <target>localhost:9999/B</target>
-      </filter>
-      <filter type="bounce"/>
-   </route>
-    <route id="internal">
-      <xml:include href="file://module2.xml#filter45"/>
-      <xml:include href="file://module4.xml#filter145"/>
-      <filter type="bounce"/>
-    </route>
-    <route id="AB">
-      <filter type="multi">
-        <package route="A"/>
-        <package route="B"/>
-        <merge type="simple"/>
-      </filter>
-      <filter type="bounce"/>
-    </route>
-  </routes>
-</yp2>
-
-<!-- functions:
-    db           returns Z39.50 database(s)
-    path         HTTP path
-    HTTP-header  Any HTTP header (including content-type)
-    request-type Init,Search,HTTP,...
-    origin       IP of origin
-    port         Port
-
-
-mother object filter-dom-hash
-  deletes pointers to contexts and filters  on program exit
-hash filter-type -> hash-filter-id -> Context
-                 -> filter-binary-pointer
-
-moher object router pointer hash
-
-created in mother thread, read only structures.
-
-Context* filter.configure(dom );
-
-
-
-process(Context con)
-
-where each filter can have is own context class
-
-yp2::filter::Log::Context : public Context
-
-
-Filters are constructed with a FilterFactory class which exposes a
-method 
-
-Filter* createFilter(std::string type)
-
- .. which returns a filter
-instance. (The interface pointer that is). The FilterFactory may later
-offer function
-  loadModule(std::string filename);
-or even
-  loadModules(std::string filenamemask);
-
-
-
--->
-
-<!-- observation: the logic could be controlled by a XSLT! -->
index f070e93..ea978d9 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0"?>
-<!-- $Id: config-sru-to-z3950.xml,v 1.3 2006-09-26 11:33:40 marc Exp $ -->
+<!-- $Id: config-sru-to-z3950.xml,v 1.4 2006-10-10 15:10:16 marc Exp $ -->
 <yp2 xmlns="http://indexdata.dk/yp2/config/1">
   <start route="start"/>
   <filters>
@@ -17,7 +17,7 @@
       <filter type="log">
         <message>SRU/W</message>
       </filter>
-      <filter type="SRUtoZ3950"/>
+      <filter type="sru_z3950"/>
       <filter type="log">
         <message>Z3950</message>
       </filter>
index e7ff942..09be83c 100644 (file)
@@ -1,9 +1,7 @@
 <?xml version="1.0"?>
-<!-- $Id: config-zurg.xml,v 1.9 2006-08-31 13:01:09 marc Exp $ -->
+<!-- $Id: config-zurg.xml,v 1.10 2006-10-10 15:10:16 marc Exp $ -->
 <yp2 xmlns="http://indexdata.dk/yp2/config/1">
   <start route="start"/>
-  <filters>
-  </filters>
   <routes>
     <route id="start">
       <filter type="frontend_net">
@@ -14,7 +12,7 @@
         <message>F</message>
       </filter>
       <filter type="auth_simple">
-       <userRegister>../etc/example.simple-auth</userRegister>
+       <userRegister>etc/example.simple-auth</userRegister>
       </filter>
       <filter type="virt_db">
         <virtual>
@@ -67,7 +65,7 @@
         <message>M</message>
       </filter>
       <filter type="auth_simple">
-        <targetRegister>../etc/example.target-auth</targetRegister>
+        <targetRegister>etc/example.target-auth</targetRegister>
        <discardUnauthorisedTargets/>
       </filter>
       <filter type="multi">
diff --git a/etc/experiment-query-config-translate.php b/etc/experiment-query-config-translate.php
deleted file mode 100755 (executable)
index 38e764e..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-#!/usr/bin/php
-<?php
-# Include PEAR::Console_Getopt
-require_once 'Console/Getopt.php';
-
-$command = new Command;
-print_r($command->command());
-
-$config = new Config;
-$config->load($command->config());
-$config->parse();
-$config->cql_check_boolean("and");
-$config->cql_check_boolean("notexist");
-$config->cql_check_apt("cql", "all", "=");
-$config->cql_check_apt("cql", "all", "notexist");
-$config->cql_check_apt("cql", "notexist", "=");
-$config->cql_check_apt("notexist", "all", "<>");
-
-
-print("DONE\n");
-exit(0);
-
-
-class Command {
-  private $options;
-  private $command;
-  private $short_format_config = 'hc:s:t:';
-  private $syntax_config = array('ccl', 'cql', 'pqf');
-
-
-  public function __construct() {
-    $args = Console_Getopt::readPHPArgv();
-
-    if ( PEAR::isError($args) ) {
-      fwrite(STDERR,$args->getMessage()."\n");
-      exit(1);
-    }
-    
-    // Compatibility between "php script.php" and "./script.php"
-    if ( realpath($_SERVER['argv'][0]) == __FILE__ ) {
-      $this->options 
-        = Console_Getopt::getOpt($args, $this->short_format_config);
-    } else {
-      $this->options 
-        = Console_Getopt::getOpt2($args, $this->short_format_config);
-    }
-    
-    // Check for invalid options
-    if ( PEAR::isError($this->options) ) {
-      fwrite(STDERR, $this->options->getMessage()."\n");
-      $this->help();
-    }
-    
-    $this->command = array();
-    
-    // Loop through the user provided options
-    foreach ( $this->options[0] as $option ) {
-      switch ( $option[0] ) {
-      case 'h':
-        help();
-        break;
-      case 's':
-        $this->command['syntax'] = $option[1];
-        break;
-      case 't':
-        $this->command['transform'] = $option[1];
-        break;
-     case 'c':
-       $this->command['config'] = $option[1];
-       break;
-      }
-    }
-    
-    // Loop through the user provided options
-    foreach ($this->options[1] as $argument ) {
-      $this->command['query'] .= ' ' . $argument;
-    }
-  }
-
-  
-  public function help() {
-    fwrite(STDERR, "  Usage:\n");
-    fwrite(STDERR, "  ./experiment-query-config-translate.php -s syntax -t transform -c config.xml query\n");
-    fwrite(STDERR, "  Experiment with general query configuration syntax and transformations.\n");
-    fwrite(STDERR, "  -c config.xml XML config file\n");
-    fwrite(STDERR, "  -s syntax     Syntax of source query language, 'ccl', 'cql', 'pqf'\n");
-    fwrite(STDERR, "  -t transform  Syntax of transformed query language, 'ccl', 'cql', 'pqf'\n");
-    fwrite(STDERR, "  -h            Display help\n");
-    fwrite(STDERR, "  query         Valid query in specified syntax\n");  
-    exit(0);
-  }
-
-  public function command() {
-    return $this->command;
-  }
-  
-  public function syntax() {
-    return $this->command['syntax'];
-  }
-  
-  public function transform() {
-    return $this->command['transform'];
-  }
-  
-  public function config() {
-    return $this->command['config'];
-  }
-
-  public function query() {
-    return $this->commamd['query'];
-  }
-  
-}
-
-class Config {
-  private $xml_conf;
-
-  public function load($xml_file){
-    $this->xml_conf = @simplexml_load_file($xml_file) 
-      or die("Unable to load XML config file '" . $xml_file ."'\n"); 
-    $this->xml_conf->registerXPathNamespace('iq', 
-                                            'http://indexdata.com/query');
-  }
-
-  public function parse(){
-    //foreach ($this->xml_conf->xpath('//desc') as $desc) {
-    //echo "$desc\n";
-
-    $namespaces =  $this->xml_conf->getNamespaces(true);
-    foreach ($namespaces as $ns){
-      print("namespace '" . $ns . "'\n");
-    }
-
-    foreach ($this->xml_conf->xpath('//iq:syntax') as $syntax){
-      print("syntax '" . $syntax['name']  . "'\n");
-    }    
-    
-  }
-  
-  public function cql_check_boolean($boolean){
-    foreach ($this->xml_conf->xpath("//iq:syntax[@name='cql']//iq:boolean") 
-             as $b){
-      if ($b['name'] == $boolean ){
-        print("CQL boolean '" . $boolean . "' exists\n");
-        return;
-      }    
-    }
-    print("CQL boolean '" . $boolean . "' error\n");
-  }
-
-  public function cql_check_apt($set, $index, $relation){
-        print("CQL APT set'" . $set . "' index '" . $index 
-              . "' relation '" . $relation . "' check\n");
-    
-   foreach ($this->xml_conf->xpath("//iq:syntax[@name='cql']//iq:set") 
-             as $s){
-      if ($s['name'] == $set ){
-        print("CQL APT set'" . $set . "' OK\n");
-        foreach ($set->xpath("//iq:index") as $i){
-          
-        print("CQL APT set'" . $set . "' OK index '" . $index . "' ERROR\n");
-        return;
-        }
-        
-        print("CQL APT set'" . $set . "' OK index '" . $index . "' ERROR\n");
-        return;
-      }    
-    }
-    print("CQL APT set'" . $set . "' ERROR\n");
-  }
-  
-}
-
diff --git a/etc/queryinfo.xml b/etc/queryinfo.xml
deleted file mode 100644 (file)
index efcfebc..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: queryinfo.xml,v 1.1 2006-09-11 08:40:36 marc Exp $ -->
-
-<!-- this file configures the query possibilities of YAZ -->
-<!-- and hopefully the mapping inbetween query languages as well -->
-<!-- It is a superset of the indexInfo of http://explain.z3950.org/ -->
-<!-- Other info:  Z39.92 -->
-<!-- highly experimental, will change in future! --> 
-
-
-  <!-- tricky problem of mapping PQF to CQL or 
-       other query forms (Opensearch?? -->
-  <!--
-  PQF query language evaluation in most natural order
-  boolean:            @and, @or, @not, @prox
-  boolean modifier:   @prox exclusion distance ordered relation which unit 
-                      @prox 0 3 1 2 k 2 term1 term2
-  attrset:            bib-1, exp-1, gils
-  1=Use:              4=Title 7=ISBN 8=ISSN 30=Date 62=Abstract 
-                      1003=Author 1016=Any
-  4=Structure:        1=Phrase  2=Word  3=Key  4=Year  5=Date  6=WordList
-  2=Relation:         1<   2<=  3=  4>=  5>  6!=  102=Relevance
-  5=Truncation:       1=Right  2=Left  3=L&R  100=No  101=#  102=Re-1  103=Re-2
-  6=Completeness:     1=Incompl subfield  2=Complete subfield  3=Complete field
-  3=Position:         1=First in Field  2=First in subfield  3=Any position
-  term:               fish, "fish and chips"
-  regexp:             ...
-  -->
-  <!--
-  CQL query language evaluation in most natural order
-  boolean:            and, or, not, prox
-  boolean mod set:    and/rel.sum (cql is default)
-  boolean modifier:   distance, unit, ordered, unordered
-  boolean mod rel:    =, <, >, prox/distance=1, prox/distance>2
-  boolean mod qual:   prox/distance=1/unit=word, prox/distance>2/ordered 
-  set name:           cql, rec, dc
-  index name:         cql.all, cql.serverChoice, rec.id, dc.title
-  relation:           <, <=, =, >, >=, <>, exact, all, any
-  relation mod set:   cql (default), rel
-  relation mod name:  relevant, phonetic, stem 
-                      any/relevant/rel.CORI 
-  relation mod qual:  word, string, isoDate, number, uri, masked, unmasked
-                      =/relevant=word
-  anchoring:          ^left, right^, "^cat in the hat" 
-  masking char:       *, ?, c*t, c?t 
-  term:               fish, "fish and chips"
-  -->
-
-  <queryInfo
-      xmlns="http://indexdata.com/query"
-      version="1.0">
-    <syntax name="cql" 
-            identifier=""
-            location="">
-      <boolean name="and"/>
-      <boolean name="or"/>
-      <boolean name="not"/>
-      <!--
-      <boolean name="prox">
-        <boolean_mod_rel name="="/>
-        <boolean_mod name="distance">
-          <boolean_mod_rel name="="/>
-          <boolean_mod_rel name="&lt;"/>
-          <boolean_mod_rel name="&gt;"/>
-        </boolean_mod>
-        <boolean_mod name="unit">
-          <boolean_mod_qual name="sentence"/>
-          <boolean_mod_qual name="word"/>
-        </boolean_mod>
-        <boolean_modifier name="ordered" name=""/>
-        <boolean_modifier name="unordered" name=""/>
-      </boolean>
-      -->
-
-      <relation name="=" default="true"/>
-
-      <set name="cql" default="true" 
-           identifier="info:srw/cql-context-set/1/cql-v1.1">
-        <title>CQL Standard Set</title>
-        <index name="all" default="true">
-          <relation name="=" default="true">
-            <relation_mod_set name="cql" default="true">
-              <relation_mod name="relevant"/>
-            </relation_mod_set>
-            <relation_mod_set name="rel">
-              <relation_mod name="foo"/>
-              <relation_mod name="bar"/>
-            </relation_mod_set>
-          </relation>
-          <mask name="*"/>
-          <mask name="?"/>
-          <anchor name="^" type="right"/>
-          <anchor name="^" type="left"/>
-        </index>
-        <index name="serverChoice"/>
-      </set>
-      <set name="rec" identifier="info:srw/cql-context-set/2/rec-1.0">
-        <title>Record Standard Set</title>
-        <index name="id" default="true"/>
-      </set>
-      <set name="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
-        <title>Dublin Core Set</title>
-        <index name="title"/>
-        <index name="description"/>
-        <index name="author" identifier="creator"/>
-        <index name="creator"/>
-        <index name="date">
-          <relation name="=" default="true"/>
-          <relation name="&lt;"/>
-          <relation name="&gt;"/>
-        </index>
-        <index name="publisher"/>
-      </set>
-    </syntax>
-    <syntax name="pqf" 
-            identifier=""
-            location="">
-      <set name="bib1" identifier="1.2.840.10003.3.1">
-        <title>BIB-1 Z39.50 Standard Set</title>
-        <structure name="2" default="true"/>
-        <structure name="1"/>
-        <relation name="3"/>
-        <truncation name="100"/>
-        <completeness name="3"/>
-        <position name="3"/>
-        <use name="4">
-          <title>Title</title>
-        </use>
-        <use name="7">
-          <title>ISBN</title>
-          <structure name="3">
-            <relation name="3" default="true"/>
-            <relation name="1"/>
-            <relation name="4"/>
-          </structure>
-        </use>
-        <use name="8">
-          <title>ISSN</title>
-          <structure name="3"/>
-        </use>
-        <use name="30">
-          <title>Date</title>
-          <structure name="5"/>
-        </use>
-        <use name="62">
-          <title>Abstract</title>
-        </use>
-        <use name="1003">
-          <title>Author</title>
-        </use>
-        <use name="1016">
-          <title>Any</title>
-          <structure name="2">
-            <relation name="3" default="true"/>
-            <relation name="102">
-              <truncation name="100" default="true"/>
-              <truncation name="101"/>
-              <truncation name="102"/>
-            </relation>
-          </structure>
-        </use>
-      </set>
-      <set name="exp1" identifier="">
-        <title>Explain Z39.50 Standard Set</title>
-      </set>
-      <set name="gils" identifier="">
-        <title>Gils Z39.50 Standard Set</title>
-      </set>
-    </syntax>
-    <syntax name="ccl" 
-            identifier=""
-            location="">
-      <title xml:lang="en">CCL Query Language - English Configuration</title>
-      <title xml:lang="da">CCL Søgesprog - Dansk Konfiguration</title>
-      <boolean xml:lang="en" name="and" default="true" identifier="and"/>
-      <boolean xml:lang="en" name="or" identifier="or"/>
-      <boolean xml:lang="en" name="not" identifier="not"/>
-      <boolean xml:lang="da" name="og" default="true" identifier="and"/>
-      <boolean xml:lang="da" name="eller" identifier="or"/>
-      <boolean xml:lang="da" name="ikke" identifier="not"/>
-
-      <relation name="=" default="true"/>
-
-      <index xml:lang="en" name="title"/>
-      <index xml:lang="en" name="description" default="true"/>
-      <index xml:lang="en" name="author" identifier="creator"/>
-      <index xml:lang="en" name="creator"/>
-      <index xml:lang="en" name="publisher"/>
-      <index xml:lang="da" name="titel" identifier="title"/>
-      <index xml:lang="da" name="beskrivelse"  default="true" 
-             identifier="description"/>
-      <index xml:lang="da" name="author" identifier="creator"/>
-      <index xml:lang="da" name="ophav" identifier="creator"/>
-      <index xml:lang="da" name="editor" identifier="publisher"/>
-    </syntax>
-  </queryInfo>
-
-
-  <!--
-  <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="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
-      <title>Dublin Core Set</title>
-    </set>
-    <set name="bib1" identifier="1.2.840.10003.3.1">
-      <title>BIB-1 Z39.50 Standard Set</title>
-    </set>
-
-
-    <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">text</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">text</attr>
-      </map>
-    </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>    
-
-    <index search="true" scan="true" sort="false">
-      <izx:cost value="0"/>
-      <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>
-      </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>
-        <attr type="2" set="bib1">102</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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </map>
-    </index>
-
-  </indexInfo>
--->
-
diff --git a/etc/retrievalinfo.xml b/etc/retrievalinfo.xml
deleted file mode 100644 (file)
index 0f4bafb..0000000
+++ /dev/null
@@ -1,104 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: retrievalinfo.xml,v 1.1 2006-09-11 08:40:36 marc Exp $ -->
-
-<!-- this file configures the retrieval possibilities of YAZ -->
-<!-- It is a superset of the schemaInfo of http://explain.z3950.org/ -->
-<!-- Other info:  Z39.92 -->
-<!-- highly experimental, might change! --> 
-
-  <retrievalInfo 
-      xmlns="http://indexdata.com/retrieval"
-      version="1.0">
-    <retrieval 
-        syntax="grs-1"
-        identifier="1.2.840.10003.5.105"
-        location="http://www.loc.gov/z3950/agency/asn1.html#RecordSyntax-generic"/>
-    <retrieval 
-        syntax="marc21" 
-        identifier="1.2.840.10003.5.10"
-        location="http://www.loc.gov/marc/">
-      <title lang="en">Marc21</title>
-      <elementset name="F">
-        <title lang="en" primary="true">Full Marc21 Record</title>
-        <backend syntax="usmarc" name="F"/>
-      </elementset>
-      <elementset name="B">
-        <title lang="en" primary="true">Brief Marc21 Record</title>
-        <backend syntax="usmarc" name="B"/>
-      </elementset>
-    </retrieval>
-
-    <retrieval 
-        syntax="xml" 
-        identifier="1.2.840.10003.5.109.10"
-        location="http://www.w3.org/XML/">
-        <!-- location="http://www.w3.org/TR/2006/REC-xml-20060816/"  -->
-      <title lang="en">XML</title>
-      <elementset
-          identifier="info:srw/schema/1/marcxml-v1.1"
-          location="http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
-          name="marcxml">
-        <title lang="en">MarcXML</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxml"
-                inputcharset="marc-8"/>
-        </convert>
-      </elementset>
-      
-      <elementset 
-          name="marcxchange">
-        <title lang="en">Marc XChange</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxchange"
-                inputcharset="marc-8"/>
-        </convert>
-      </elementset>
-      
-      <elementset 
-          identifier="info:srw/schema/1/dc-v1.1"
-          location="http://www.loc.gov/standards/sru/dc-schema.xsd"
-          name="dc">
-        <title lang="en">Dublin Core</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxml"
-                inputcharset="marc-8"/>
-          <xslt stylesheet="../etc/MARC21slim2DC.xsl"/>
-        </convert>
-      </elementset>
-    </retrieval>
-  </retrievalInfo>
-
-<!--
-  <schemaInfo>
-    <schema identifier="info:srw/schema/2/rec-1.0"
-            location="http://srw.cheshire3.org/schemas/rec/1.0/rec.xsd" 
-            name="rec"
-            retrieve="true">
-      <title lang="en">Record Metadata</title>
-      
-    </schema>
-    <schema identifier="info:srw/schema/1/dc-v1.1"
-            location="http://www.loc.gov/standards/sru/dc-schema.xsd" 
-            name="dc"
-            retrieve="true">
-      <title lang="en">Dublin Core</title>
-    </schema>
-    <schema identifier="info:srw/schema/1/mods-v3.0"
-            location="http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"
-            name="mods"
-            retrieve="true">
-      <title lang="en">Mods</title>
-    </schema>
-    <schema identifier="info:srw/schema/1/marcxml-v1.1"
-            location="http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
-            name="marcxml"
-            retrieve="true">
-      <title lang="en">MarcXML</title>
-    </schema>
-  </schemaInfo>
--->
\ No newline at end of file
diff --git a/etc/zeerex-explain.xml b/etc/zeerex-explain.xml
deleted file mode 100644 (file)
index c19dde2..0000000
+++ /dev/null
@@ -1,740 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- $Id: zeerex-explain.xml,v 1.3 2006-09-08 12:52:02 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 -->
-<!-- http://explain.z3950.org/dtd/zeerex-2.0.xsd -->
-<!-- Extensions see: http://explain.z3950.org/dtd/extensions.html -->
-<!-- Other info:  Z39.92 -->
-
-<explain xmlns="http://explain.z3950.org/dtd/2.0/"
-         xmlns:izx="http://indexdata.com/zeerex/1.0">
-
-  <!-- try stylesheet url: http://./?stylesheet=docpath/sru2.xsl -->
-  <serverInfo protocol="SRW/SRU/Z39.50">
-
-    <host>foo.indexdata.dk</host>
-    <port>80</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">Metaproxy SRU/SRW/Z39.50 server</title>
-
-    <description lang="en" primary="true">
-      Test ZeeRex Explain for SRU  and CQL-to-PQF query Metaproxy filter
-    </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>  -->
-    <!-- <extend>Partially crawled web data</extend> -->
-   
-    <history>
-      Implemented for Talis
-    </history>
-
-    <implementation  identifier="Metaproxy" version="0.??">
-      <title>Index Data Metaproxy http://www.indexdata.dk</title>
-    </implementation>
-    
-    <links> 
-      <link type="z39.50">http://foo.indexdata.dk:80</link>
-      <link type="srw">http://foo.indexdata.dk:80</link>
-      <link type="sru">http://foo.indexdata.dk:80</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>
-  -->
-
-
-
-  <!-- tricky problem of mapping PQF to CQL or 
-       other query forms (Opensearch?? -->
-  <!--
-  PQF query language evaluation in most natural order
-  boolean:            @and, @or, @not, @prox
-  boolean modifier:   @prox exclusion distance ordered relation which unit 
-                      @prox 0 3 1 2 k 2 term1 term2
-  attrset:            bib-1, exp-1, gils
-  1=Use:              4=Title 7=ISBN 8=ISSN 30=Date 62=Abstract 
-                      1003=Author 1016=Any
-  4=Structure:        1=Phrase  2=Word  3=Key  4=Year  5=Date  6=WordList
-  2=Relation:         1<   2<=  3=  4>=  5>  6!=  102=Relevance
-  5=Truncation:       1=Right  2=Left  3=L&R  100=No  101=#  102=Re-1  103=Re-2
-  6=Completeness:     1=Incompl subfield  2=Complete subfield  3=Complete field
-  3=Position:         1=First in Field  2=First in subfield  3=Any position
-  term:               fish, "fish and chips"
-  regexp:             ...
-  -->
-  <!--
-  CQL query language evaluation in most natural order
-  boolean:            and, or, not, prox
-  boolean mod set:    and/rel.sum (cql is default)
-  boolean modifier:   distance, unit, ordered, unordered
-  boolean mod rel:    =, <, >, prox/distance=1, prox/distance>2
-  boolean mod qual:   prox/distance=1/unit=word, prox/distance>2/ordered 
-  set name:           cql, rec, dc
-  index name:         cql.all, cql.serverChoice, rec.id, dc.title
-  relation:           <, <=, =, >, >=, <>, exact, all, any
-  relation mod set:   cql (default), rel
-  relation mod name:  relevant, phonetic, stem 
-                      any/relevant/rel.CORI 
-  relation mod qual:  word, string, isoDate, number, uri, masked, unmasked
-                      =/relevant=word
-  anchoring:          ^left, right^, "^cat in the hat" 
-  masking char:       *, ?, c*t, c?t 
-  term:               fish, "fish and chips"
-  -->
-
-  <queryInfo
-      xmlns="http://indexdata.com/query"
-      version="1.0">
-    <syntax name="cql" 
-            identifier=""
-            location="">
-      <boolean name="and"/>
-      <boolean name="or"/>
-      <boolean name="not"/>
-      <!--
-      <boolean name="prox">
-        <boolean_mod_rel name="="/>
-        <boolean_mod name="distance">
-          <boolean_mod_rel name="="/>
-          <boolean_mod_rel name="&lt;"/>
-          <boolean_mod_rel name="&gt;"/>
-        </boolean_mod>
-        <boolean_mod name="unit">
-          <boolean_mod_qual name="sentence"/>
-          <boolean_mod_qual name="word"/>
-        </boolean_mod>
-        <boolean_modifier name="ordered" name=""/>
-        <boolean_modifier name="unordered" name=""/>
-      </boolean>
-      -->
-
-      <relation name="=" default="true"/>
-
-      <set name="cql" default="true" 
-           identifier="info:srw/cql-context-set/1/cql-v1.1">
-        <title>CQL Standard Set</title>
-        <index name="all" default="true">
-          <relation name="=" default="true">
-            <relation_mod_set name="cql" default="true">
-              <relation_mod name="relevant"/>
-            </relation_mod_set>
-            <relation_mod_set name="rel">
-              <relation_mod name="foo"/>
-              <relation_mod name="bar"/>
-            </relation_mod_set>
-          </relation>
-          <mask name="*"/>
-          <mask name="?"/>
-          <anchor name="^" type="right"/>
-          <anchor name="^" type="left"/>
-        </index>
-        <index name="serverChoice"/>
-      </set>
-      <set name="rec" identifier="info:srw/cql-context-set/2/rec-1.0">
-        <title>Record Standard Set</title>
-        <index name="id" default="true"/>
-      </set>
-      <set name="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
-        <title>Dublin Core Set</title>
-        <index name="title"/>
-        <index name="description"/>
-        <index name="author" identifier="creator"/>
-        <index name="creator"/>
-        <index name="date">
-          <relation name="=" default="true"/>
-          <relation name="&lt;"/>
-          <relation name="&gt;"/>
-        </index>
-        <index name="publisher"/>
-      </set>
-    </syntax>
-    <syntax name="pqf" 
-            identifier=""
-            location="">
-      <set name="bib1" identifier="1.2.840.10003.3.1">
-        <title>BIB-1 Z39.50 Standard Set</title>
-        <structure name="2" default="true"/>
-        <structure name="1"/>
-        <relation name="3"/>
-        <truncation name="100"/>
-        <completeness name="3"/>
-        <position name="3"/>
-        <use name="4">
-          <title>Title</title>
-        </use>
-        <use name="7">
-          <title>ISBN</title>
-          <structure name="3">
-            <relation name="3" default="true"/>
-            <relation name="1"/>
-            <relation name="4"/>
-          </structure>
-        </use>
-        <use name="8">
-          <title>ISSN</title>
-          <structure name="3"/>
-        </use>
-        <use name="30">
-          <title>Date</title>
-          <structure name="5"/>
-        </use>
-        <use name="62">
-          <title>Abstract</title>
-        </use>
-        <use name="1003">
-          <title>Author</title>
-        </use>
-        <use name="1016">
-          <title>Any</title>
-          <structure name="2">
-            <relation name="3" default="true"/>
-            <relation name="102">
-              <truncation name="100" default="true"/>
-              <truncation name="101"/>
-              <truncation name="102"/>
-            </relation>
-          </structure>
-        </use>
-      </set>
-      <set name="exp1" identifier="">
-        <title>Explain Z39.50 Standard Set</title>
-      </set>
-      <set name="gils" identifier="">
-        <title>Gils Z39.50 Standard Set</title>
-      </set>
-    </syntax>
-    <syntax name="ccl" 
-            identifier=""
-            location="">
-      <title xml:lang="en">CCL Query Language - English Configuration</title>
-      <title xml:lang="da">CCL Søgesprog - Dansk Konfiguration</title>
-      <boolean xml:lang="en" name="and" default="true" identifier="and"/>
-      <boolean xml:lang="en" name="or" identifier="or"/>
-      <boolean xml:lang="en" name="not" identifier="not"/>
-      <boolean xml:lang="da" name="og" default="true" identifier="and"/>
-      <boolean xml:lang="da" name="eller" identifier="or"/>
-      <boolean xml:lang="da" name="ikke" identifier="not"/>
-
-      <relation name="=" default="true"/>
-
-      <index xml:lang="en" name="title"/>
-      <index xml:lang="en" name="description" default="true"/>
-      <index xml:lang="en" name="author" identifier="creator"/>
-      <index xml:lang="en" name="creator"/>
-      <index xml:lang="en" name="publisher"/>
-      <index xml:lang="da" name="titel" identifier="title"/>
-      <index xml:lang="da" name="beskrivelse"  default="true" 
-             identifier="description"/>
-      <index xml:lang="da" name="author" identifier="creator"/>
-      <index xml:lang="da" name="ophav" identifier="creator"/>
-      <index xml:lang="da" name="editor" identifier="publisher"/>
-    </syntax>
-  </queryInfo>
-
-
-
-  <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="dc" identifier="info:srw/cql-context-set/1/dc-v1.1">
-      <title>Dublin Core Set</title>
-    </set>
-    <set name="bib1" identifier="1.2.840.10003.3.1">
-      <title>BIB-1 Z39.50 Standard 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">text</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">text</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>    
-
-    <!-- Dublin Core Indexes -->
-    <index search="true" scan="true" sort="false">
-      <izx:cost value="0"/>
-      <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>
-      </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>
-        <!-- <attr type="2" set="bib1">102</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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </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>
-      </map>
-    </index>
-
-  </indexInfo>
-
-  <!-- Z39.50 stuff ... not allowed in one and the same explain together with 
-       <schemaInfo>, sic ..
-  <recordInfo>
-    <recordSyntax identifier="1.2.840.10003.5.109.10">
-      <elementSet name="F">
-        <title lang="en" primary="true">Full XML Record</title>
-      </elementSet>
-      <elementSet name="B">
-        <title lang="en" primary="true">Brief XML Record</title>
-      </elementSet>
-    </recordSyntax>
-  </recordInfo>
-  -->
-
-  <retrievalInfo 
-      xmlns="http://indexdata.com/retrieval"
-      version="1.0">
-    <retrieval 
-        syntax="grs-1"
-        identifier="1.2.840.10003.5.105"
-        location="http://www.loc.gov/z3950/agency/asn1.html#RecordSyntax-generic"/>
-    <retrieval 
-        syntax="marc21" 
-        identifier="1.2.840.10003.5.10"
-        location="http://www.loc.gov/marc/">
-      <title lang="en">Marc21</title>
-      <elementset name="F">
-        <title lang="en" primary="true">Full Marc21 Record</title>
-        <backend syntax="usmarc" name="F"/>
-      </elementset>
-      <elementset name="B">
-        <title lang="en" primary="true">Brief Marc21 Record</title>
-        <backend syntax="usmarc" name="B"/>
-      </elementset>
-    </retrieval>
-
-    <retrieval 
-        syntax="xml" 
-        identifier="1.2.840.10003.5.109.10"
-        location="http://www.w3.org/XML/">
-        <!-- location="http://www.w3.org/TR/2006/REC-xml-20060816/"  -->
-      <title lang="en">XML</title>
-      <elementset
-          identifier="info:srw/schema/1/marcxml-v1.1"
-          location="http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
-          name="marcxml">
-        <title lang="en">MarcXML</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxml"
-                inputcharset="marc-8"/>
-        </convert>
-      </elementset>
-      
-      <elementset 
-          name="marcxchange">
-        <title lang="en">Marc XChange</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxchange"
-                inputcharset="marc-8"/>
-        </convert>
-      </elementset>
-      
-      <elementset 
-          identifier="info:srw/schema/1/dc-v1.1"
-          location="http://www.loc.gov/standards/sru/dc-schema.xsd"
-          name="dc">
-        <title lang="en">Dublin Core</title>
-        <backend syntax="usmarc" name="F"/>
-        <convert>
-          <marc inputformat="marc" outputformat="marcxml"
-                inputcharset="marc-8"/>
-          <xslt stylesheet="../etc/MARC21slim2DC.xsl"/>
-        </convert>
-      </elementset>
-    </retrieval>
-  </retrievalInfo>
-
-<!--
-  <schemaInfo>
-    <schema identifier="info:srw/schema/2/rec-1.0"
-            location="http://srw.cheshire3.org/schemas/rec/1.0/rec.xsd" 
-            name="rec"
-            retrieve="true">
-      <title lang="en">Record Metadata</title>
-      
-    </schema>
-    <schema identifier="info:srw/schema/1/dc-v1.1"
-            location="http://www.loc.gov/standards/sru/dc-schema.xsd" 
-            name="dc"
-            retrieve="true">
-      <title lang="en">Dublin Core</title>
-    </schema>
-    <schema identifier="info:srw/schema/1/mods-v3.0"
-            location="http://www.loc.gov/standards/mods/v3/mods-3-0.xsd"
-            name="mods"
-            retrieve="true">
-      <title lang="en">Mods</title>
-    </schema>
-    <schema identifier="info:srw/schema/1/marcxml-v1.1"
-            location="http://www.loc.gov/standards/marcxml/schema/MARC21slim.xsd"
-            name="marcxml"
-            retrieve="true">
-      <title lang="en">MarcXML</title>
-    </schema>
-  </schemaInfo>
--->
-  <configInfo>
-
-    <!-- searchRetrieve settings -->
-
-    <!-- default context set -->
-    <default type="contextSet">cql</default>
-
-    <default type="index">all</default>
-
-    <!-- default relation -->
-    <default type="relation">=</default>
-
-    <supports type="relation" 
-              izx:type="2" izx:set="bib1" izx:value="1">&lt;</supports>
-    <supports type="relation" 
-              izx:type="2" izx:set="bib1" izx:value="2">&lt;=</supports>
-    <supports type="relation"
-              izx:type="2" izx:set="bib1" izx:value="3">=</supports> 
-    <supports type="relation"
-              izx:type="2" izx:set="bib1" izx:value="4">&gt;=</supports>
-    <supports type="relation"
-              izx:type="2" izx:set="bib1" izx:value="5">&gt;</supports>
-
-
-    <!-- <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"
-              izx:type="2" izx:set="bib1" izx:value="102">relevant</supports>
-
-    <!-- <supports type="relationModifier"
-              izx:type="2" izx:set="bib1" izx:value="100">phonetic</supports> -->
-    <!-- <supports type="relationModifier"
-              izx:type="2" izx:set="bib1" izx:value="101">stem</supports> -->
-
-
-    <!-- support proximity (Empty) -->
-    <!-- <supports type="proximity"></supports> --> <!-- DEAD,  title = (house prox/distance=1/unit=word  the) FAILS -->
-
-
-    <!-- proximity modifier supported by the server or index 
-         (relation, distance, unit, ordering) -->
-    <!-- <supports type="proximityModifier"></supports> -->
-
-    <!-- boolean modifier supported by the server or index -->
-    <!-- <supports type="booleanModifier"></supports> -->
-
-    <!-- masking character supported (* or ?) -->
-    <supports type="maskingCharacter">*</supports>
-    <supports type="maskingCharacter">?</supports>
-
-    <!-- anchoring supported? (^ character) -->
-    <!-- MARC: how do I express that I only support left anchoring in 
-         the beginning of the field ( bib1 3=1 ), but no right anchoring ?? -->
-    <!-- MIKE: You can't.  The ZeeRex documentation should be changed
-        to allow this, as <supports type="anchoring">left</supports> -->
-    <!-- <supports type="anchoring"></supports> -->
-
-    <!-- empty terms supported (Empty) -->
-    <!-- MARC: what's the use case of this ?? -->
-    <!-- MIKE: lots of uses!  For example, scanning from the very
-        start of the index with 'scan @attr 1=text ""'.  Or searching
-        for bibliographic records with no title, etc. -->
-    <!-- MARC: I see, and we can if we always use '""' 
-         (the empty string), as in 'scan @attr 1=text ""' -->
-    <supports type="emptyTerm"></supports>
-
-
-    <!-- sorting settings -->
-
-    <!-- default schema used in sorting, in short name form -->
-    <!-- <default type="sortSchema"></default> -->
-    <!-- MIKE: deprecated -->
-
-    <!-- server support sort -->
-    <!-- MARC: why stating this redundant info here?? it's already in the 
-         <index sort="true" attribute -->
-    <!-- MIKE: that's not quite the same thing.  This is saying
-         whether the server can do sorting at all.  Since
-        sort="true|false" attributes can be omitted entirely from
-        indexes, you can't deduce from a set of <index> elements
-        without sorting specified that the server doesn't support
-        sorting -->
-    <!-- MARC: which ought to be the same thing than saying that sorting is 
-         _not_ possible. In short,  one simple <index sort="true" attribute
-         should be enough to tell that sorting _is_ possible. Or we have the 
-         same discussion about overruling general sorting capabilities in 
-         specific indexes ?? Quite confusing ... -->
-    <!-- MIKE: no, within an <index>, saying sort="true" means that
-        you can sort on it, sort="false" means that you can't, and
-        not saying anything means you're not saying anything.  Three
-        different cases.   That's as it should be, since Explain
-        records might be auto-generated by systems that can't do the
-        necessary probes.  So a ZeeRex record might not have "sort"
-        attributes on any of its <index>es, but still say that
-        sorting is supported.  The client (or user) has to experiment
-        to find out what indexes support it.  Check the mailing list
-        archives if you want a rationale, I forget the details. -->
-    <!-- <supports type="sort"></supports> -->
-
-    <!-- supported sortmodifier (ascending, missingValue, caseSensitive) -->
-    <!-- <supports type="sortModifier"></supports> -->
-    <!-- MIKE: this is for the new CQL "sortby" sorting, which Zebra
-        doesn't yet do at all, so you're right to omit this for now. -->
-
-    <!-- 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">index</default>
-    <!-- MIKE: That's not what I get by default.  A URL such as
-http://localhost:1314/Default?version=1.1&operation=searchRetrieve&query=1&maximumRecords=10
-         gives me a weird sort of hybrid record with <metadata>
-        sections and <z:index> elements.  Unfortunately, the SRU
-        response doesn't see to explicitly state what schema is
-        used. -->
-     <!-- MARC: Right, the default seems to be the 'index' schema. I have to 
-          talk to Adam to get a better way to choose the default schema -->
-
-    <!-- default stylesheet URL, or if stylesheets are supported -->
-    <!-- MARC: here I want to express: no default, but you kan use this 
-         and only this one - should I use 'setting' ?? -->
-    <!-- MIKE: There is no way to say this at present, but what you
-        suggest is sensible.  Please suggest it to the list -->
-    <setting type="stylesheet">docpath/sru.xsl</setting>
-
-    <!-- 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) -->
-    <!-- MARC: this one is for result sets in Z39.50, right ?? -->
-    <!-- MIKE: No, this also applies for SRU -->
-    <!-- MARC: Rrrrriiiight! That's why the section about this is called
-         <schemaInfo>, and the word resultSet never appears in a SRU Explain.
-         Very intuitive! -->
-    <!-- MIKE: I don't understand what point you're making.  SRU, like
-        Z39.50, has specifications for how to do result sets.  But I
-        don't know whether Zebra supports them or not -->
-    <!-- MARC: open question, then, I'll better comment out -->
-    <!-- <supports type="resultSets"></supports>  --> 
-
-    <!-- XPath retrieval supported -->
-    <!-- <supports type="recordXPath"></supports> -->
-
-
-    <!-- scan settings -->
-
-    <!-- scan operation supported -->
-    <supports type="scan"></supports>
-
-    <!-- default number of terms to be returned in scan -->
-    <default type="numberOfTerms">20</default>
-
-
-
-    <!-- other server settings -->
-
-    <!-- older version of the protocol supported  -->
-    <!-- MARC: why only older versions of the protocol ?? It seems 
-         natural just to list what you understand, including the one the
-         client sucesfully used --> 
-    <!-- MIKE: it may seem natural, but it ain't what it means! -->
-    <!-- MARC: but makes sense, and makes determining the list of protocol 
-         versions easier in a thin client -->
-    <!-- MIKE: if you want to change the meaning of this, then propose
-        it on-list.  I doubt you'll get much support.  Thin clients
-        won't use this anyway, they will just speak one version and
-        hope for the best -->
-    <!-- <supports type="version">1.1</supports> -->
-
-    <!-- number of seconds that a result set will be maintained for -->
-    <setting type="resultSetTTL">0</setting>
-
-    <!-- A type of extraRequestData available in the
-         searchRetrieveRequest. The extra*Data fields are represented as two
-         space separated words, the first the identifier for the extension and
-         the second the individual element name from the extension. If there is
-         only one word, then it is the extension id and all elements from
-         within are supported. -->
-    <!-- <supports type="extraSearchData"></supports> -->
-    <!-- MIKE: we could explain x-pquery here -->
-    <!-- MARC: I talked to Adam about this. We should make a new 'x-type'
-         with possible values PQF, CQL, CCL , .. such that 'query' still is
-         obligatory, and carries the query string, be it PQF, CCL, or CQL. -->
-    <!-- MIKE: Yes, that would be _much_ better -->
-
-    <!-- A type of extraRequestData available in the explainRequest -->
-    <!-- <supports type="extraExplainData"></supports> -->
-
-    <!-- A type of extraRequestData available in the scanRequest -->
-    <!-- <supports type="extraScanData"></supports> -->
-    <!-- MIKE: we could explain x-pscan here -->
-    <!-- MARC: re-use of 'x-type' here .. drop 'x-pscan' -->
-
-    <!-- The URI identifier of a supported profile -->
-    <!-- MARC: what's this ?? -->
-    <!-- <supports type="profile"></supports> -->
-    <!-- MIKE: this is a very good thing, which we should use when the
-        time is right.  A "profile" is a complete set of
-        specifications for using Z39.50 and/or SRU within a
-        particular application domain.  We should write a (brief)
-        "Alvis Profile for SRU", assign it an opaque identifier URI,
-        and point to it here.  (Not today, though!) -->
-    <!-- MARC: so this is some HTML prosa text ?? -->
-    <!-- MIKE: see for example
-       http://zthes2.z3950.org/srw/zthes-srw-1.0.html
-       -->
-  </configInfo>
-   
-</explain>
diff --git a/xml/Makefile.am b/xml/Makefile.am
new file mode 100644 (file)
index 0000000..5a61760
--- /dev/null
@@ -0,0 +1,4 @@
+# $Id: Makefile.am,v 1.1 2006-10-10 15:10:17 marc Exp $
+
+SUBDIRS = schema xslt
+
diff --git a/xml/experiments/config-imagine.xml b/xml/experiments/config-imagine.xml
new file mode 100644 (file)
index 0000000..7879f5a
--- /dev/null
@@ -0,0 +1,117 @@
+<?xml version="1.0"?>
+<!-- imagined config for yp2..
+  The router system understands yp2, sequence and filter elements.
+  Everything else interpreted by filters.
+  Each filter is invoked in a sequence (unless a filter invokes another
+  sequence.. A start sequence must be determined somehow.
+  -->
+<yp2 xmlns="http://indexdata.dk/yp2/config/1">
+  <start route="id_hytg"/>
+  <filters>
+    <filter id="front_default" type="frontend-net">
+      <!-- the Z39.50/HTTP frontend -->
+      <port>@:210</port>
+    </filter>
+    <filter id="log_out" type="log">          <!-- apply logging always -->
+      <logfile>out.log</logfile>
+    </filter>
+    <filter id="log_cerr" type="log">          <!-- apply logging always -->
+      <logfile>std::cerr</logfile>
+    </filter>
+  </filters>
+
+  <routes>  
+    <route id="start">
+      <filter refid="log_cout"/>
+      <filter type="cond">           <!-- conditional -->
+       <if test="port=210 and db=public" route="A"/> 
+       <if test="port=210 and db=other" route="B"/> 
+        <switch>
+          <case test="blabla" route="C"/>
+          <case test="blabla2" route="C2"/>
+          <default route="C3"/>
+       </switch>
+      </filter>
+      <filter refid="log_out"/>
+      <filter refid="log_cerr"/>
+      <filter type="log">          <!-- apply logging always -->
+       <logfile>mylog.log</logfile>
+      </filter>   
+    <filter name="reject">        <!-- reject .. -->
+    </filter>
+    <filter type="bounce"/>
+    </route>
+    <route id="public">
+      <filter type="z3950-client">
+       <target>localhost:9999/A</target>
+    </filter>
+    <filter type="bounce"/>
+    </route>
+    <route id="internal">
+      <filter type="z3950-client">
+       <target>localhost:9999/B</target>
+      </filter>
+      <filter type="bounce"/>
+   </route>
+    <route id="internal">
+      <xml:include href="file://module2.xml#filter45"/>
+      <xml:include href="file://module4.xml#filter145"/>
+      <filter type="bounce"/>
+    </route>
+    <route id="AB">
+      <filter type="multi">
+        <package route="A"/>
+        <package route="B"/>
+        <merge type="simple"/>
+      </filter>
+      <filter type="bounce"/>
+    </route>
+  </routes>
+</yp2>
+
+<!-- functions:
+    db           returns Z39.50 database(s)
+    path         HTTP path
+    HTTP-header  Any HTTP header (including content-type)
+    request-type Init,Search,HTTP,...
+    origin       IP of origin
+    port         Port
+
+
+mother object filter-dom-hash
+  deletes pointers to contexts and filters  on program exit
+hash filter-type -> hash-filter-id -> Context
+                 -> filter-binary-pointer
+
+moher object router pointer hash
+
+created in mother thread, read only structures.
+
+Context* filter.configure(dom );
+
+
+
+process(Context con)
+
+where each filter can have is own context class
+
+yp2::filter::Log::Context : public Context
+
+
+Filters are constructed with a FilterFactory class which exposes a
+method 
+
+Filter* createFilter(std::string type)
+
+ .. which returns a filter
+instance. (The interface pointer that is). The FilterFactory may later
+offer function
+  loadModule(std::string filename);
+or even
+  loadModules(std::string filenamemask);
+
+
+
+-->
+
+<!-- observation: the logic could be controlled by a XSLT! -->
diff --git a/xml/experiments/experiment-query-config-translate.php b/xml/experiments/experiment-query-config-translate.php
new file mode 100755 (executable)
index 0000000..38e764e
--- /dev/null
@@ -0,0 +1,173 @@
+#!/usr/bin/php
+<?php
+# Include PEAR::Console_Getopt
+require_once 'Console/Getopt.php';
+
+$command = new Command;
+print_r($command->command());
+
+$config = new Config;
+$config->load($command->config());
+$config->parse();
+$config->cql_check_boolean("and");
+$config->cql_check_boolean("notexist");
+$config->cql_check_apt("cql", "all", "=");
+$config->cql_check_apt("cql", "all", "notexist");
+$config->cql_check_apt("cql", "notexist", "=");
+$config->cql_check_apt("notexist", "all", "<>");
+
+
+print("DONE\n");
+exit(0);
+
+
+class Command {
+  private $options;
+  private $command;
+  private $short_format_config = 'hc:s:t:';
+  private $syntax_config = array('ccl', 'cql', 'pqf');
+
+
+  public function __construct() {
+    $args = Console_Getopt::readPHPArgv();
+
+    if ( PEAR::isError($args) ) {
+      fwrite(STDERR,$args->getMessage()."\n");
+      exit(1);
+    }
+    
+    // Compatibility between "php script.php" and "./script.php"
+    if ( realpath($_SERVER['argv'][0]) == __FILE__ ) {
+      $this->options 
+        = Console_Getopt::getOpt($args, $this->short_format_config);
+    } else {
+      $this->options 
+        = Console_Getopt::getOpt2($args, $this->short_format_config);
+    }
+    
+    // Check for invalid options
+    if ( PEAR::isError($this->options) ) {
+      fwrite(STDERR, $this->options->getMessage()."\n");
+      $this->help();
+    }
+    
+    $this->command = array();
+    
+    // Loop through the user provided options
+    foreach ( $this->options[0] as $option ) {
+      switch ( $option[0] ) {
+      case 'h':
+        help();
+        break;
+      case 's':
+        $this->command['syntax'] = $option[1];
+        break;
+      case 't':
+        $this->command['transform'] = $option[1];
+        break;
+     case 'c':
+       $this->command['config'] = $option[1];
+       break;
+      }
+    }
+    
+    // Loop through the user provided options
+    foreach ($this->options[1] as $argument ) {
+      $this->command['query'] .= ' ' . $argument;
+    }
+  }
+
+  
+  public function help() {
+    fwrite(STDERR, "  Usage:\n");
+    fwrite(STDERR, "  ./experiment-query-config-translate.php -s syntax -t transform -c config.xml query\n");
+    fwrite(STDERR, "  Experiment with general query configuration syntax and transformations.\n");
+    fwrite(STDERR, "  -c config.xml XML config file\n");
+    fwrite(STDERR, "  -s syntax     Syntax of source query language, 'ccl', 'cql', 'pqf'\n");
+    fwrite(STDERR, "  -t transform  Syntax of transformed query language, 'ccl', 'cql', 'pqf'\n");
+    fwrite(STDERR, "  -h            Display help\n");
+    fwrite(STDERR, "  query         Valid query in specified syntax\n");  
+    exit(0);
+  }
+
+  public function command() {
+    return $this->command;
+  }
+  
+  public function syntax() {
+    return $this->command['syntax'];
+  }
+  
+  public function transform() {
+    return $this->command['transform'];
+  }
+  
+  public function config() {
+    return $this->command['config'];
+  }
+
+  public function query() {
+    return $this->commamd['query'];
+  }
+  
+}
+
+class Config {
+  private $xml_conf;
+
+  public function load($xml_file){
+    $this->xml_conf = @simplexml_load_file($xml_file) 
+      or die("Unable to load XML config file '" . $xml_file ."'\n"); 
+    $this->xml_conf->registerXPathNamespace('iq', 
+                                            'http://indexdata.com/query');
+  }
+
+  public function parse(){
+    //foreach ($this->xml_conf->xpath('//desc') as $desc) {
+    //echo "$desc\n";
+
+    $namespaces =  $this->xml_conf->getNamespaces(true);
+    foreach ($namespaces as $ns){
+      print("namespace '" . $ns . "'\n");
+    }
+
+    foreach ($this->xml_conf->xpath('//iq:syntax') as $syntax){
+      print("syntax '" . $syntax['name']  . "'\n");
+    }    
+    
+  }
+  
+  public function cql_check_boolean($boolean){
+    foreach ($this->xml_conf->xpath("//iq:syntax[@name='cql']//iq:boolean") 
+             as $b){
+      if ($b['name'] == $boolean ){
+        print("CQL boolean '" . $boolean . "' exists\n");
+        return;
+      }    
+    }
+    print("CQL boolean '" . $boolean . "' error\n");
+  }
+
+  public function cql_check_apt($set, $index, $relation){
+        print("CQL APT set'" . $set . "' index '" . $index 
+              . "' relation '" . $relation . "' check\n");
+    
+   foreach ($this->xml_conf->xpath("//iq:syntax[@name='cql']//iq:set") 
+             as $s){
+      if ($s['name'] == $set ){
+        print("CQL APT set'" . $set . "' OK\n");
+        foreach ($set->xpath("//iq:index") as $i){
+          
+        print("CQL APT set'" . $set . "' OK index '" . $index . "' ERROR\n");
+        return;
+        }
+        
+        print("CQL APT set'" . $set . "' OK index '" . $index . "' ERROR\n");
+        return;
+      }    
+    }
+    print("CQL APT set'" . $set . "' ERROR\n");
+  }
+  
+}
+
diff --git a/xml/schema/Makefile.am b/xml/schema/Makefile.am
new file mode 100644 (file)
index 0000000..4a2971f
--- /dev/null
@@ -0,0 +1,20 @@
+# $Id: Makefile.am,v 1.1 2006-10-10 15:10:18 marc Exp $
+
+xmlschemadatadir = $(pkgdatadir)/xml/schema
+
+schemas =  metaproxy.rnc  metaproxy.rng  metaproxy.xsd
+
+xmlschemadata_DATA = $(schemas)
+
+EXTRA_DIST = $(xmlschemadata_DATA)
+
+
+
+# pattern compile RelaxNG Compact to RelaxNG XML
+%.rng : %.rnc
+       trang $< $@  
+
+# pattern compile RelaxNG Compact to XML Schema
+%.xsd : %.rnc 
+       trang $< $@  
+
index bd94035..8e92daa 100644 (file)
@@ -1,5 +1,5 @@
 # Metaproxy XML config file schemas
-#  $Id: metaproxy.rnc,v 1.4 2006-10-06 22:51:40 marc Exp $
+#  $Id: metaproxy.rnc,v 1.5 2006-10-10 15:10:18 marc Exp $
 # 
 #   Copyright (c) 2005-2006, Index Data.
 # 
@@ -49,6 +49,9 @@ filter =
     | filter_log
     | filter_multi
     | filter_query_rewrite
+    | filter_record_transform
+    | filter_session_shared
+    | filter_sru_z3950
     | filter_virt_db
     | filter_z3950_client
   }
@@ -94,11 +97,13 @@ filter_log =
   attribute type { "log" },
   attribute id { xsd:NCName }?,
   attribute name { xsd:NCName }?,
-  element message { xsd:NCName },
+  element message { xsd:string }?,
   element filename { xsd:string }?,
   element category {
+    attribute init-options { xsd:boolean }?,
     attribute request-session { xsd:boolean }?,
     attribute response-session { xsd:boolean }?,
+    attribute apdu { xsd:boolean }?,
     attribute request-apdu { xsd:boolean }?,
     attribute response-apdu { xsd:boolean }?
   }?
@@ -119,6 +124,29 @@ filter_query_rewrite =
   attribute name { xsd:NCName }?,
   element xslt { xsd:string }
 
+filter_record_transform =
+  attribute type { "record_transform" },
+  attribute id { xsd:NCName }?,
+  attribute name { xsd:NCName }?,
+  retrievalinfo 
+
+filter_session_shared =
+  attribute type { "session_shared" },
+  attribute id { xsd:NCName }?,
+  attribute name { xsd:NCName }?,
+  element resultset {
+    attribute max { xsd:integer },
+    attribute ttl { xsd:integer }
+  },
+  element session {
+    attribute ttl { xsd:integer }
+  }
+
+filter_sru_z3950 =
+  attribute type { "sru_z3950" },
+  attribute id { xsd:NCName }?,
+  attribute name { xsd:NCName }?
+
 filter_virt_db =
   attribute type { "virt_db" },
   attribute id { xsd:NCName }?,
@@ -133,4 +161,25 @@ filter_z3950_client =
   attribute type { "z3950_client" },
   attribute id { xsd:NCName }?,
   attribute name { xsd:NCName }?,
-  element timeout { xsd:integer }
+  element timeout { xsd:integer }?
+
+retrievalinfo = 
+  element retrievalinfo { 
+    element retrieval {
+      attribute syntax { xsd:string },
+      attribute name { xsd:string }?,
+      attribute identifier { xsd:string }?,
+      attribute backendsyntax { xsd:string }?,
+      attribute backendname { xsd:string }?,
+      element convert {
+        element marc {
+          attribute inputformat { xsd:string },
+          attribute outputformat { xsd:string },
+          attribute inputcharset { xsd:string }
+        },
+        element xslt {
+          attribute stylesheet { xsd:string }
+        }?
+      }?
+    }+
+  }