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 +1 -1
- data/lib/sparql/client/repository.rb +14 -18
- data/lib/sparql/client/version.rb +1 -1
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
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 [
|
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
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
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
|
|
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 0.0.
|
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-
|
18
|
+
date: 2010-10-14 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|