From 2c6675919ac9cc370710bb65688f105122ee4bd1 Mon Sep 17 00:00:00 2001 From: msalvadores Date: Sun, 4 Mar 2012 22:06:56 -0800 Subject: [PATCH] functional test for group with join combination that makes binding _ord to be empty in results.c --- data/group-by.ttl | 50 +++++++++++++++++++++++++++++ tests/httpd/exemplar/groupby-multiple-joins | 21 ++++++++++++ tests/httpd/scripts/groupby-multiple-joins | 21 ++++++++++++ 3 files changed, 92 insertions(+) create mode 100644 data/group-by.ttl create mode 100644 tests/httpd/exemplar/groupby-multiple-joins create mode 100755 tests/httpd/scripts/groupby-multiple-joins diff --git a/data/group-by.ttl b/data/group-by.ttl new file mode 100644 index 0000000..d81fdd4 --- /dev/null +++ b/data/group-by.ttl @@ -0,0 +1,50 @@ +@prefix rdfs: . +@prefix skos: . +@prefix owl: . +@prefix rdf: . + + a . + a . + a . + a . + a . + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 1"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 11"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 12"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 13"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 2"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 21"; +. + + a owl:Class; + rdfs:subClassOf ; + skos:prefLabel "class 3"; +. + + a owl:Class; + skos:prefLabel "class 0"; +. + diff --git a/tests/httpd/exemplar/groupby-multiple-joins b/tests/httpd/exemplar/groupby-multiple-joins new file mode 100644 index 0000000..cb9a668 --- /dev/null +++ b/tests/httpd/exemplar/groupby-multiple-joins @@ -0,0 +1,21 @@ +201 imported successfully +This is a 4store SPARQL server [VERSION] +Query: +PREFIX owl: +PREFIX rdfs: +PREFIX xsd: + +SELECT DISTINCT ?child (COUNT(?sub_child) as ?c) +FROM +WHERE { + ?child a owl:Class . + ?child rdfs:subClassOf . + OPTIONAL { ?sub_child rdfs:subClassOf ?child . } +} GROUP BY ?child ORDER BY ASC(xsd:integer(?c)) + +?child ?c + 0 + 1 + 3 +200 deleted successfully +This is a 4store SPARQL server [VERSION] diff --git a/tests/httpd/scripts/groupby-multiple-joins b/tests/httpd/scripts/groupby-multiple-joins new file mode 100755 index 0000000..73620c4 --- /dev/null +++ b/tests/httpd/scripts/groupby-multiple-joins @@ -0,0 +1,21 @@ +#!/bin/bash + +source sparql.sh + +put "$EPR" ../../data/group-by.ttl 'text/turtle' 'http://example.com/group-by.ttl' + +sparql "$EPR" ' +PREFIX owl: +PREFIX rdfs: +PREFIX xsd: + +SELECT DISTINCT ?child (COUNT(?sub_child) as ?c) +FROM +WHERE { + ?child a owl:Class . + ?child rdfs:subClassOf . + OPTIONAL { ?sub_child rdfs:subClassOf ?child . } +} GROUP BY ?child ORDER BY ASC(xsd:integer(?c)) +' + +delete "$EPR" 'http://example.com/group-by.ttl'