Permalink
Browse files

correct example names; modify results for datatype for language-tagge…

…d strings; if test w/ simple string results;
  • Loading branch information...
1 parent 6c2076c commit ba1f1a0683e04552af56c9854417e4e6b1cd25f2 james committed Apr 8, 2012
@@ -7,6 +7,7 @@
# datatype-2 : Literals with a datatype
# updated from original test case: eliminated ordering from test
# /Users/ben/repos/datagraph/tests/tests/data-r2/expr-builtin/q-datatype-2.rq
+# 20120408 modified to conform to WD-sparql11-query-20120105, which specifies a type for litreals with a language tag
#
# This is a W3C test from the DAWG test suite:
# http://www.w3.org/2001/sw/DataAccess/tests/r2#dawg-datatype-2
@@ -62,6 +63,9 @@
{
:x => RDF::URI('http://example/x2'),
},
+ {
+ :x => RDF::URI('http://example/x3'),
+ },
{
:x => RDF::URI('http://example/x4'),
},
@@ -39,7 +39,7 @@
}
end
- example "bind03 - BIND", :w3c_status => 'unapproved' do
+ example "bind03 - BIND", :w3c_status => 'approved' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -10,13 +10,13 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/construct
#
describe "W3C test" do
- context "bind" do
+ context "construct" do
before :all do
@query = IO.read(File.dirname(__FILE__) + "/constructwhere05.rq");
@data = "";
end
- example "constructwhere05", :w3c_status => 'approved' do
+ example "constructwhere05 - CONSTRUCT WHERE", :w3c_status => 'approved' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -10,13 +10,13 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/construct
#
describe "W3C test" do
- context "bind" do
+ context "construct" do
before :all do
@query = IO.read(File.dirname(__FILE__) + "/constructwhere06.rq");
@data = ""
end
- example "constructwhere06", :w3c_status => 'approved' do
+ example "constructwhere06 - CONSTRUCT WHERE", :w3c_status => 'approved' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -10,13 +10,13 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/construct
#
describe "W3C test" do
- context "bind" do
+ context "delete-insert" do
before :all do
@query = IO.read(File.dirname(__FILE__) + "/delete-insert-03.ru");
@data = "";
end
- example "delete-insert-03", :w3c_status => 'approved' do
+ example "DELETE INSERT 3", :w3c_status => 'approved' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -10,13 +10,13 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/construct
#
describe "W3C test" do
- context "bind" do
+ context "delete-insert" do
before :all do
@query = IO.read(File.dirname(__FILE__) + "/delete-insert-03b.ru");
@data = "";
end
- example "delete-insert-03b", :w3c_status => 'approved' do
+ example "DELETE INSERT 03b", :w3c_status => 'approved' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -0,0 +1,65 @@
+<?xml version="1.0"?>
+<sparql xmlns="http://www.w3.org/2005/sparql-results#">
+ <head>
+ <variable name="o"/>
+ <variable name="integer"/>
+ </head>
+ <results>
+ <result>
+ <binding name="o">
+ <literal>123</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal>def</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal xml:lang="fr">français</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal xml:lang="ja">日本語</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">true</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#integer">7</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal>abc</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ <result>
+ <binding name="o">
+ <literal xml:lang="en">english</literal>
+ </binding>
+ <binding name="integer">
+ <literal datatype="http://www.w3.org/2001/XMLSchema#boolean">false</literal>
+ </binding>
+ </result>
+ </results>
+</sparql>
@@ -0,0 +1,32 @@
+# coding: utf-8
+#
+require 'spec_helper'
+
+# Auto-generated by build_w3c_tests.rb
+#
+# if01
+#
+# This is a W3C test from the DAWG test suite:
+# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/bindings/
+#
+describe "W3C test" do
+ context "functions" do
+ before :all do
+ @data = IO.read(File.dirname(__FILE__) + "/data2.ttl");
+ @query = IO.read(File.dirname(__FILE__) + "/if01.rq");
+ end
+
+ example "if01", :w3c_status => 'approved', :string => 'simple' do
+
+ graphs = {}
+ graphs[:default] = { :data => @data, :format => :ttl}
+
+
+ repository = 'functions-if01'
+ expected = SPARQL::Client.parse_xml_bindings(IO.read(File.dirname(__FILE__) + "/if01-simple.srx")).map{|each| each.to_hash}
+
+ sparql_query(:graphs => graphs, :query => @query, # unordered comparison in rspec is =~
+ :repository => repository, :form => :select).should =~ expected
+ end
+ end
+end
@@ -10,13 +10,13 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/bindings/
#
describe "W3C test" do
- context "bind" do
+ context "functions" do
before :all do
@data = IO.read(File.dirname(__FILE__) + "/data2.ttl");
@query = IO.read(File.dirname(__FILE__) + "/if01.rq");
end
- example "if01", :w3c_status => 'approved' do
+ example "if01", :w3c_status => 'approved', :string => 'typed' do
graphs = {}
graphs[:default] = { :data => @data, :format => :ttl}
@@ -10,7 +10,7 @@
# http://www.w3.org/2009/sparql/docs/tests/data-sparql11/functions/
#
describe "W3C test" do
- context "bind" do
+ context "functions" do
before :all do
@data = IO.read(File.dirname(__FILE__) + "/data2.ttl");
@query = IO.read(File.dirname(__FILE__) + "/if02.rq");
@@ -11,7 +11,7 @@
#
#
describe "W3C test" do
- context "subquery" do
+ context "functions" do
before :all do
@data = IO.read(File.dirname(__FILE__) + "/data2.ttl");
@query = IO.read(File.dirname(__FILE__) + "/strafter01.rq");
@@ -11,7 +11,7 @@
#
#
describe "W3C test" do
- context "subquery" do
+ context "functions" do
before :all do
@data = IO.read(File.dirname(__FILE__) + "/data2.ttl");
@query = IO.read(File.dirname(__FILE__) + "/strbefore01.rq");

0 comments on commit ba1f1a0

Please sign in to comment.