Skip to content

Commit

Permalink
Finish 3.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Jul 23, 2023
2 parents 716a3f5 + df81715 commit 6c77437
Show file tree
Hide file tree
Showing 11 changed files with 7,136 additions and 9,223 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
- name: Run tests
run: ruby --version; bundle exec rspec spec || $ALLOW_FAILURES
- name: Coveralls GitHub Action
uses: coverallsapp/github-action@v1.1.2
uses: coverallsapp/github-action@v2
if: "matrix.ruby == '3.0'"
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

An implementation of [SPARQL][] for [RDF.rb][].

[![Gem Version](https://badge.fury.io/rb/sparql.png)](https://badge.fury.io/rb/sparql)
[![Gem Version](https://badge.fury.io/rb/sparql.svg)](https://badge.fury.io/rb/sparql)
[![Build Status](https://github.com/ruby-rdf/sparql/workflows/CI/badge.svg?branch=develop)](https://github.com/ruby-rdf/sparql/actions?query=workflow%3ACI)
[![Coverage Status](https://coveralls.io/repos/ruby-rdf/sparql/badge.svg?branch=develop)](https://coveralls.io/r/ruby-rdf/sparql?branch=develop)
[![Gitter chat](https://badges.gitter.im/ruby-rdf/rdf.png)](https://gitter.im/ruby-rdf/rdf)
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ file "etc/manifest-cache.nt" do
require 'rdf/ntriples'
graph = RDF::Graph.new do |g|
{
"http://w3c.github.io/rdf-tests/sparql11/" => "../w3c-rdf-tests/sparql11/",
"http://w3c.github.io/rdf-tests/sparql/" => "../w3c-rdf-tests/sparql/",
"https://w3c.github.io/rdf-star/tests/sparql/" => "../w3c-rdf-star/tests/sparql/",
"https://w3c.github.io/sparql-12/tests/" => "spec/w3c-sparql-12/tests/"
}.each do |base, path|
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.2.5
3.2.6
16,291 changes: 7,094 additions & 9,197 deletions etc/manifest-cache.nt

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions lib/sparql/algebra/operator/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ class Operator
# @example SSE (HAVING aggregate)
# (prefix ((: <http://www.example.org/>))
# (project (?s ?avg)
# (filter (<= ??.0 2.0)
# (filter (<= ??.1 2.0)
# (extend ((?avg ??.0))
# (group (?s) ((??.0 (avg ?o)))
# (bgp (triple ?s ?p ?o)))))) )
# (group (?s) ((??.0 (avg ?o)) (??.1 (avg ?o)))
# (bgp (triple ?s ?p ?o)))))))
#
# @example SPARQL Grammar (non-trivial filters)
# PREFIX : <http://example.com/data/#>
Expand Down
4 changes: 2 additions & 2 deletions lib/sparql/grammar/parser11.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1610,7 +1610,7 @@ class Parser
if data[:_Compare_Numeric]
add_prod_datum(:Expression, SPARQL::Algebra::Expression.for(data[:_Compare_Numeric].insert(1, *data[:Expression])))
elsif data[:in]
expr = (data[:Expression] + data[:in]).reject {|v| v.equal?(RDF.nil)}
expr = (data[:Expression] + data[:in]).reject {|v| v.eql?(RDF.nil)}
add_prod_datum(:Expression, SPARQL::Algebra::Expression.for(expr.unshift(:in)))
elsif data[:notin]
expr = (data[:Expression] + data[:notin]).reject {|v| v.equal?(RDF.nil)}
Expand Down Expand Up @@ -2452,7 +2452,7 @@ def merge_modifiers(data)

# Replace aggregates in expr as above
expr.replace_aggregate! do |function|
if avf = aggregates.detect {|(_, f)| f == function}
if avf = aggregates.detect {|(_, f)| f.equal?(function)}
avf.first
else
# Allocate a temporary variable for this function, and retain the mapping for outside the group
Expand Down
20 changes: 10 additions & 10 deletions sparql.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ Gem::Specification.new do |gem|

gem.required_ruby_version = '>= 2.6'
gem.requirements = []
gem.add_runtime_dependency 'rdf', '~> 3.2', '>= 3.2.8'
gem.add_runtime_dependency 'rdf-aggregate-repo', '~> 3.2'
gem.add_runtime_dependency 'ebnf', '~> 2.2', '>= 2.3.1'
gem.add_runtime_dependency 'builder', '~> 3.2'
gem.add_runtime_dependency 'rdf', '~> 3.2', '>= 3.2.11'
gem.add_runtime_dependency 'rdf-aggregate-repo', '~> 3.2', '>= 3.2.1'
gem.add_runtime_dependency 'ebnf', '~> 2.3', '>= 2.3.5'
gem.add_runtime_dependency 'builder', '~> 3.2', '>= 3.2.4'
gem.add_runtime_dependency 'logger', '~> 1.5'
gem.add_runtime_dependency 'sxp', '~> 1.2', '>= 1.2.2'
gem.add_runtime_dependency 'sparql-client', '~> 3.2', '>= 3.2.1'
gem.add_runtime_dependency 'sxp', '~> 1.2', '>= 1.2.4'
gem.add_runtime_dependency 'sparql-client', '~> 3.2', '>= 3.2.2'
gem.add_runtime_dependency 'rdf-xsd', '~> 3.2'

gem.add_development_dependency 'sinatra', '~> 2.2'
gem.add_development_dependency 'rack', '~> 2.2'
gem.add_development_dependency 'rack-test', '~> 1.1'
gem.add_development_dependency 'sinatra', '~> 3.0', '>= 3.0.5'
gem.add_development_dependency 'rack', '>= 2.2', '< 4'
gem.add_development_dependency 'rack-test', '~> 2.1'
gem.add_development_dependency 'rdf-spec', '~> 3.2'
gem.add_development_dependency 'linkeddata', '~> 3.2'
gem.add_development_dependency 'rspec', '~> 3.11'
gem.add_development_dependency 'rspec', '~> 3.12'
gem.add_development_dependency 'rspec-its', '~> 1.3'
gem.add_development_dependency 'yard' , '~> 0.9'

Expand Down
16 changes: 16 additions & 0 deletions spec/grammar/misc_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@
(bgp (triple ??0 <http://example/c> <http://example/d>))
)}
},
"issue 46" => {
query: %(
PREFIX ex: <http://example.org/>
SELECT ?ev (MIN(?a) as ?a_min) (MIN(?b) as ?b_min)
WHERE {?ev ex:a ?a ; ex:b ?b . }
GROUP BY ?ev
),
sse: %{(project (?ev ?a_min ?b_min)
(extend ((?a_min ??.0) (?b_min ??.1))
(group (?ev) ((??.0 (min ?a)) (??.1 (min ?b)))
(bgp
(triple ?ev <http://example.org/a> ?a)
(triple ?ev <http://example.org/b> ?b)))))
}
}
}.each do |test, options|
it "parses #{test}" do
expect(options[:query]).to generate(options[:sse], logger: logger)
Expand Down
12 changes: 6 additions & 6 deletions spec/suite_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
# For now, override RDF::Utils::File.open_file to look for the file locally before attempting to retrieve it
module RDF::Util
module File
REMOTE_PATH = "http://w3c.github.io/rdf-tests/sparql11/"
LOCAL_PATH = ::File.expand_path("../w3c-rdf-tests/sparql11", __FILE__) + '/'
REMOTE_PATH = "http://w3c.github.io/rdf-tests/sparql/"
LOCAL_PATH = ::File.expand_path("../w3c-rdf-tests/sparql/", __FILE__) + '/'
REMOTE_PATH_STAR = "https://w3c.github.io/rdf-star/"
LOCAL_PATH_STAR = ::File.expand_path("../w3c-rdf-star/", __FILE__) + '/'
REMOTE_PATH_12 = "https://w3c.github.io/sparql-12/"
Expand Down Expand Up @@ -172,7 +172,7 @@ def self.open_file(filename_or_url, **options, &block)
end

module SPARQL::Spec
BASE = "http://w3c.github.io/rdf-tests/sparql11/"
BASE = "http://w3c.github.io/rdf-tests/sparql/"
def self.sparql1_0_syntax_tests
%w(
syntax-sparql1
Expand All @@ -181,7 +181,7 @@ def self.sparql1_0_syntax_tests
syntax-sparql4
syntax-sparql5
).map do |partial|
"#{BASE}data-r2/#{partial}/manifest.ttl"
"#{BASE}sparql10/#{partial}/manifest.ttl"
end
end

Expand Down Expand Up @@ -212,7 +212,7 @@ def self.sparql1_0_tests
triple-match
type-promotion
).map do |partial|
"#{BASE}data-r2/#{partial}/manifest.ttl"
"#{BASE}sparql10/#{partial}/manifest.ttl"
end
end

Expand Down Expand Up @@ -253,7 +253,7 @@ def self.sparql1_1_tests
protocol
http-rdf-update
).map do |partial|
"#{BASE}data-sparql11/#{partial}/manifest.ttl"
"#{BASE}sparql11/#{partial}/manifest.ttl"
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/suite_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
end

describe SPARQL do
BASE = "http://w3c.github.io/rdf-tests/sparql11/"
BASE = "http://w3c.github.io/rdf-tests/sparql/sparql11/"
describe "w3c dawg SPARQL 1.0 syntax tests" do
SPARQL::Spec.sparql1_0_syntax_tests.each do |path|
SPARQL::Spec::Manifest.open(path) do |man|
Expand Down

0 comments on commit 6c77437

Please sign in to comment.