Egon,

The fix will appear in the next release. Meanwhile you may use the
attached patch, it should be applicable to all recent versions of v5 and
v6 (with some line offset).

Sorry for inconvenience,

Ivan Mikhailov
OpenLink Software
http://virtuoso.openlinksw.com

On Mon, 2010-02-08 at 12:08 +0100, Egon Willighagen wrote:
> Hi all,
> 
> I have installed Virtuoso 6.1 on a machine here in Uppsala [0], and
> SNORQL from [1]. However, SNORQL defaults to this query for
> individuals:
> 
> SELECT DISTINCT ?property ?hasValue ?isValueOf
> WHERE {
>   { <http://rdf.farmbio.uu.se/chembl/target/t102383> ?property ?hasValue }
>   UNION
>   { ?isValueOf ?property <http://rdf.farmbio.uu.se/chembl/target/t102383> }
> }
> ORDER BY (!BOUND(?hasValue)) ?property ?hasValue ?isValueOf
> 
> which gives me this error:
> 
> 37000 Error SP031: SPARQL: Internal error:
> ssg_print_retval_simple_expn(): unsupported type of retval expression
> 
> However, when I change the SPARQL to:
> 
> SELECT DISTINCT ?property ?hasValue ?isValueOf
> WHERE {
>   { <http://rdf.farmbio.uu.se/chembl/target/t102383> ?property ?hasValue }
>   UNION
>   { ?isValueOf ?property <http://rdf.farmbio.uu.se/chembl/target/t102383> }
> }
> ORDER BY ?property ?hasValue ?isValueOf
> 
> it runs fine...
> 
> I have seen the BOUND use working fine at this SPARQL end point:
> 
> http://www4.wiwiss.fu-berlin.de/drugbank/snorql/?describe=http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugs/DB00001
> 
> but that is running a D2R server...
> 
> I have updated the SPARQL in the local SNORQL installation, but would
> like to know if this is a bug in Virtuoso, or a bad SPARQL...
> 
> Looking forward to hearing from you,
> 
> Egon Willighagen
> 
> 0.http://rdf.farmbio.uu.se/chembl/snorql/
> 1.http://github.com/kurtjx/SNORQL
> 
Index: sparql2sqltext.c
===================================================================
RCS file: /home/staff/us-cvs/virtuoso/libsrc/Wi/sparql2sqltext.c,v
retrieving revision 1.47.2.78
diff -u -U 10 -r1.47.2.78 sparql2sqltext.c
--- sparql2sqltext.c	3 Feb 2010 10:03:38 -0000	1.47.2.78
+++ sparql2sqltext.c	8 Feb 2010 17:20:26 -0000
@@ -5778,23 +5778,20 @@
         int printed = ssg_print_equiv_retval_expn (ssg, gp, eq, SSG_RETVAL_FROM_JOIN_MEMBER | SSG_RETVAL_MUST_PRINT_SOMETHING, needed, asname);
         if (! printed)
           {
 #ifdef DEBUG
             ssg_print_equiv_retval_expn (ssg, gp, eq, SSG_RETVAL_FROM_JOIN_MEMBER | SSG_RETVAL_MUST_PRINT_SOMETHING, needed, asname);
 #endif
             spar_sqlprint_error ("ssg_print_retval_simple_expn(): can't print variable in retval expn");
           }
         return;
       }
-    case SPAR_BUILT_IN_CALL:
-      ssg_print_scalar_expn (ssg, tree, needed, asname);
-      return;
     case SPAR_FUNCALL:
       {
         int bigtext, arg_ctr, arg_count = BOX_ELEMENTS (tree->_.funcall.argtrees);
         xqf_str_parser_desc_t *parser_desc;
 	ssg_valmode_t native = sparp_rettype_of_function (ssg->ssg_sparp, tree->_.funcall.qname);
         if ((SSG_VALMODE_SHORT_OR_LONG == needed) && (SSG_VALMODE_LONG == native))
           needed = SSG_VALMODE_LONG;
         if (needed != native)
           {
             if (((SSG_VALMODE_LONG == needed) || (SSG_VALMODE_SHORT_OR_LONG == needed)) && (SSG_VALMODE_SQLVAL == native))
@@ -5872,20 +5869,22 @@
                 ssg_print_retval_simple_expn (ssg, gp, arg, arg_native,
                  ((IS_BOX_POINTER (arg_native)) && (1 < arg_native->qmfColumnCount)) ? COL_IDX_ASNAME : NULL_ASNAME );
               }
             else
               ssg_print_retval_simple_expn (ssg, gp, arg, argtype, NULL_ASNAME);
           }
         ssg->ssg_indent--;
         ssg_putchar (')');
         goto print_asname;
       }
+    case BOP_NOT:
+    case SPAR_BUILT_IN_CALL:
     case SPAR_LIT: case SPAR_QNAME:/* case SPAR_QNAME_NS:*/
     case SPAR_GP:
       ssg_print_scalar_expn (ssg, tree, needed, asname);
       return;
     default:
       break;
   }
   spar_sqlprint_error ("ssg_print_retval_simple_expn(): unsupported type of retval expression");
 print_asname:
   if (IS_BOX_POINTER (asname))

Reply via email to