projects
/
mp-sparql-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Version 0.7
[mp-sparql-moved-to-github.git]
/
src
/
test_sparql.c
diff --git
a/src/test_sparql.c
b/src/test_sparql.c
index
4bd27a0
..
963667f
100644
(file)
--- a/
src/test_sparql.c
+++ b/
src/test_sparql.c
@@
-151,6
+151,7
@@
static void tst1(void)
yaz_sparql_add_pattern(s, "index.bf.isbn", "?inst bf:ISBN %s");
yaz_sparql_add_pattern(s, "uri.full", "SELECT ?sub ?rel WHERE ?work = %u");
yaz_sparql_add_pattern(s, "index.bf.isbn", "?inst bf:ISBN %s");
yaz_sparql_add_pattern(s, "uri.full", "SELECT ?sub ?rel WHERE ?work = %u");
+ yaz_sparql_add_pattern(s, "present.brief", "SELECT %u");
YAZ_CHECK(test_uri(s, "http://x/y", "full",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
YAZ_CHECK(test_uri(s, "http://x/y", "full",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
@@
-158,6
+159,13
@@
static void tst1(void)
"PREFIX gs: <http://gs.com/panorama/domain-model>\n"
"SELECT ?sub ?rel WHERE ?work = <http://x/y>\n"));
"PREFIX gs: <http://gs.com/panorama/domain-model>\n"
"SELECT ?sub ?rel WHERE ?work = <http://x/y>\n"));
+
+ YAZ_CHECK(test_uri(s, "http://x/z", "brief",
+ "PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
+ "PREFIX bf: <http://bibframe.org/vocab/>\n"
+ "PREFIX gs: <http://gs.com/panorama/domain-model>\n"
+ "SELECT <http://x/z>\n"));
+
YAZ_CHECK(test_query(
s, "@attr 1=bf.title computer",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
YAZ_CHECK(test_query(
s, "@attr 1=bf.title computer",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
@@
-364,6
+372,7
@@
static void tst1(void)
static void tst2(void)
{
yaz_sparql_t s = yaz_sparql_create();
static void tst2(void)
{
yaz_sparql_t s = yaz_sparql_create();
+ yaz_sparql_t s2 = yaz_sparql_create();
yaz_sparql_add_pattern(s, "prefix",
"rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns");
yaz_sparql_add_pattern(s, "prefix",
"rdf: http://www.w3.org/1999/02/22-rdf-syntax-ns");
@@
-437,10
+446,14
@@
static void tst2(void)
" OPTIONAL { ?inst bf:heldBy ?lib } .\n"
" ?work bf:creator/bf:label ?v0 "
"FILTER(contains(?v0, \"london\"))\n"
" OPTIONAL { ?inst bf:heldBy ?lib } .\n"
" ?work bf:creator/bf:label ?v0 "
"FILTER(contains(?v0, \"london\"))\n"
+
+
"}\n"));
"}\n"));
+ yaz_sparql_include(s2, s);
+
YAZ_CHECK(test_query(
YAZ_CHECK(test_query(
- s, "@or @and @attr 1=bf.creator a @attr 1=bf.title b @attr 1=bf.title c",
+ s2, "@or @and @attr 1=bf.creator a @attr 1=bf.title b @attr 1=bf.title c",
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
"PREFIX bf: <http://bibframe.org/vocab/>\n"
"PREFIX gs: <http://gs.com/panorama/domain-model>\n"
"PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns>\n"
"PREFIX bf: <http://bibframe.org/vocab/>\n"
"PREFIX gs: <http://gs.com/panorama/domain-model>\n"
@@
-465,6
+478,7
@@
static void tst2(void)
"}\n"
));
"}\n"
));
+ yaz_sparql_destroy(s2);
yaz_sparql_destroy(s);
}
yaz_sparql_destroy(s);
}