Update of /cvsroot/monetdb/pathfinder/modules/pftijah
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6612/modules/pftijah

Modified Files:
        nexi.c nexi.h nexi_generate_mil.c pftijah.mx 
Log Message:
- Change the implementation of startNodes in tijah:query[-id]()
  Because XQuery has no null values we had choosen to implement the
  'no startnodes' parameter as the empty sequence. This was not a very
  wise decision because we could not distinguish between an (unexpected?)
  empty query result and a deliberately created empty sequence.
  Because of function overloading problems we also had to change the order of
  the parameters to the functions a little bit. The <TijahOptions> parameter
  moved to the end of the argument list and the nexi query string is now the
  center parameter which always needs to be there of course. The new signature
  of the function is now:

  tijah:query[-id]([startNodes:node*,] query:string [,options:node]):[node*|int]

  The new syntax is also documented at the pftijah documentation page @:

  http://dbappl.cs.utwente.nl/pftijah/Documentation/GettingStarted



Index: nexi_generate_mil.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi_generate_mil.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- nexi_generate_mil.c 1 Mar 2007 11:26:30 -0000       1.26
+++ nexi_generate_mil.c 4 Apr 2007 13:52:05 -0000       1.27
@@ -156,7 +156,7 @@
 
 }
 
-int SRA_to_MIL(TijahParserContext* parserCtx, int query_num, struct_RMT 
*txt_retr_model, struct_RMI *img_retr_model, struct_RF *rel_feedback, char 
*mil_fname, char *sxqxl_fname, command_tree **p_command_array, bool phrase_in)
+int SRA_to_MIL(TijahParserContext* parserCtx, int query_num, int 
use_startNodes, struct_RMT *txt_retr_model, struct_RMI *img_retr_model, 
struct_RF *rel_feedback, char *mil_fname, char *sxqxl_fname, command_tree 
**p_command_array, bool phrase_in)
 {
   (void)rel_feedback;
   (void)mil_fname;
@@ -300,7 +300,11 @@
         if (p_com->left == NULL && p_com->right == NULL) {
 
           if (!strcmp(p_com->argument,"\"Root\"")) {
-            MILPRINTF(MILOUT, "R%d := select_root%s(startNodes);\n", 
com_num,parserCtx->ffPfx);
+           if ( use_startNodes ) {
+              MILPRINTF(MILOUT, "R%d := 
new_select_startnodes%s(startNodes);\n", com_num,parserCtx->ffPfx);
+           } else {
+              MILPRINTF(MILOUT, "R%d := new_select_root%s();\n", 
com_num,parserCtx->ffPfx);
+           }
           }
           else {
             MILPRINTF(MILOUT, "R%d := select_node%s(%s,%s);\n", com_num, 
parserCtx->ffPfx,p_com->argument, txt_retr_model->e_class);

Index: nexi.h
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -d -r1.16 -r1.17
--- nexi.h      21 Mar 2007 07:35:28 -0000      1.16
+++ nexi.h      4 Apr 2007 13:52:05 -0000       1.17
@@ -384,4 +384,4 @@
 
 extern int COtoCPlan(int query_num, int type, struct_RMT *txt_retr_model, 
struct_RF *rel_feedback);
 int CAStoCPlan(int query_num, int type, bool rm_set);
-extern int SRA_to_MIL(TijahParserContext* parserCtx, int query_num, struct_RMT 
*txt_retr_model, struct_RMI *img_retr_model, struct_RF *rel_feedback, char 
*mil_fname, char *sxqxl_fname, command_tree **p_command_array, bool phrase_in);
+extern int SRA_to_MIL(TijahParserContext* parserCtx, int query_num, int 
use_startNodes, struct_RMT *txt_retr_model, struct_RMI *img_retr_model, 
struct_RF *rel_feedback, char *mil_fname, char *sxqxl_fname, command_tree 
**p_command_array, bool phrase_in);

Index: nexi.c
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/nexi.c,v
retrieving revision 1.55
retrieving revision 1.56
diff -u -d -r1.55 -r1.56
--- nexi.c      27 Mar 2007 14:22:24 -0000      1.55
+++ nexi.c      4 Apr 2007 13:52:05 -0000       1.56
@@ -240,8 +240,8 @@
     
     /* startup of argument options */
     /* INCOMPLETE, select_root() should distinguish between card(0) and nil */
-    MILPRINTF(MILOUT, "var startNodes := new(void,oid);\n");
     if ( use_startNodes ) {
+        MILPRINTF(MILOUT, "var startNodes := new(void,oid);\n");
         MILPRINTF(MILOUT, "if ( view_bbp_name().reverse().exist(\"%s\") ) 
{\n", startNodes_name );
         MILPRINTF(MILOUT, "  startNodes := bat(\"%s\");\n", startNodes_name);
         MILPRINTF(MILOUT, "  bat(\"%s\").persists(false);\n", startNodes_name);
@@ -609,6 +609,7 @@
     if (phrase_in == TRUE)
         plan_ret = SRA_to_MIL(parserCtx, 
                               query_num, 
+                             use_startNodes,
                               txt_retr_model, 
                               img_retr_model, 
                               rel_feedback, 
@@ -619,6 +620,7 @@
     else
         plan_ret = SRA_to_MIL(parserCtx, 
                               query_num, 
+                             use_startNodes,
                               txt_retr_model, 
                               img_retr_model, 
                               rel_feedback, 

Index: pftijah.mx
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/modules/pftijah/pftijah.mx,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -d -r1.114 -r1.115
--- pftijah.mx  4 Apr 2007 07:59:42 -0000       1.114
+++ pftijah.mx  4 Apr 2007 13:52:05 -0000       1.115
@@ -30,7 +30,7 @@
 .COMMAND run_tijah_command(str s) : bit = CMDtijah_command;
  "INCOMPLETE"
 
-.COMMAND run_tijah_query(BAT[str,str], BAT[void,oid], str q) : BAT[oid,dbl] = 
CMDtijah_query;
+.COMMAND run_tijah_query(BAT[str,str] opt, bit use_startnodes, BAT[void,oid] 
nodes, str q) : BAT[oid,dbl] = CMDtijah_query;
  "INCOMPLETE"
 
 .COMMAND tj_normalizeTerm(str, str) : str = CMDtj_normalizeTerm;
@@ -3058,15 +3058,13 @@
 
 static int nexiTmpCounter = 0;
 
-int CMDtijah_query(BAT** res, BAT* optbat, BAT* startNodes, str query) {
+int CMDtijah_query(BAT** res, BAT* optbat, bit* use_startnodes, BAT* 
startNodes, str query) {
        char* err;
        char* mil;
        char  nameBUFF[32], *startNodes_name;
-       int   use_startNodes;
 
        if (TDEBUG(1)) stream_printf(GDKout,"# CMDtijah_query: start, 
query=\"%s\".\n",query);
-       use_startNodes = BATcount(optbat); /* INCOMPLETE, redesign this */
-       if ( use_startNodes ) {
+       if ( *use_startnodes ) {
            BATmode(startNodes,PERSISTENT);
            sprintf(&nameBUFF[0],"%s%d","nexi_start",nexiTmpCounter++);
            /* make persistent, the generated script should undo this again */


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to