MPSPARQL-21: Add %t for unquoted expansion
authorHeikki Levanto <heikki@indexdata.dk>
Fri, 8 May 2015 12:14:41 +0000 (14:14 +0200)
committerHeikki Levanto <heikki@indexdata.dk>
Fri, 8 May 2015 12:14:41 +0000 (14:14 +0200)
src/sparql.c

index c738e5d..0f38d57 100644 (file)
@@ -165,6 +165,21 @@ static int z_term(yaz_sparql_t s, WRBUF addinfo, WRBUF res, WRBUF vars,
                 }
                 wrbuf_puts(addinfo, ">");
                 break;
+            case 't':
+                switch (term->which)
+                {
+                case Z_Term_general:
+                    wrbuf_json_write(addinfo,
+                                term->u.general->buf, term->u.general->len);
+                    break;
+                case Z_Term_numeric:
+                    wrbuf_printf(addinfo, ODR_INT_PRINTF, *term->u.numeric);
+                    break;
+                case Z_Term_characterString:
+                    wrbuf_json_puts(addinfo, term->u.characterString);
+                    break;
+                }
+                break;
             case 'd':
                 switch (term->which)
                 {