sparql 3.3.0 → 3.3.1

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: ead530e69a39c8dc1e436580c1e77360f5fdf141a9eaf8c07f8ca55be17c9ca2
4
- data.tar.gz: d4b59bb569ea2baffb9be7196208f727ad21befe4cd3274a8347703f92d1aa0d
3
+ metadata.gz: 04020d0f2d52ea9619dc58bf25c0660f62469e492cbf32893345cea0f888bc06
4
+ data.tar.gz: f6f982cfcc78222576f741b77bd4665e58f922641906ee8d66ca370063713752
5
5
  SHA512:
6
- metadata.gz: ce81b4e2b4cf51d605feea78a09f31c923a5dc0ac7ca2d59fbff9274f1912c847e05d6dbd8b77f1d21f7e05acfaf3cd83372bf77c33ffd04559ef213629182fb
7
- data.tar.gz: fd507ab24315f5c637cee2dc88ff7729264c1d26f6557214ab861065e0fef5ec3728121bb8ddbc0f608e5f6c62781fb32e0dae1c5367bf9690c29c1cf36afc9d
6
+ metadata.gz: 427b55415d048501faad82f0355b74d40e21732e7e3ed61f44cb6f0db5446a58666989c341276db0afdd093b5b77a0bc335aa52de0620a18fe9b1d59cf32201d
7
+ data.tar.gz: 775d4e5037ab9d3affaacf71ee7723f6337da9959ce6acf7c5dd24e424706ff681f446a7087ee7af81046cc9b53f9385b38e5e2bc6529164311fa33108fe4742
data/README.md CHANGED
@@ -25,7 +25,7 @@ An implementation of [SPARQL][] for [RDF.rb][].
25
25
  * Helper method for describing [SPARQL Service Description][SSD]
26
26
  * Helper method for setting up datasets as part of the [SPARQL 1.1 Protocol][].
27
27
  * Implementation Report: {file:etc/earl.html EARL}
28
- * Compatible with Ruby >= 2.6.
28
+ * Compatible with Ruby >= 3.0.
29
29
  * Supports Unicode query strings both on all versions of Ruby.
30
30
  * Provisional support for [SPARQL-star][].
31
31
 
@@ -382,6 +382,10 @@ Find more examples in {SPARQL::Grammar} and {SPARQL::Algebra}.
382
382
 
383
383
  Full documentation available on [Rubydoc.info][SPARQL doc]
384
384
 
