Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/mp-sparql
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Feb 2015 13:23:09 +0000 (14:23 +0100)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 17 Feb 2015 13:23:09 +0000 (14:23 +0100)
doc/filter_sparql.rnc
doc/sparql.xml
src/sparql.c

index 4e71e8c..3a97465 100644 (file)
@@ -16,6 +16,7 @@ filter_sparql =
     element mp:index {
       attribute type { xsd:string },
       xsd:string
-    }*
+    }*,
+    element mp:modifier { xsd:string }*
   }+
 
index ba4eca7..e23b149 100644 (file)
       </para>
      </listitem>
     </varlistentry>
+    <varlistentry><term>&lt;modifier/&gt;</term>
+     <listitem>
+      <para>
+       Optional section that allows you to add solution sequences or
+       modifiers.
+      </para>
+     </listitem>
+    </varlistentry>
+
    </variablelist>
   </para>
  </refsect1>
index fbd8c91..55b02e1 100644 (file)
@@ -326,21 +326,23 @@ int yaz_sparql_from_rpn_stream(yaz_sparql_t s,
         {
             ;
         }
+        else if (!strcmp(e->pattern, "modifier"))
+        {
+            ;
+        }
         else
         {
             errors++;
         }
     }
-    pr("\n", client_data);
     for (e = s->conf; e; e = e->next)
     {
         if (!strcmp(e->pattern, "form"))
         {
-            pr(" ", client_data);
             pr(e->value, client_data);
+            pr("\n", client_data);
         }
     }
-    pr("\n", client_data);
     pr("WHERE {\n", client_data);
     for (e = s->conf; e; e = e->next)
     {
@@ -397,6 +399,15 @@ int yaz_sparql_from_rpn_stream(yaz_sparql_t s,
         wrbuf_destroy(vars);
     }
     pr("\n}\n", client_data);
+
+    for (e = s->conf; e; e = e->next)
+    {
+        if (!strcmp(e->pattern, "modifier"))
+        {
+            pr(e->value, client_data);
+            pr(e->value, "\n");
+        }
+    }
     yaz_tok_cfg_destroy(cfg);
 
     return errors ? -1 : r;