owlim-ruby 0.9.9.2 → 0.9.9.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.rdoc +13 -0
  2. data/gemspec.rb +1 -1
  3. data/lib/owlim.rb +4 -2
  4. metadata +4 -4
data/README.rdoc CHANGED
@@ -183,6 +183,8 @@ Drop a repository.
183
183
  SPARQL query to a repository.
184
184
 
185
185
  owlim.query(repository, sparql) {|x| print x}
186
+ or
187
+ result = owlim.query(repository, sparql)
186
188
 
187
189
  Use :format => "xml" option to retrieve results in the SPARQL Query
188
190
  Results XML Format (http://www.w3.org/TR/rdf-sparql-XMLres/;
@@ -192,17 +194,28 @@ in the JSON (http://www.w3.org/2001/sw/DataAccess/json-sparql/;
192
194
 
193
195
  owlim.query(repository, sparql, :format => "xml") {|x| print x}
194
196
  owlim.query(repository, sparql, :format => "json") {|x| print x}
197
+ or
198
+ result = owlim.query(repository, sparql, :format => "xml")
199
+ result = owlim.query(repository, sparql, :format => "json")
195
200
 
196
201
  Search for a triple which has a keyword as a literal in its object and
197
202
  finds all relevant triples sharing the same subject.
198
203
 
199
204
  owlim.find(repository, keyword) {|x| print x}
205
+ or
206
+ result owlim.find(repository, keyword)
200
207
 
201
208
  Peak the triples in the store. By default, OWLIM adds 62 triples to
202
209
  the empty repository when created, so offset + 61 is used internally.
203
210
 
204
211
  opts = {:limit => 50, :offset => 100, :format => "json"}
205
212
  owlim.head(repository, opts) {|x| print x}
213
+ or
214
+ result = owlim.head(repository, opts)
215
+
216
+ With a :format option and a block, the search results will be immediately
217
+ sent in a stream for "query", "find" and "head" methods. In other cases,
218
+ results are buffred and will not be returened until the search is completed.
206
219
 
207
220
  Show formatted SPARQL prefixes.
208
221
 
data/gemspec.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'owlim-ruby'
3
- s.version = "0.9.9.2"
3
+ s.version = "0.9.9.3"
4
4
  s.license = "Ruby's"
5
5
 
6
6
  s.authors = ["Toshiaki Katayama", "Tatsuya Nishizawa"]
data/lib/owlim.rb CHANGED
@@ -168,8 +168,10 @@ class OWLIM
168
168
  }
169
169
  end
170
170
 
171
- # generate tabular text (not reached if opts[:format] is defined)
172
- if table = format_json(result)
171
+ if opts[:format] # xml or json
172
+ return result
173
+ else # generate tabular text
174
+ table = format_json(result)
173
175
  if block
174
176
  yield table
175
177
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: owlim-ruby
3
3
  version: !ruby/object:Gem::Version
4
- hash: 39
4
+ hash: 37
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
9
  - 9
10
- - 2
11
- version: 0.9.9.2
10
+ - 3
11
+ version: 0.9.9.3
12
12
  platform: ruby
13
13
  authors:
14
14
  - Toshiaki Katayama
@@ -17,7 +17,7 @@ autorequire: owlim
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2012-06-01 00:00:00 +09:00
20
+ date: 2012-06-02 00:00:00 +09:00
21
21
  default_executable: owlim
22
22
  dependencies:
23
23
  - !ruby/object:Gem::Dependency