rdf-virtuoso 0.0.13 → 0.0.14
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.
- data/README.md +8 -5
- data/lib/active_rdf/persistence.rb +1 -0
- data/lib/active_rdf/version.rb +1 -1
- data/lib/rdf/virtuoso/query.rb +71 -20
- data/lib/rdf/virtuoso/version.rb +1 -1
- data/spec/query_spec.rb +80 -13
- metadata +11 -11
data/README.md
CHANGED
@@ -37,21 +37,24 @@ New prefixes can either extend the RDF::Vocabulary class (best if you want to mo
|
|
37
37
|
|
38
38
|
module RDF
|
39
39
|
class FOO < RDF::Vocabulary("http://purl.org/ontology/foo/");end
|
40
|
+
class BAR < RDF::Vocabulary("http://bar.net#");end
|
40
41
|
end
|
41
42
|
|
42
|
-
it can then be easily accessed by RDF
|
43
|
+
it can then be easily accessed by RDF superclass, eg.
|
43
44
|
|
44
45
|
RDF::FOO.Document
|
46
|
+
=> #<RDF::URI:0x4d273ec(http://purl.org/ontology/foo/Document)>
|
47
|
+
RDF::BAR.telescope
|
48
|
+
=> #<RDF::URI:0x4d294ee(http://bar.net#telescope)>
|
45
49
|
|
46
|
-
or you can
|
50
|
+
or you can dynamically add RDF::Vocabulary objects
|
47
51
|
|
48
|
-
|
52
|
+
foo = RDF::Vocabulary.new("http://purl.org/ontology/foo/")
|
49
53
|
|
50
54
|
QUERY = RDF::Virtuoso::Query
|
51
55
|
graph = RDF::URI.new("http://test.com")
|
52
|
-
type = RDF::FOO.Document
|
53
56
|
|
54
|
-
query = QUERY.select.where([:s,
|
57
|
+
query = QUERY.select.where([:s, foo.bar, :o]).count(:s).graph(graph)
|
55
58
|
result = repo.select(query)
|
56
59
|
|
57
60
|
Results will be an array of RDF::Query::Solution that can be accessed by bindings or iterated
|
data/lib/active_rdf/version.rb
CHANGED
data/lib/rdf/virtuoso/query.rb
CHANGED
@@ -306,15 +306,17 @@ module RDF::Virtuoso
|
|
306
306
|
## SPARQL 1.1 Aggregates
|
307
307
|
# @return [Query]
|
308
308
|
# @see http://www.w3.org/TR/sparql11-query/#defn_aggCount
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
309
|
+
# def count(*variables)
|
310
|
+
# options[:count] = variables
|
311
|
+
# self
|
312
|
+
# end
|
313
313
|
AGG_METHODS = %w(count min max sum avg sample group_concat group_digest)
|
314
314
|
|
315
315
|
AGG_METHODS.each do |m|
|
316
316
|
define_method m do |*variables|
|
317
|
-
options[m.to_sym] = variables
|
317
|
+
#options[m.to_sym] = variables
|
318
|
+
options[m.to_sym] ||= []
|
319
|
+
options[m.to_sym] += variables
|
318
320
|
self
|
319
321
|
end
|
320
322
|
end
|
@@ -467,24 +469,50 @@ module RDF::Virtuoso
|
|
467
469
|
aggregates = [:count, :min, :max, :avg, :sum, :sample, :group_concat, :group_digest]
|
468
470
|
if (options.keys & aggregates).any?
|
469
471
|
(options.keys & aggregates).each do |agg|
|
472
|
+
#p options[agg]
|
470
473
|
case agg
|
471
474
|
when :sample
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
475
|
+
# multiple samples splits to individual sample expressions
|
476
|
+
options[agg].each_slice(1) do |a|
|
477
|
+
buffer << '(sql:' + agg.to_s.upcase
|
478
|
+
a.map do |var|
|
479
|
+
buffer << (var.is_a?(String) ? var : "(?#{var})")
|
480
|
+
buffer << "AS ?#{var})"
|
481
|
+
end
|
482
|
+
end
|
483
|
+
when :group_concat
|
484
|
+
# multiple samples splits to individual sample expressions
|
485
|
+
options[agg].each_slice(2) do |a|
|
486
|
+
buffer << '(sql:' + agg.to_s.upcase
|
487
|
+
buffer << a.map {|var| (var.is_a?(Symbol) ? "(?#{var}" : var.is_a?(String) ? "'#{var}'" : var )}.join(', ')
|
488
|
+
buffer << ') AS ?' + a.first.to_s + ')'
|
489
|
+
end
|
490
|
+
when :group_digest
|
491
|
+
# multiple samples splits to individual sample expressions
|
492
|
+
options[agg].each_slice(4) do |a|
|
493
|
+
buffer << '(sql:' + agg.to_s.upcase
|
494
|
+
buffer << a.map {|var| (var.is_a?(Symbol) ? "(?#{var}" : var.is_a?(String) ? "'#{var}'" : var )}.join(', ')
|
495
|
+
buffer << ') AS ?' + a.first.to_s + ')'
|
496
|
+
end
|
497
|
+
else
|
498
|
+
# multiple samples splits to individual sample expressions
|
499
|
+
options[agg].each_slice(1) do |a|
|
500
|
+
buffer << '(' + agg.to_s.upcase
|
501
|
+
a.map do |var|
|
502
|
+
buffer << (var.is_a?(String) ? var : "(?#{var})")
|
503
|
+
buffer << "AS ?#{var})"
|
504
|
+
end
|
505
|
+
end
|
481
506
|
end
|
482
|
-
|
483
|
-
buffer << 'AS ?' + agg.to_s + ')'
|
507
|
+
#
|
484
508
|
end
|
509
|
+
# also handle variables that are not aggregates
|
510
|
+
buffer << values.map { |v| serialize_value(v[1]) }.join(' ') unless values.empty?
|
485
511
|
else
|
512
|
+
# no variables? select/describe all (*)
|
486
513
|
buffer << (values.empty? ? '*' : values.map { |v| serialize_value(v[1]) }.join(' '))
|
487
514
|
end
|
515
|
+
|
488
516
|
when :construct
|
489
517
|
buffer << '{'
|
490
518
|
buffer += serialize_patterns(@data_values)
|
@@ -512,7 +540,7 @@ module RDF::Virtuoso
|
|
512
540
|
buffer << '}'
|
513
541
|
|
514
542
|
when :delete_data
|
515
|
-
buffer << "FROM #{serialize_value(options[:graph])}"
|
543
|
+
buffer << "FROM #{serialize_value(options[:graph])}" if options[:graph]
|
516
544
|
buffer << '{'
|
517
545
|
@data_values.each do |triple|
|
518
546
|
if triple.first.first.is_a?(RDF::Statement)
|
@@ -549,7 +577,8 @@ module RDF::Virtuoso
|
|
549
577
|
# does patterns have :context hash? build with GRAPH statement
|
550
578
|
if patterns.any? { |p| p.has_context? }
|
551
579
|
patterns.each do | pattern|
|
552
|
-
buffer << "GRAPH #{serialize_value(RDF::URI(pattern.context))}
|
580
|
+
buffer << "GRAPH #{serialize_value(RDF::URI(pattern.context))}" if pattern.context
|
581
|
+
buffer << '{'
|
553
582
|
buffer << serialize_patterns(pattern)
|
554
583
|
buffer << '}'
|
555
584
|
end
|
@@ -560,7 +589,18 @@ module RDF::Virtuoso
|
|
560
589
|
if options[:optionals]
|
561
590
|
options[:optionals].each do |patterns|
|
562
591
|
buffer << 'OPTIONAL {'
|
563
|
-
|
592
|
+
|
593
|
+
if patterns.any? { |p| p.has_context? }
|
594
|
+
patterns.each do | pattern|
|
595
|
+
buffer << "GRAPH #{serialize_value(RDF::URI(pattern.context))}" if pattern.context
|
596
|
+
buffer << '{'
|
597
|
+
buffer << serialize_patterns(pattern)
|
598
|
+
buffer << '}'
|
599
|
+
end
|
600
|
+
else
|
601
|
+
buffer += serialize_patterns(patterns)
|
602
|
+
end
|
603
|
+
|
564
604
|
buffer << '}'
|
565
605
|
end
|
566
606
|
end
|
@@ -568,7 +608,18 @@ module RDF::Virtuoso
|
|
568
608
|
if options[:minuses]
|
569
609
|
options[:minuses].each do |patterns|
|
570
610
|
buffer << 'MINUS {'
|
571
|
-
|
611
|
+
|
612
|
+
if patterns.any? { |p| p.has_context? }
|
613
|
+
patterns.each do | pattern|
|
614
|
+
buffer << "GRAPH #{serialize_value(RDF::URI(pattern.context))}" if pattern.context
|
615
|
+
buffer << '{'
|
616
|
+
buffer << serialize_patterns(pattern)
|
617
|
+
buffer << '}'
|
618
|
+
end
|
619
|
+
else
|
620
|
+
buffer += serialize_patterns(patterns)
|
621
|
+
end
|
622
|
+
|
572
623
|
buffer << '}'
|
573
624
|
end
|
574
625
|
end
|
data/lib/rdf/virtuoso/version.rb
CHANGED
data/spec/query_spec.rb
CHANGED
@@ -83,7 +83,14 @@ describe RDF::Virtuoso::Query do
|
|
83
83
|
statements = [RDF::Statement.new(RDF::URI('http://test'), RDF.type, RDF::URI('http://type')), RDF::Statement.new(RDF::URI('http://test'), RDF.type, RDF::URI('http://type2'))]
|
84
84
|
@query.delete_data(statements).graph(RDF::URI.new(@graph)).to_s.should == "DELETE DATA FROM <#{@graph}> { <http://test> <#{RDF.type}> <http://type> .\n <http://test> <#{RDF.type}> <http://type2> .\n }"
|
85
85
|
end
|
86
|
-
|
86
|
+
|
87
|
+
it "should support DELETE DATA queries with appendable objects" do
|
88
|
+
statements = []
|
89
|
+
statements << RDF::Statement.new(RDF::URI('http://test'), RDF.type, RDF::URI('http://type'))
|
90
|
+
statements << RDF::Statement.new(RDF::URI('http://test'), RDF.type, RDF::URI('http://type2'))
|
91
|
+
@query.delete_data(statements).graph(RDF::URI.new(@graph)).to_s.should == "DELETE DATA FROM <#{@graph}> { <http://test> <#{RDF.type}> <http://type> .\n <http://test> <#{RDF.type}> <http://type2> .\n }"
|
92
|
+
end
|
93
|
+
|
87
94
|
it "should support DELETE WHERE queries with symbols and patterns" do
|
88
95
|
@query.delete([:s, :p, :o]).graph(RDF::URI.new(@graph)).where([:s, :p, :o]).to_s.should == "DELETE FROM <#{@graph}> { ?s ?p ?o . } WHERE { ?s ?p ?o . }"
|
89
96
|
@query.delete([:s, @uri.newtype, :o]).graph(RDF::URI.new(@graph)).where([:s, @uri.newtype, :o]).to_s.should == "DELETE FROM <#{@graph}> { ?s <#{@graph}newtype> ?o . } WHERE { ?s <#{@graph}newtype> ?o . }"
|
@@ -120,6 +127,11 @@ describe RDF::Virtuoso::Query do
|
|
120
127
|
@query.select(:s, :p, :o).where([:s, :p, :o]).to_s.should == "SELECT ?s ?p ?o WHERE { ?s ?p ?o . }"
|
121
128
|
end
|
122
129
|
|
130
|
+
it "should support SELECT from NAMED GRAPH" do
|
131
|
+
@graph = RDF::URI("http://example.org/")
|
132
|
+
@query.select(:s).where([:s, :p, :o]).from(@graph).to_s.should == "SELECT ?s FROM <#{@graph}> WHERE { ?s ?p ?o . }"
|
133
|
+
end
|
134
|
+
|
123
135
|
it "should support SELECT with complex WHERE patterns" do
|
124
136
|
@query.select.where(
|
125
137
|
[:s, :p, :o],
|
@@ -161,27 +173,54 @@ describe RDF::Virtuoso::Query do
|
|
161
173
|
end
|
162
174
|
|
163
175
|
it "should support aggregate COUNT" do
|
164
|
-
@query.select.where([:s, :p, :o]).count(:s).to_s.should == "SELECT (COUNT (?s) AS ?
|
165
|
-
@query.select.count(:s).where([:s, :p, :o]).to_s.should == "SELECT (COUNT (?s) AS ?
|
176
|
+
@query.select.where([:s, :p, :o]).count(:s).to_s.should == "SELECT (COUNT (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
177
|
+
@query.select.count(:s).where([:s, :p, :o]).to_s.should == "SELECT (COUNT (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
166
178
|
end
|
167
179
|
|
168
180
|
it "should support aggregates SUM, MIN, MAX, AVG, SAMPLE, GROUP_CONCAT, GROUP_DIGEST" do
|
169
|
-
@query.select.where([:s, :p, :o]).sum(:s).to_s.should == "SELECT (SUM (?s) AS ?
|
170
|
-
@query.select.where([:s, :p, :o]).min(:s).to_s.should == "SELECT (MIN (?s) AS ?
|
171
|
-
@query.select.where([:s, :p, :o]).max(:s).to_s.should == "SELECT (MAX (?s) AS ?
|
172
|
-
@query.select.where([:s, :p, :o]).avg(:s).to_s.should == "SELECT (AVG (?s) AS ?
|
173
|
-
@query.select.where([:s, :p, :o]).sample(:s).to_s.should == "SELECT (sql:SAMPLE (?s) AS ?
|
174
|
-
@query.select.where([:s, :p, :o]).group_concat(:s, '_').to_s.should == "SELECT (sql:GROUP_CONCAT (?s, '_' ) AS ?
|
175
|
-
@query.select.where([:s, :p, :o]).group_digest(:s, '_', 1000, 1).to_s.should == "SELECT (sql:GROUP_DIGEST (?s, '_',
|
181
|
+
@query.select.where([:s, :p, :o]).sum(:s).to_s.should == "SELECT (SUM (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
182
|
+
@query.select.where([:s, :p, :o]).min(:s).to_s.should == "SELECT (MIN (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
183
|
+
@query.select.where([:s, :p, :o]).max(:s).to_s.should == "SELECT (MAX (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
184
|
+
@query.select.where([:s, :p, :o]).avg(:s).to_s.should == "SELECT (AVG (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
185
|
+
@query.select.where([:s, :p, :o]).sample(:s).to_s.should == "SELECT (sql:SAMPLE (?s) AS ?s) WHERE { ?s ?p ?o . }"
|
186
|
+
@query.select.where([:s, :p, :o]).group_concat(:s, '_').to_s.should == "SELECT (sql:GROUP_CONCAT (?s, '_' ) AS ?s) WHERE { ?s ?p ?o . }"
|
187
|
+
@query.select.where([:s, :p, :o]).group_digest(:s, '_', 1000, 1).to_s.should == "SELECT (sql:GROUP_DIGEST (?s, '_', 1000, 1 ) AS ?s) WHERE { ?s ?p ?o . }"
|
188
|
+
end
|
189
|
+
|
190
|
+
it "should support multiple instances of SAMPLE" do
|
191
|
+
@query.select.where([:s, :p, :o]).sample(:s).sample(:p).to_s.should == "SELECT (sql:SAMPLE (?s) AS ?s) (sql:SAMPLE (?p) AS ?p) WHERE { ?s ?p ?o . }"
|
192
|
+
end
|
193
|
+
|
194
|
+
it "should support multiple instances of MIN/MAX/AVG/SUM" do
|
195
|
+
@query.select.where([:s, :p, :o]).min(:s).min(:p).to_s.should == "SELECT (MIN (?s) AS ?s) (MIN (?p) AS ?p) WHERE { ?s ?p ?o . }"
|
196
|
+
@query.select.where([:s, :p, :o]).max(:s).max(:p).to_s.should == "SELECT (MAX (?s) AS ?s) (MAX (?p) AS ?p) WHERE { ?s ?p ?o . }"
|
197
|
+
@query.select.where([:s, :p, :o]).avg(:s).avg(:p).to_s.should == "SELECT (AVG (?s) AS ?s) (AVG (?p) AS ?p) WHERE { ?s ?p ?o . }"
|
198
|
+
@query.select.where([:s, :p, :o]).sum(:s).sum(:p).to_s.should == "SELECT (SUM (?s) AS ?s) (SUM (?p) AS ?p) WHERE { ?s ?p ?o . }"
|
176
199
|
end
|
177
200
|
|
201
|
+
it "should support multiple instances of GROUP_CONCAT" do
|
202
|
+
@query.select.where([:s, :p, :o]).group_concat(:s, '_').group_concat(:p, '-').to_s.should == "SELECT (sql:GROUP_CONCAT (?s, '_' ) AS ?s) (sql:GROUP_CONCAT (?p, '-' ) AS ?p) WHERE { ?s ?p ?o . }"
|
203
|
+
end
|
204
|
+
|
205
|
+
it "should support multiple instances of GROUP_DIGEST" do
|
206
|
+
@query.select.where([:s, :p, :o]).group_digest(:s, '_', 1000, 1).group_digest(:p, '-', 1000, 1).to_s.should == "SELECT (sql:GROUP_DIGEST (?s, '_', 1000, 1 ) AS ?s) (sql:GROUP_DIGEST (?p, '-', 1000, 1 ) AS ?p) WHERE { ?s ?p ?o . }"
|
207
|
+
end
|
208
|
+
|
209
|
+
it "should support aggregates in addition to SELECT variables" do
|
210
|
+
@query.select(:s).where([:s, :p, :o]).group_digest(:o, '_', 1000, 1).to_s.should == "SELECT (sql:GROUP_DIGEST (?o, '_', 1000, 1 ) AS ?o) ?s WHERE { ?s ?p ?o . }"
|
211
|
+
end
|
212
|
+
|
213
|
+
it "should support multiple instances of aggregates AND select variables" do
|
214
|
+
@query.select(:s).where([:s, :p, :o]).sample(:p).sample(:o).to_s.should == "SELECT (sql:SAMPLE (?p) AS ?p) (sql:SAMPLE (?o) AS ?o) ?s WHERE { ?s ?p ?o . }"
|
215
|
+
end
|
216
|
+
|
178
217
|
it "should support ORDER BY" do
|
179
218
|
@query.select.where([:s, :p, :o]).order_by(:o).to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY ?o"
|
180
219
|
@query.select.where([:s, :p, :o]).order_by('?o').to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY ?o"
|
181
220
|
# @query.select.where([:s, :p, :o]).order_by(:o => :asc).to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY ?o ASC"
|
182
|
-
@query.select.where([:s, :p, :o]).order_by('?o
|
221
|
+
@query.select.where([:s, :p, :o]).order_by('ASC(?o)').to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY ASC(?o)"
|
183
222
|
# @query.select.where([:s, :p, :o]).order_by(:o => :desc).to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY ?o DESC"
|
184
|
-
@query.select.where([:s, :p, :o]).order_by('?o
|
223
|
+
@query.select.where([:s, :p, :o]).order_by('DESC(?o)').to_s.should == "SELECT * WHERE { ?s ?p ?o . } ORDER BY DESC(?o)"
|
185
224
|
end
|
186
225
|
|
187
226
|
it "should support OFFSET" do
|
@@ -197,6 +236,8 @@ describe RDF::Virtuoso::Query do
|
|
197
236
|
@query.select.where([:s, :p, :o]).slice(100, 10).to_s.should == "SELECT * WHERE { ?s ?p ?o . } OFFSET 100 LIMIT 10"
|
198
237
|
end
|
199
238
|
|
239
|
+
# DEPRECATED - USE RDF::Vocabulary instead
|
240
|
+
=begin
|
200
241
|
it "should support PREFIX" do
|
201
242
|
prefixes = ["dc: <http://purl.org/dc/elements/1.1/>", "foaf: <http://xmlns.com/foaf/0.1/>"]
|
202
243
|
@query.select.prefix(prefixes[0]).prefix(prefixes[1]).where([:s, :p, :o]).to_s.should ==
|
@@ -214,12 +255,32 @@ describe RDF::Virtuoso::Query do
|
|
214
255
|
@query.select.prefixes(prefixes).where([:s, :p, :o]).to_s.should ==
|
215
256
|
"PREFIX foo: <http://foo.com/> PREFIX bar: <http://bar.net> SELECT * WHERE { ?s ?p ?o . }"
|
216
257
|
end
|
258
|
+
|
259
|
+
it "should support accessing custom PREFIXes in SELECT" do
|
260
|
+
prefixes = RDF::Virtuoso::Prefixes.new foo: "http://foo.com/"
|
261
|
+
@query.select.where(['foo:bar', :p, :o]).prefixes(prefixes).to_s.should ==
|
262
|
+
"PREFIX foo: <http://foo.com/bar> SELECT * WHERE { ?s ?p ?o . }"
|
263
|
+
end
|
264
|
+
=end
|
265
|
+
|
266
|
+
it "should support using custom RDF::Vocabulary prefixes" do
|
267
|
+
BIBO = RDF::Vocabulary.new("http://purl.org/ontology/bibo/")
|
268
|
+
@query.select.where([:s, :p, BIBO.Document]).to_s.should ==
|
269
|
+
"SELECT * WHERE { ?s ?p <http://purl.org/ontology/bibo/Document> . }"
|
270
|
+
end
|
217
271
|
|
218
272
|
it "should support OPTIONAL" do
|
219
273
|
@query.select.where([:s, :p, :o]).optional([:s, RDF.type, :o], [:s, RDF::DC.abstract, :o]).to_s.should ==
|
220
274
|
"SELECT * WHERE { ?s ?p ?o . OPTIONAL { ?s <#{RDF.type}> ?o . ?s <#{RDF::DC.abstract}> ?o . } }"
|
221
275
|
end
|
222
276
|
|
277
|
+
it "should support OPTIONAL with GRAPH contexts" do
|
278
|
+
@graph1 = "http://example1.org/"
|
279
|
+
@graph2 = "http://example2.org/"
|
280
|
+
@query.select.where([:s, :p, :o, :context => @graph1]).optional([:s, RDF.type, RDF::DC.Document, :context => @graph2]).to_s.should ==
|
281
|
+
"SELECT * WHERE { GRAPH <#{@graph1}> { ?s ?p ?o . } OPTIONAL { GRAPH <#{@graph2}> { ?s <#{RDF.type}> <#{RDF::DC.Document}> . } } }"
|
282
|
+
end
|
283
|
+
|
223
284
|
it "should support multiple OPTIONALs" do
|
224
285
|
@query.select.where([:s, :p, :o]).optional([:s, RDF.type, :o]).optional([:s, RDF::DC.abstract, :o]).to_s.should ==
|
225
286
|
"SELECT * WHERE { ?s ?p ?o . OPTIONAL { ?s <#{RDF.type}> ?o . } OPTIONAL { ?s <#{RDF::DC.abstract}> ?o . } }"
|
@@ -234,7 +295,13 @@ describe RDF::Virtuoso::Query do
|
|
234
295
|
@query.select.where([:s, :p, :o]).minus([:s, RDF.type, :o]).minus([:s, RDF::DC.abstract, :o]).to_s.should ==
|
235
296
|
"SELECT * WHERE { ?s ?p ?o . MINUS { ?s <#{RDF.type}> ?o . } MINUS { ?s <#{RDF::DC.abstract}> ?o . } }"
|
236
297
|
end
|
237
|
-
|
298
|
+
|
299
|
+
it "should support MINUS with a GRAPH context" do
|
300
|
+
@graph1 = "http://example1.org/"
|
301
|
+
@query.select.where([:s, :p, :o]).minus([:s, RDF.type, :o, :context => @graph1]).to_s.should ==
|
302
|
+
"SELECT * WHERE { ?s ?p ?o . MINUS { GRAPH <#{@graph1}> { ?s <#{RDF.type}> ?o . } } }"
|
303
|
+
end
|
304
|
+
|
238
305
|
it "should support UNION" do
|
239
306
|
@query.select.where([:s, RDF::DC.abstract, :o]).union([:s, RDF.type, :o]).to_s.should ==
|
240
307
|
"SELECT * WHERE { { ?s <#{RDF::DC.abstract}> ?o . } UNION { ?s <#{RDF.type}> ?o . } }"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-virtuoso
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.14
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-
|
13
|
+
date: 2012-09-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|
@@ -197,25 +197,25 @@ extensions: []
|
|
197
197
|
extra_rdoc_files: []
|
198
198
|
files:
|
199
199
|
- README.md
|
200
|
-
- lib/
|
200
|
+
- lib/rdf/virtuoso.rb
|
201
201
|
- lib/rdf/virtuoso/version.rb
|
202
|
-
- lib/rdf/virtuoso/
|
202
|
+
- lib/rdf/virtuoso/parser.rb
|
203
203
|
- lib/rdf/virtuoso/prefixes.rb
|
204
204
|
- lib/rdf/virtuoso/repository.rb
|
205
|
-
- lib/rdf/virtuoso/
|
206
|
-
- lib/
|
207
|
-
- lib/active_rdf/persistence.rb
|
208
|
-
- lib/active_rdf/reflections.rb
|
205
|
+
- lib/rdf/virtuoso/query.rb
|
206
|
+
- lib/active_rdf.rb
|
209
207
|
- lib/active_rdf/version.rb
|
210
|
-
- lib/active_rdf/
|
208
|
+
- lib/active_rdf/reflections.rb
|
211
209
|
- lib/active_rdf/association_reflection.rb
|
212
|
-
- lib/active_rdf/
|
210
|
+
- lib/active_rdf/persistence.rb
|
211
|
+
- lib/active_rdf/errors.rb
|
213
212
|
- lib/active_rdf/model.rb
|
213
|
+
- lib/active_rdf/exceptions.rb
|
214
214
|
- spec/repository_spec.rb
|
215
|
-
- spec/prefixes_spec.rb
|
216
215
|
- spec/query_spec.rb
|
217
216
|
- spec/spec_helper.rb
|
218
217
|
- spec/active_rdf/persistence_spec.rb
|
218
|
+
- spec/prefixes_spec.rb
|
219
219
|
homepage: https://github.com/digibib/rdf-virtuoso
|
220
220
|
licenses: []
|
221
221
|
post_install_message:
|