|
242 | 242 |
|
243 | 243 | it "returns the correct number of results for hash queries" do |
244 | 244 | expect(subject.query({}).size).to eq @rdf_queryable_iv_statements.size |
245 | | - expect(subject.query(subject: resource).size).to eq File.readlines(@rdf_queryable_iv_doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size |
246 | | - expect(subject.query(subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name")).size).to eq 1 |
247 | | - expect(subject.query(object: RDF::URI("http://usefulinc.com/ns/doap#Project")).size).to eq 1 |
| 245 | + expect(subject.query({subject: resource}).size).to eq File.readlines(@rdf_queryable_iv_doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size |
| 246 | + expect(subject.query({subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name")}).size).to eq 1 |
| 247 | + expect(subject.query({object: RDF::URI("http://usefulinc.com/ns/doap#Project")}).size).to eq 1 |
248 | 248 | end |
249 | 249 |
|
250 | 250 | it "returns the correct number of results for query queries" do |
|
256 | 256 | context "with specific patterns from SPARQL" do |
257 | 257 | context "triple pattern combinations" do |
258 | 258 | it "?s p o" do |
259 | | - expect(subject.query(predicate: RDF::URI("http://example.org/p"), object: RDF::Literal.new(1)).to_a).to( |
| 259 | + expect(subject.query({predicate: RDF::URI("http://example.org/p"), object: RDF::Literal.new(1)}).to_a).to( |
260 | 260 | include *[RDF::Statement.new(RDF::URI("http://example.org/xi1"), RDF::URI("http://example.org/p"), 1), RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)] |
261 | 261 | ) |
262 | 262 | end |
263 | 263 |
|
264 | 264 | it "s ?p o" do |
265 | | - expect(subject.query(subject: RDF::URI("http://example.org/xi2"), object: RDF::Literal.new(1)).to_a).to( |
| 265 | + expect(subject.query({subject: RDF::URI("http://example.org/xi2"), object: RDF::Literal.new(1)}).to_a).to( |
266 | 266 | include *[RDF::Statement.new(RDF::URI("http://example.org/xi2"), RDF::URI("http://example.org/p"), 1)] |
267 | 267 | ) |
268 | 268 | end |
|
272 | 272 | context "data/r2/expr-equals" do |
273 | 273 | context "graph-1" do |
274 | 274 | let(:result) do |
275 | | - queryable.query(predicate: RDF::URI("http://example.org/p"), |
276 | | - object: RDF::Literal::Integer.new(1)).to_a |
| 275 | + queryable.query({predicate: RDF::URI("http://example.org/p"), |
| 276 | + object: RDF::Literal::Integer.new(1)}).to_a |
277 | 277 | end |
278 | 278 |
|
279 | 279 | it 'has two solutions' do |
|
293 | 293 |
|
294 | 294 | context "graph-2" do |
295 | 295 | let(:result) do |
296 | | - queryable.query(predicate: RDF::URI("http://example.org/p"), |
297 | | - object: RDF::Literal::Double.new("1.0e0")) |
| 296 | + queryable.query({predicate: RDF::URI("http://example.org/p"), |
| 297 | + object: RDF::Literal::Double.new("1.0e0")}) |
298 | 298 | .to_a |
299 | 299 | end |
300 | 300 |
|
|
0 commit comments