Skip to content

Commit

Permalink
Finish 3.1.3
Browse files Browse the repository at this point in the history
  • Loading branch information
gkellogg committed Oct 17, 2020
2 parents 43544a3 + 2ea665b commit c5e7b57
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 25 deletions.
19 changes: 19 additions & 0 deletions .github/workflows/gitstamp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# See: https://github.com/artob/gitstamp-action
---
name: Gitstamp
on:
push:
branches:
- develop
jobs:
gitstamp:
runs-on: ubuntu-latest
name: Timestamp commit with Gitstamp
steps:
- name: Clone repository
uses: actions/checkout@v2
- name: Submit Gitstamp transaction
uses: artob/gitstamp-action@v1
with:
wallet-key: ${{ secrets.GITSTAMP_KEYFILE }}
commit-link: true
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.2
3.1.3
2 changes: 1 addition & 1 deletion lib/sinatra/sparql.rb
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ def self.registered(app)
app.helpers(Sinatra::SPARQL::Helpers)
app.send(:include, ::SPARQL)
app.send(:include, ::RDF)
app.send(:include, ::LinkedData)
app.send(:include, ::LinkedData) if defined?(::LinkedData)
end
end
end
Expand Down
2 changes: 2 additions & 0 deletions lib/sparql.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
require 'sxp'
require 'sparql/extensions'
require 'sparql/algebra/sxp_extensions'

##
# A SPARQL for RDF.rb.
Expand Down
8 changes: 4 additions & 4 deletions lib/sparql/algebra.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,15 @@ module SPARQL
#
# Operator(:isBlank).new(RDF::Node(:foobar)).to_sxp #=> "(isBlank _:foobar)"
# Operator(:isIRI).new(RDF::URI('https://rubygems.org/gems/rdf/')).to_sxp #=> "(isIRI <https://rubygems.org/gems/rdf/>)"
# Operator(:isLiteral).new(RDF::Literal(3.1415)).to_sxp #=> "(isLiteral 3.1415)"
# Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415))).to_sxp #=> "(str (datatype 3.1415))"
# Operator(:isLiteral).new(RDF::Literal(3.1415)).to_sxp #=> "(isLiteral 3.1415e0)"
# Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415))).to_sxp #=> "(str (datatype 3.1415e0))"
#
# ## Constructing operator expressions using SSE forms
#
# SPARQL::Algebra::Expression[:isBlank, RDF::Node(:foobar)].to_sxp #=> "(isBlank _:foobar)"
# SPARQL::Algebra::Expression[:isIRI, RDF::URI('https://rubygems.org/gems/rdf/')].to_sxp #=> "(isIRI <https://rubygems.org/gems/rdf/>)"
# SPARQL::Algebra::Expression[:isLiteral, RDF::Literal(3.1415)].to_sxp #=> "(isLiteral 3.1415)"
# SPARQL::Algebra::Expression[:str, [:datatype, RDF::Literal(3.1415)]].to_sxp #=> "(str (datatype 3.1415))"
# SPARQL::Algebra::Expression[:isLiteral, RDF::Literal(3.1415)].to_sxp #=> "(isLiteral 3.1415e0)"
# SPARQL::Algebra::Expression[:str, [:datatype, RDF::Literal(3.1415)]].to_sxp #=> "(str (datatype 3.1415e0))"
#
# ## Constructing operator expressions using SSE strings
#
Expand Down
7 changes: 0 additions & 7 deletions lib/sparql/algebra/expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ module Expression
# @yieldreturn [void] ignored
# @return [Expression]
def self.parse(sse, **options, &block)
begin
require 'sxp' # @see https://rubygems.org/gems/sxp
rescue LoadError
abort "SPARQL::Algebra::Expression.parse requires the SXP gem (hint: `gem install sxp')."
end
require 'sparql/algebra/sxp_extensions'

sse = sse.encode(Encoding::UTF_8)
sxp = SXP::Reader::SPARQL.new(sse) do |reader|
# Set base_uri if we have one
Expand Down
7 changes: 3 additions & 4 deletions lib/sparql/algebra/extensions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ def vars
variables.values
end

alias_method :optimize_without_expression!, :optimize!
##
# Optimize the query, removing lexical shortcuts in URIs
#
Expand All @@ -441,11 +442,9 @@ def optimize!(**options)
term
end
end
RDF::Query::Pattern.from(components)
end.sort! do |a, b|
(a.cost || 0) <=> (b.cost || 0)
RDF::Query::Pattern.from(components, **pattern.options)
end
self
self.optimize_without_expression!(**options)
end

##
Expand Down
7 changes: 0 additions & 7 deletions lib/sparql/algebra/operator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,13 +571,6 @@ def to_sxp_bin
#
# @return [String]
def to_sxp
begin
require 'sxp' # @see https://rubygems.org/gems/sxp
rescue LoadError
abort "SPARQL::Algebra::Operator#to_sxp requires the SXP gem (hint: `gem install sxp')."
end
require 'sparql/algebra/sxp_extensions'

to_sxp_bin.to_sxp
end

Expand Down
1 change: 0 additions & 1 deletion lib/sparql/grammar.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
require 'rdf' # @see https://rubygems.org/gems/rdf
require 'sparql/algebra'
require 'json'
require 'sxp'

module SPARQL
##
Expand Down

0 comments on commit c5e7b57

Please sign in to comment.