sparql-client 0.3.0 → 0.3.1

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 +1 -1
  2. data/VERSION +1 -1
  3. data/lib/sparql/client/query.rb +7 -6
  4. metadata +39 -40
data/README CHANGED
@@ -3,7 +3,7 @@
3
3
  This is a [Ruby][] implementation of a [SPARQL][] client for [RDF.rb][].
4
4
  [![Build Status](https://secure.travis-ci.org/ruby-rdf/sparql-client.png?branch=master)](http://travis-ci.org/ruby-rdf/sparql-client)
5
5
 
6
- * <http://github.com/bendiken/sparql-client>
6
+ * <http://ruby-rdf.github.com/sparql-client/>
7
7
 
8
8
  ##Features
9
9
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.0
1
+ 0.3.1
@@ -236,7 +236,7 @@ module SPARQL; class Client
236
236
  ##
237
237
  # @private
238
238
  def filter(string)
239
- ((options[:filters] ||= []) << string) if string and not string.empty
239
+ ((options[:filters] ||= []) << string) if string and not string.empty?
240
240
  self
241
241
  end
242
242
 
@@ -300,13 +300,14 @@ module SPARQL; class Client
300
300
  buffer = [form.to_s.upcase]
301
301
  case form
302
302
  when :select, :describe
303
- buffer << 'DISTINCT' if options[:distinct]
303
+ only_count = values.empty? and options[:count]
304
+ buffer << 'DISTINCT' if options[:distinct] and not only_count
304
305
  buffer << 'REDUCED' if options[:reduced]
305
- buffer << '( COUNT' if options[:count]
306
- buffer << (values.empty? ? '*' : values.map { |v| serialize_value(v[1]) }.join(' '))
306
+ buffer << ((values.empty? and not options[:count]) ? '*' : values.map { |v| serialize_value(v[1]) }.join(' '))
307
307
  if options[:count]
308
- var = options[:count]
309
- buffer << 'AS ' + (var.is_a?(String) ? var : "?#{var}") + ' )'
308
+ options[:count].each do |var, count|
309
+ buffer << '( COUNT(' + (options[:distinct] ? 'DISTINCT ' : '') + (var.is_a?(String) ? var : "?#{var}") + ') AS ' + (count.is_a?(String) ? count : "?#{count}") + ' )'
310
+ end
310
311
  end
311
312
  when :construct
312
313
  buffer << '{'
metadata CHANGED
@@ -1,113 +1,113 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sparql-client
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.3.0
4
+ version: 0.3.1
5
+ prerelease:
6
6
  platform: ruby
7
7
  authors:
8
8
  - Arto Bendiken
9
9
  - Ben Lavender
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2012-09-28 00:00:00.000000000 Z
13
+ date: 2012-11-15 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: json_pure
17
- version_requirements: !ruby/object:Gem::Requirement
17
+ requirement: !ruby/object:Gem::Requirement
18
+ none: false
18
19
  requirements:
19
20
  - - ! '>='
20
21
  - !ruby/object:Gem::Version
21
22
  version: 1.6.5
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: !ruby/object:Gem::Requirement
22
26
  none: false
23
- requirement: !ruby/object:Gem::Requirement
24
27
  requirements:
25
28
  - - ! '>='
26
29
  - !ruby/object:Gem::Version
27
30
  version: 1.6.5
28
- none: false
29
- prerelease: false
30
- type: :runtime
31
31
  - !ruby/object:Gem::Dependency
32
32
  name: rdf
33
- version_requirements: !ruby/object:Gem::Requirement
33
+ requirement: !ruby/object:Gem::Requirement
34
+ none: false
34
35
  requirements:
35
36
  - - ! '>='
36
37
  - !ruby/object:Gem::Version
37
38
  version: 0.3.5
39
+ type: :runtime
40
+ prerelease: false
41
+ version_requirements: !ruby/object:Gem::Requirement
38
42
  none: false
39
- requirement: !ruby/object:Gem::Requirement
40
43
  requirements:
41
44
  - - ! '>='
42
45
  - !ruby/object:Gem::Version
43
46
  version: 0.3.5
44
- none: false
45
- prerelease: false
46
- type: :runtime
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: net-http-persistent
49
- version_requirements: !ruby/object:Gem::Requirement
49
+ requirement: !ruby/object:Gem::Requirement
50
+ none: false
50
51
  requirements:
51
52
  - - ! '>='
52
53
  - !ruby/object:Gem::Version
53
54
  version: 1.4.1
55
+ type: :runtime
56
+ prerelease: false
57
+ version_requirements: !ruby/object:Gem::Requirement
54
58
  none: false
55
- requirement: !ruby/object:Gem::Requirement
56
59
  requirements:
57
60
  - - ! '>='
58
61
  - !ruby/object:Gem::Version
59
62
  version: 1.4.1
60
- none: false
61
- prerelease: false
62
- type: :runtime
63
63
  - !ruby/object:Gem::Dependency
64
64
  name: yard
65
- version_requirements: !ruby/object:Gem::Requirement
65
+ requirement: !ruby/object:Gem::Requirement
66
+ none: false
66
67
  requirements:
67
68
  - - ! '>='
68
69
  - !ruby/object:Gem::Version
69
70
  version: 0.7.5
71
+ type: :development
72
+ prerelease: false
73
+ version_requirements: !ruby/object:Gem::Requirement
70
74
  none: false
71
- requirement: !ruby/object:Gem::Requirement
72
75
  requirements:
73
76
  - - ! '>='
74
77
  - !ruby/object:Gem::Version
75
78
  version: 0.7.5
76
- none: false
77
- prerelease: false
78
- type: :development
79
79
  - !ruby/object:Gem::Dependency
80
80
  name: rspec
81
- version_requirements: !ruby/object:Gem::Requirement
81
+ requirement: !ruby/object:Gem::Requirement
82
+ none: false
82
83
  requirements:
83
84
  - - ! '>='
84
85
  - !ruby/object:Gem::Version
85
86
  version: 2.10.0
87
+ type: :development
88
+ prerelease: false
89
+ version_requirements: !ruby/object:Gem::Requirement
86
90
  none: false
87
- requirement: !ruby/object:Gem::Requirement
88
91
  requirements:
89
92
  - - ! '>='
90
93
  - !ruby/object:Gem::Version
91
94
  version: 2.10.0
92
- none: false
93
- prerelease: false
94
- type: :development
95
95
  - !ruby/object:Gem::Dependency
96
96
  name: rdf-spec
97
- version_requirements: !ruby/object:Gem::Requirement
97
+ requirement: !ruby/object:Gem::Requirement
98
+ none: false
98
99
  requirements:
99
100
  - - ! '>='
100
101
  - !ruby/object:Gem::Version
101
102
  version: 0.3.5
103
+ type: :development
104
+ prerelease: false
105
+ version_requirements: !ruby/object:Gem::Requirement
102
106
  none: false
103
- requirement: !ruby/object:Gem::Requirement
104
107
  requirements:
105
108
  - - ! '>='
106
109
  - !ruby/object:Gem::Version
107
110
  version: 0.3.5
108
- none: false
109
- prerelease: false
110
- type: :development
111
111
  description: SPARQL client for RDF.rb.
112
112
  email: public-rdf-ruby@w3.org
113
113
  executables: []
@@ -119,35 +119,34 @@ files:
119
119
  - README
120
120
  - UNLICENSE
121
121
  - VERSION
122
- - lib/sparql/client.rb
123
122
  - lib/sparql/client/query.rb
124
123
  - lib/sparql/client/repository.rb
125
124
  - lib/sparql/client/version.rb
125
+ - lib/sparql/client.rb
126
126
  homepage: http://github.com/ruby-rdf/sparql-client
127
127
  licenses:
128
128
  - Public Domain
129
- post_install_message:
129
+ post_install_message:
130
130
  rdoc_options: []
131
131
  require_paths:
132
132
  - lib
133
133
  required_ruby_version: !ruby/object:Gem::Requirement
134
+ none: false
134
135
  requirements:
135
136
  - - ! '>='
136
137
  - !ruby/object:Gem::Version
137
138
  version: 1.8.1
138
- none: false
139
139
  required_rubygems_version: !ruby/object:Gem::Requirement
140
+ none: false
140
141
  requirements:
141
142
  - - ! '>='
142
143
  - !ruby/object:Gem::Version
143
144
  version: '0'
144
- none: false
145
145
  requirements: []
146
146
  rubyforge_project: sparql
147
147
  rubygems_version: 1.8.24
148
- signing_key:
148
+ signing_key:
149
149
  specification_version: 3
150
150
  summary: SPARQL client for RDF.rb.
151
151
  test_files: []
152
152
  has_rdoc: false
153
- ...