rdf 3.2.7 → 3.2.8

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: 62ac7574f98336ccea36385134d2007029e6e4edb182920c45fefb8f50fcccb7
4
- data.tar.gz: b89e554b9961e6038408a29e8ca104aac8b6692a39fa9dddbab0779479e1b2bc
3
+ metadata.gz: 9a11f72b598d08137366e7d9d0796dc7a0f6bf822484c6809a9e7905270b0b06
4
+ data.tar.gz: 67a7699bef7b127a327ba1dd3b5d53c7155325da9d8520ccf91fe51f4688cca3
5
5
  SHA512:
6
- metadata.gz: 15af5338e8d3a4ff0c1601aad011a9b340b2b1b0f93da4d383bfb4b81da58c3dda68ea8e6e03a034b7decf81650f5f6e3b398b564205f5a0a39ffbf134974dde
7
- data.tar.gz: 7ba7aa6f6af2a6e61b5b0da249bf084a84d0ef75245438bf091acbdb55e6fcc4c0c8dc904058e8ad0e11ced53cd373e68a4ebaef93867b7cf60f253f4581ded8
6
+ metadata.gz: 46f34b3fd322934aa324b3977714d7a456a4fef2d9aa28c340c484abf2b593ffe3b753b1d4a82e4aa9837321c5232d1d6fce1f46f114bad37dd3f4bf3e6a0b85
7
+ data.tar.gz: 2f07ef6e2c199240232d7185153b0b9fa41dc885bbc0fed2b616fa061440ccb6439eb993ab463f81e6535b946d4e8301d2b6a76fb397c3d5b9ee048fa58654e0
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.2.7
1
+ 3.2.8
@@ -79,7 +79,7 @@ module RDF
79
79
  #
80
80
  # @return [String]
81
81
  def inspect
82
- sprintf("#<%s:%#0x(%s)>", self.class.name, __id__, uri.to_s)
82
+ sprintf("#<%s:%#0x(%s)>", self.class.name, __id__, count.to_s)
83
83
  end
84
84
 
85
85
  ##
@@ -160,7 +160,7 @@ module RDF; class Query
160
160
  #
161
161
  # @param [RDF::Queryable] queryable
162
162
  # the graph or repository to query
163
- # @param [Hash{Symbol => RDF::Term}] bindings
163
+ # @param [Hash{Symbol => RDF::Term}, RDF::Query::Solution] bindings
164
164
  # optional variable bindings to use
165
165
  # @yield [statement]
166
166
  # each matching statement
@@ -171,6 +171,7 @@ module RDF; class Query
171
171
  # @see RDF::Queryable#query
172
172
  # @since 0.3.0
173
173
  def execute(queryable, bindings = {}, &block)
174
+ bindings = bindings.to_h if bindings.is_a?(Solution)
174
175
  query = {
175
176
  subject: subject.is_a?(Variable) && bindings[subject.to_sym] ? bindings[subject.to_sym] : subject,
176
177
  predicate: predicate.is_a?(Variable) && bindings[predicate.to_sym] ? bindings[predicate.to_sym] : predicate,
data/lib/rdf/query.rb CHANGED
@@ -294,7 +294,7 @@ module RDF
294
294
  # Alias for `:graph_name`.
295
295
  # @param [Hash{Symbol => Object}] options
296
296
  # any additional keyword options
297
- # @option options [Hash{Symbol => RDF::Term}] bindings
297
+ # @option options [Hash{Symbol => RDF::Term}, RDF::Query::Solution] bindings
298
298
  # optional variable bindings to use
299
299
  # @option options [Boolean] :optimize
300
300
  # Optimize query before execution.
@@ -313,6 +313,7 @@ module RDF
313
313
  # Otherwise, a quick empty solution simplifies the logic below; no special case for
314
314
  # the first pattern
315
315
  @solutions = Query::Solutions(solutions)
316
+ bindings = bindings.to_h if bindings.is_a?(Solution)
316
317
 
317
318
  # If there are no patterns, just return the empty solution
318
319
  if empty?
@@ -341,7 +342,7 @@ module RDF
341
342
  bindings.each_key do |variable|
342
343
  if pattern.variables.include?(variable)
343
344
  unbound_solutions, old_solutions = old_solutions, Query::Solutions()
344
- bindings[variable].each do |binding|
345
+ Array(bindings[variable]).each do |binding|
345
346
  unbound_solutions.each do |solution|
346
347
  old_solutions << solution.merge(variable => binding)
347
348
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rdf
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.7
4
+ version: 3.2.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Arto Bendiken
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2022-04-22 00:00:00.000000000 Z
13
+ date: 2022-05-28 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: link_header