rdf 3.2.7 → 3.2.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rdf/model/dataset.rb +1 -1
- data/lib/rdf/query/pattern.rb +2 -1
- data/lib/rdf/query.rb +3 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9a11f72b598d08137366e7d9d0796dc7a0f6bf822484c6809a9e7905270b0b06
|
4
|
+
data.tar.gz: 67a7699bef7b127a327ba1dd3b5d53c7155325da9d8520ccf91fe51f4688cca3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46f34b3fd322934aa324b3977714d7a456a4fef2d9aa28c340c484abf2b593ffe3b753b1d4a82e4aa9837321c5232d1d6fce1f46f114bad37dd3f4bf3e6a0b85
|
7
|
+
data.tar.gz: 2f07ef6e2c199240232d7185153b0b9fa41dc885bbc0fed2b616fa061440ccb6439eb993ab463f81e6535b946d4e8301d2b6a76fb397c3d5b9ee048fa58654e0
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.2.
|
1
|
+
3.2.8
|
data/lib/rdf/model/dataset.rb
CHANGED
data/lib/rdf/query/pattern.rb
CHANGED
@@ -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.
|
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-
|
13
|
+
date: 2022-05-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: link_header
|