[tracker/wip/carlosg/sparql1.1: 190/201] tests: Add tests around DATATYPE()/IS*() functions



commit d6e412bedc3349eb6ee2f6e454b688cf3a75de8b
Author: Carlos Garnacho <carlosg gnome org>
Date:   Sun Jul 21 13:52:10 2019 +0200

    tests: Add tests around DATATYPE()/IS*() functions

 .../functions/functions-datatypes-1.out            | 27 +++++++++++
 .../functions/functions-datatypes-1.rq             |  3 ++
 .../functions/functions-datatypes-2.out            | 10 +++++
 .../functions/functions-datatypes-2.rq             |  3 ++
 .../functions/functions-datatypes-3.out            | 20 +++++++++
 .../functions/functions-datatypes-3.rq             |  3 ++
 .../functions/functions-datatypes-4.out            | 52 ++++++++++++++++++++++
 .../functions/functions-datatypes-4.rq             |  3 ++
 tests/libtracker-data/tracker-sparql-test.c        |  4 ++
 9 files changed, 125 insertions(+)
---
diff --git a/tests/libtracker-data/functions/functions-datatypes-1.out 
b/tests/libtracker-data/functions/functions-datatypes-1.out
new file mode 100644
index 000000000..b10f3540c
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-1.out
@@ -0,0 +1,27 @@
+"http://example/e";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/e";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/e";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/q";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/q";     "http://example/t";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/q";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/q";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/r";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/r";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/w";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/w";     "http://example/t";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/w";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/w";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/x";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://example/t";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://example/u";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/y";     "http://example/t";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://example/s";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/z";     "http://example/t";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/z";     "http://example/u";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
diff --git a/tests/libtracker-data/functions/functions-datatypes-1.rq 
b/tests/libtracker-data/functions/functions-datatypes-1.rq
new file mode 100644
index 000000000..5cce80f4f
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-1.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT ?s ?p ISLITERAL(?o) ISURI(?o) ISIRI(?o) ISNUMERIC(?o) ISBLANK(?o) DATATYPE(?o) { ?s a :A ; ?p ?o } 
ORDER BY ?s ?p
diff --git a/tests/libtracker-data/functions/functions-datatypes-2.out 
b/tests/libtracker-data/functions/functions-datatypes-2.out
new file mode 100644
index 000000000..8075bd9e2
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-2.out
@@ -0,0 +1,10 @@
+"http://example/x";     "http://example/filename";       "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://example/title";  "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://example/filename";       "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://example/filename";       "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
diff --git a/tests/libtracker-data/functions/functions-datatypes-2.rq 
b/tests/libtracker-data/functions/functions-datatypes-2.rq
new file mode 100644
index 000000000..5cce80f4f
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-2.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT ?s ?p ISLITERAL(?o) ISURI(?o) ISIRI(?o) ISNUMERIC(?o) ISBLANK(?o) DATATYPE(?o) { ?s a :A ; ?p ?o } 
ORDER BY ?s ?p
diff --git a/tests/libtracker-data/functions/functions-datatypes-3.out 
b/tests/libtracker-data/functions/functions-datatypes-3.out
new file mode 100644
index 000000000..11d758678
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-3.out
@@ -0,0 +1,20 @@
+"http://example/c";     "http://example/latitude";       "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/c";     "http://example/longitude";      "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/c";     "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/c";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/c";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/x";     "http://example/latitude";       "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/x";     "http://example/longitude";      "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/x";     "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/x";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://example/latitude";       "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/y";     "http://example/longitude";      "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/y";     "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/y";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://example/latitude";       "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/z";     "http://example/longitude";      "true"  "false" "false" "true"          
"http://www.w3.org/2001/XMLSchema#double";
+"http://example/z";     "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/z";     "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
diff --git a/tests/libtracker-data/functions/functions-datatypes-3.rq 
b/tests/libtracker-data/functions/functions-datatypes-3.rq
new file mode 100644
index 000000000..5706bab94
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-3.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT ?s ?p ISLITERAL(?o) ISURI(?o) ISIRI(?o) ISNUMERIC(?o) ISBLANK(?o) DATATYPE(?o) { ?s a :Location ; ?p 
?o } ORDER BY ?s ?p
diff --git a/tests/libtracker-data/functions/functions-datatypes-4.out 
b/tests/libtracker-data/functions/functions-datatypes-4.out
new file mode 100644
index 000000000..761d9bb4b
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-4.out
@@ -0,0 +1,52 @@
+"http://example/p1";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p1";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p1";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p1";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p1";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p10";   "http://example/description";    "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p10";   "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p10";   "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p10";   "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p10";   "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p10";   "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p2";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p2";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p2";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p2";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p2";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p3";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p3";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p3";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p3";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p3";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p4";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p4";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p4";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p4";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p4";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p5";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p5";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p5";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p5";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p5";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p6";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p6";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p6";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p6";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p6";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p7";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p7";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p7";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p7";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p7";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p8";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p8";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p8";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p8";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p8";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p9";    "http://example/description";    "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p9";    "http://example/familyName";     "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p9";    "http://example/givenName";      "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p9";    "http://example/name";   "true"  "false" "false" "false"         
"http://www.w3.org/2001/XMLSchema#string";
+"http://example/p9";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
+"http://example/p9";    "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";       "false" "true"  "true"  
"false"         
diff --git a/tests/libtracker-data/functions/functions-datatypes-4.rq 
b/tests/libtracker-data/functions/functions-datatypes-4.rq
new file mode 100644
index 000000000..064bf1e52
--- /dev/null
+++ b/tests/libtracker-data/functions/functions-datatypes-4.rq
@@ -0,0 +1,3 @@
+PREFIX : <http://example/>
+
+SELECT ?s ?p ISLITERAL(?o) ISURI(?o) ISIRI(?o) ISNUMERIC(?o) ISBLANK(?o) DATATYPE(?o) { ?s a :Person ; ?p ?o 
} ORDER BY ?s ?p
diff --git a/tests/libtracker-data/tracker-sparql-test.c b/tests/libtracker-data/tracker-sparql-test.c
index fb75ae67a..d7f28d31a 100644
--- a/tests/libtracker-data/tracker-sparql-test.c
+++ b/tests/libtracker-data/tracker-sparql-test.c
@@ -124,6 +124,10 @@ const TestInfo tests[] = {
        { "functions/functions-xpath-13", "functions/data-4", FALSE },
        { "functions/functions-xpath-14", "functions/data-4", FALSE },
        { "functions/functions-coalesce-1", "functions/data-1", FALSE },
+       { "functions/functions-datatypes-1", "functions/data-1", FALSE },
+       { "functions/functions-datatypes-2", "functions/data-2", FALSE },
+       { "functions/functions-datatypes-3", "functions/data-3", FALSE },
+       { "functions/functions-datatypes-4", "functions/data-4", FALSE },
        /* Graph semantics and operations */
        { "graph/graph-1", "graph/data-1", FALSE },
        { "graph/graph-2", "graph/data-2", FALSE },


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]