sparql-client 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.6
1
+ 0.0.7
@@ -161,27 +161,23 @@ module SPARQL; class Client
161
161
  # repository.query([nil, RDF::DOAP.developer, nil])
162
162
  # repository.query(:predicate => RDF::DOAP.developer)
163
163
  #
164
- # @param [Query, Statement, Array(Value), Hash] pattern
164
+ # @param [Pattern] pattern
165
+ # @see RDF::Queryable#query_pattern
165
166
  # @yield [statement]
166
167
  # @yieldparam [Statement]
167
168
  # @return [Enumerable<Statement>]
168
- def query(pattern, &block)
169
- case pattern
170
- when RDF::Query::Pattern
171
- query = client.construct(pattern).where(pattern)
172
- if block_given?
173
- query.each_statement(&block)
174
- else
175
- query.solutions.to_a.extend(RDF::Enumerable, RDF::Queryable)
176
- end
177
- when RDF::Statement
178
- query(RDF::Query::Pattern.new({
179
- :subject => pattern.subject || :s,
180
- :predicate => pattern.predicate || :p,
181
- :object => pattern.object || :o,
182
- }), &block)
183
- else
184
- super(pattern, &block)
169
+ def query_pattern(pattern, &block)
170
+ pattern = pattern.dup
171
+ pattern.subject ||= RDF::Query::Variable.new
172
+ pattern.predicate ||= RDF::Query::Variable.new
173
+ pattern.object ||= RDF::Query::Variable.new
174
+ pattern.initialize!
175
+ query = client.construct(pattern).where(pattern)
176
+
177
+ if block_given?
178
+ query.each_statement(&block)
179
+ else
180
+ query.solutions.to_a.extend(RDF::Enumerable, RDF::Queryable)
185
181
  end
186
182
  end
187
183
 
@@ -2,7 +2,7 @@ module SPARQL; class Client
2
2
  module VERSION
3
3
  MAJOR = 0
4
4
  MINOR = 0
5
- TINY = 6
5
+ TINY = 7
6
6
  EXTRA = nil
7
7
 
8
8
  STRING = [MAJOR, MINOR, TINY, EXTRA].compact.join('.')
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 0
8
- - 6
9
- version: 0.0.6
8
+ - 7
9
+ version: 0.0.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Arto Bendiken
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-09-17 00:00:00 +02:00
18
+ date: 2010-10-14 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency