sparql 3.1.2 → 3.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 774ff66fd7f181a0b4aa7eb36c5c3a11c10c7a8c2b02728c358825ab7690e3be
4
- data.tar.gz: 7f71db0b80c137af45f57b54ed335ab8d0d327e9c427d0eadb1fc70ae2c4ba62
3
+ metadata.gz: f623228f6e6d10b6b8221219ba1b7b6fcfdf8410db716cb400ed50b5e59f7d25
4
+ data.tar.gz: 8678296e2d0744c5d8dbbc0ac424c7c8b0e2540fa730a03960e961b9c2f08b33
5
5
  SHA512:
6
- metadata.gz: fa064eb95aa7106739015840d71ea30bf89c853225517aee1d89fefe0f523fda1d3ed62fbf0c5e1f03d7c8fe10ae41dd14d2585754ea51539c86cc918a468313
7
- data.tar.gz: 67b69a2e66be71bc5a73d74da3243f10950e56165c971f65536bd800edfd8edc25eb9d198cd84c220ae6f0e58a7819adfc9e2dd45439931449224d57227e240b
6
+ metadata.gz: f2b53c1cbf504ac9818d2a6ee0b03b9703e447698c5d2edcef697d49a4a7eaca63f563511440ec8e15e2bf64b8a91290b15eaf5aac2261c5fdd59a88a779fa66
7
+ data.tar.gz: 19a3844b38131cbc1cfa63a8109602fe07c98b58af4c8eef77cbb3bc668a055872582aa529e8b06ab27e873aacbc2b882abb435ab61148294f28fe4391024cdc
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.1.2
1
+ 3.1.3
@@ -103,7 +103,7 @@ module Sinatra
103
103
  app.helpers(Sinatra::SPARQL::Helpers)
104
104
  app.send(:include, ::SPARQL)
105
105
  app.send(:include, ::RDF)
106
- app.send(:include, ::LinkedData)
106
+ app.send(:include, ::LinkedData) if defined?(::LinkedData)
107
107
  end
108
108
  end
109
109
  end
@@ -1,4 +1,6 @@
1
+ require 'sxp'
1
2
  require 'sparql/extensions'
3
+ require 'sparql/algebra/sxp_extensions'
2
4
 
3
5
  ##
4
6
  # A SPARQL for RDF.rb.
@@ -142,15 +142,15 @@ module SPARQL
142
142
  #
143
143
  # Operator(:isBlank).new(RDF::Node(:foobar)).to_sxp #=> "(isBlank _:foobar)"
144
144
  # Operator(:isIRI).new(RDF::URI('https://rubygems.org/gems/rdf/')).to_sxp #=> "(isIRI <https://rubygems.org/gems/rdf/>)"
145
- # Operator(:isLiteral).new(RDF::Literal(3.1415)).to_sxp #=> "(isLiteral 3.1415)"
146
- # Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415))).to_sxp #=> "(str (datatype 3.1415))"
145
+ # Operator(:isLiteral).new(RDF::Literal(3.1415)).to_sxp #=> "(isLiteral 3.1415e0)"
146
+ # Operator(:str).new(Operator(:datatype).new(RDF::Literal(3.1415))).to_sxp #=> "(str (datatype 3.1415e0))"
147
147
  #
148
148
  # ## Constructing operator expressions using SSE forms
149
149
  #
150
150
  # SPARQL::Algebra::Expression[:isBlank, RDF::Node(:foobar)].to_sxp #=> "(isBlank _:foobar)"
151
151
  # SPARQL::Algebra::Expression[:isIRI, RDF::URI('https://rubygems.org/gems/rdf/')].to_sxp #=> "(isIRI <https://rubygems.org/gems/rdf/>)"
152
- # SPARQL::Algebra::Expression[:isLiteral, RDF::Literal(3.1415)].to_sxp #=> "(isLiteral 3.1415)"
153
- # SPARQL::Algebra::Expression[:str, [:datatype, RDF::Literal(3.1415)]].to_sxp #=> "(str (datatype 3.1415))"
152
+ # SPARQL::Algebra::Expression[:isLiteral, RDF::Literal(3.1415)].to_sxp #=> "(isLiteral 3.1415e0)"
153
+ # SPARQL::Algebra::Expression[:str, [:datatype, RDF::Literal(3.1415)]].to_sxp #=> "(str (datatype 3.1415e0))"
154
154
  #
155
155
  # ## Constructing operator expressions using SSE strings
156
156
  #
@@ -20,13 +20,6 @@ module SPARQL; module Algebra
20
20
  # @yieldreturn [void] ignored
21
21
  # @return [Expression]
22
22
  def self.parse(sse, **options, &block)
23
- begin
24
- require 'sxp' # @see https://rubygems.org/gems/sxp
25
- rescue LoadError
26
- abort "SPARQL::Algebra::Expression.parse requires the SXP gem (hint: `gem install sxp')."
27
- end
28
- require 'sparql/algebra/sxp_extensions'
29
-
30
23
  sse = sse.encode(Encoding::UTF_8)
31
24
  sxp = SXP::Reader::SPARQL.new(sse) do |reader|
32
25
  # Set base_uri if we have one
@@ -427,6 +427,7 @@ class RDF::Query
427
427
  variables.values
428
428
  end
429
429
 
430
+ alias_method :optimize_without_expression!, :optimize!
430
431
  ##
431
432
  # Optimize the query, removing lexical shortcuts in URIs
432
433
  #
@@ -441,11 +442,9 @@ class RDF::Query
441
442
  term
442
443
  end
443
444
  end
444
- RDF::Query::Pattern.from(components)
445
- end.sort! do |a, b|
446
- (a.cost || 0) <=> (b.cost || 0)
445
+ RDF::Query::Pattern.from(components, **pattern.options)
447
446
  end
448
- self
447
+ self.optimize_without_expression!(**options)
449
448
  end
450
449
 
451
450
  ##
@@ -571,13 +571,6 @@ module SPARQL; module Algebra
571
571
  #
572
572
  # @return [String]
573
573
  def to_sxp
574
- begin
575
- require 'sxp' # @see https://rubygems.org/gems/sxp
576
- rescue LoadError
577
- abort "SPARQL::Algebra::Operator#to_sxp requires the SXP gem (hint: `gem install sxp')."
578
- end
579
- require 'sparql/algebra/sxp_extensions'
580
-
581
574
  to_sxp_bin.to_sxp
582
575
  end
583
576
 
@@ -1,7 +1,6 @@
1
1
  require 'rdf' # @see https://rubygems.org/gems/rdf
2
2
  require 'sparql/algebra'
3
3
  require 'json'
4
- require 'sxp'
5
4
 
6
5
  module SPARQL
7
6
  ##
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparql
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.2
4
+ version: 3.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
8
8
  - Arto Bendiken
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-06-16 00:00:00.000000000 Z
12
+ date: 2020-10-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -414,7 +414,7 @@ homepage: https://github.com/ruby-rdf/sparql
414
414
  licenses:
415
415
  - Unlicense
416
416
  metadata: {}
417
- post_install_message:
417
+ post_install_message:
418
418
  rdoc_options: []
419
419
  require_paths:
420
420
  - lib
@@ -429,8 +429,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
429
429
  - !ruby/object:Gem::Version
430
430
  version: '0'
431
431
  requirements: []
432
- rubygems_version: 3.1.3
433
- signing_key:
432
+ rubygems_version: 3.1.4
433
+ signing_key:
434
434
  specification_version: 4
435
435
  summary: SPARQL Query and Update library for Ruby.
436
436
  test_files: []