385
+ ## Change Log
386
+
387
+ See [Release Notes on GitHub](https://github.com/ruby-rdf/sparql/releases)
388
+
385
389
  ### Principle Classes
386
390
 
387
391
  * {SPARQL}
@@ -400,7 +404,7 @@ Full documentation available on [Rubydoc.info][SPARQL doc]
400
404
  * [Ruby](https://ruby-lang.org/) (>= 3.0)
401
405
  * [RDF.rb](https://rubygems.org/gems/rdf) (~> 3.3)
402
406
  * [SPARQL::Client](https://rubygems.org/gems/sparql-client) (~> 3.3)
403
- * [SXP](https://rubygems.org/gems/sxp) (~> 1.2)
407
+ * [SXP](https://rubygems.org/gems/sxp) (~> 2.0)
404
408
  * [Builder](https://rubygems.org/gems/builder) (~> 3.2)
405
409
  * [JSON](https://rubygems.org/gems/json) (~> 2.6)
406
410
  * Soft dependency on [Linked Data][] (>= 3.3)
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.0
1
+ 3.3.1
@@ -50,6 +50,11 @@ module SPARQL; module Algebra
50
50
  def evaluate(bindings, **options)
51
51
  ops = operands.map {|op| op.evaluate(bindings, **options.merge(depth: options[:depth].to_i + 1))}
52
52
 
53
+ # rdf:nil is like empty string
54
+ if ops == [RDF.nil]
55
+ return RDF::Literal.new("")
56
+ end
57
+
53
58
  raise TypeError, "expected all plain literal operands" unless ops.all? {|op| op.literal? && op.plain?}
54
59
 
55
60
  ops.inject do |memo, op|
@@ -28,7 +28,7 @@ module SPARQL; module Algebra
28
28
  # @yieldparam [RDF::Query::Solution] solution
29
29
  # @yieldreturn [void] ignored
30
30
  # @see https://www.w3.org/TR/sparql11-query/#sparqlAlgebra
31
- def execute(queryable, **options)
31
+ def execute(queryable, **options, &block)
32
32
  debug(options) {"Sequence #{operands.to_sse}"}
33
33
 
34
34
  last = queryable.query(operands.shift, **options.merge(depth: options[:depth].to_i + 1))
@@ -974,6 +974,11 @@ module SPARQL::Grammar
974
974
  add_prod_data :row, [:row]
975
975
  else
976
976
  Array(data[:rowdata]).each do |ds|
977
+ if ds.length < data[:Var].length
978
+ raise Error, "Too few values in a VALUE clause compared to the number of variables"
979
+ elsif ds.length > data[:Var].length
980
+ raise Error, "Too many values in a VALUE clause compared to the number of variables"
981
+ end
977
982
  r = [:row]
978
983
  ds.each_with_index do |d, i|
979
984
  r << [vars[i], d] if d
@@ -2325,6 +2330,8 @@ module SPARQL::Grammar
2325
2330
 
2326
2331
  def ns(prefix, suffix)
2327
2332
  base = prefix(prefix).to_s
2333
+ suffix = suffix.to_s.gsub(PN_LOCAL_ESC) {|esc| esc[1]} if
2334
+ suffix.to_s.match?(PN_LOCAL_ESC)
2328
2335
  suffix = suffix.to_s.sub(/^\#/, "") if base.index("#")
2329
2336
  debug {"ns(#{prefix.inspect}): base: '#{base}', suffix: '#{suffix}'"}
2330
2337
  iri(base + suffix.to_s)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparql
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.0
4
+ version: 3.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gregg Kellogg
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-08-26 00:00:00.000000000 Z
12
+ date: 2024-02-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rdf
@@ -45,14 +45,14 @@ dependencies:
45
45
  requirements:
46
46
  - - "~>"
47
47
  - !ruby/object:Gem::Version
48
- version: '2.4'
48
+ version: '2.5'
49
49
  type: :runtime
50
50
  prerelease: false
51
51
  version_requirements: !ruby/object:Gem::Requirement
52
52
  requirements:
53
53
  - - "~>"
54
54
  - !ruby/object:Gem::Version
55
- version: '2.4'
55
+ version: '2.5'
56
56
  - !ruby/object:Gem::Dependency
57
57
  name: builder
58
58
  requirement: !ruby/object:Gem::Requirement
@@ -93,14 +93,14 @@ dependencies:
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '1.3'
96
+ version: '2.0'
97
97
  type: :runtime
98
98
  prerelease: false
99
99
  version_requirements: !ruby/object:Gem::Requirement
100
100
  requirements:
101
101
  - - "~>"
102
102
  - !ruby/object:Gem::Version
103
- version: '1.3'
103
+ version: '2.0'
104
104
  - !ruby/object:Gem::Dependency
105
105
  name: sparql-client
106
106
  requirement: !ruby/object:Gem::Requirement
@@ -129,6 +129,20 @@ dependencies:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
131
  version: '3.3'
132
+ - !ruby/object:Gem::Dependency
133
+ name: getoptlong
134
+ requirement: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0.2'
139
+ type: :development
140
+ prerelease: false
141
+ version_requirements: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - "~>"
144
+ - !ruby/object:Gem::Version
145
+ version: '0.2'
132
146
  - !ruby/object:Gem::Dependency
133
147
  name: sinatra
134
148
  requirement: !ruby/object:Gem::Requirement
@@ -443,7 +457,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
443
457
  - !ruby/object:Gem::Version
444
458
  version: '0'
445
459
  requirements: []
446
- rubygems_version: 3.2.33
460
+ rubygems_version: 3.4.19
447
461
  signing_key:
448
462
  specification_version: 4
449
463
  summary: SPARQL Query and Update library for Ruby.