%u variable: for <urls> MPSPARQL-12
authorAdam Dickmeiss <adam@indexdata.dk>
Tue, 28 Apr 2015 11:49:53 +0000 (13:49 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Tue, 28 Apr 2015 11:49:53 +0000 (13:49 +0200)
src/sparql.c

index 3744fe6..d146458 100644 (file)
@@ -183,6 +183,23 @@ static int apt(yaz_sparql_t s, WRBUF addinfo, WRBUF res, WRBUF vars,
                 }
                 wrbuf_puts(addinfo, "\"");
                 break;
+            case 'u':
+                wrbuf_puts(addinfo, "<");
+                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;
+                }
+                wrbuf_puts(addinfo, ">");
+                break;
             case 'd':
                 switch (term->which)
                 {