rdf-spec 0.2.0 → 0.2.1
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/CONTRIBUTORS +2 -0
- data/README +9 -3
- data/VERSION +1 -1
- data/lib/rdf/spec/enumerable.rb +4 -4
- data/lib/rdf/spec/format.rb +8 -0
- data/lib/rdf/spec/literal.rb +307 -13
- data/lib/rdf/spec/mutable.rb +2 -2
- data/lib/rdf/spec/queryable.rb +3 -3
- data/lib/rdf/spec/reader.rb +8 -0
- data/lib/rdf/spec/statement.rb +3 -4
- data/lib/rdf/spec/version.rb +1 -1
- data/lib/rdf/spec/writer.rb +8 -0
- data/spec/version_spec.rb +7 -0
- metadata +19 -14
data/CONTRIBUTORS
ADDED
data/README
CHANGED
@@ -15,7 +15,7 @@ Documentation
|
|
15
15
|
Dependencies
|
16
16
|
------------
|
17
17
|
|
18
|
-
* [RDF.rb](http://gemcutter.org/gems/rdf) (>= 0.2.
|
18
|
+
* [RDF.rb](http://gemcutter.org/gems/rdf) (>= 0.2.1)
|
19
19
|
* [RSpec](http://gemcutter.org/gems/rspec) (>= 1.3.0)
|
20
20
|
|
21
21
|
Installation
|
@@ -38,12 +38,18 @@ as follows:
|
|
38
38
|
|
39
39
|
% wget http://github.com/bendiken/rdf-spec/tarball/master
|
40
40
|
|
41
|
-
|
42
|
-
|
41
|
+
Authors
|
42
|
+
-------
|
43
43
|
|
44
44
|
* [Arto Bendiken](mailto:arto.bendiken@gmail.com) - <http://ar.to/>
|
45
45
|
* [Ben Lavender](mailto:blavender@gmail.com) - <http://bhuga.net/>
|
46
46
|
|
47
|
+
Contributors
|
48
|
+
------------
|
49
|
+
|
50
|
+
* [Gregg Kellogg](mailto:gregg@kellogg-assoc.com) - <http://kellogg-assoc.com/>
|
51
|
+
* [John Fieber](mailto:jrf@ursamaris.org) - <http://github.com/jfieber>
|
52
|
+
|
47
53
|
License
|
48
54
|
-------
|
49
55
|
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.1
|
data/lib/rdf/spec/enumerable.rb
CHANGED
@@ -217,7 +217,7 @@ share_as :RDF_Enumerable do
|
|
217
217
|
@enumerable.each_subject.to_a.size.should == subjects.size
|
218
218
|
@enumerable.each_subject do |value|
|
219
219
|
value.should be_a_value
|
220
|
-
subjects.should include
|
220
|
+
subjects.should include(value)
|
221
221
|
end
|
222
222
|
end
|
223
223
|
|
@@ -267,7 +267,7 @@ share_as :RDF_Enumerable do
|
|
267
267
|
@enumerable.each_predicate.to_a.size.should == predicates.size
|
268
268
|
@enumerable.each_predicate do |value|
|
269
269
|
value.should be_a_uri
|
270
|
-
predicates.should include
|
270
|
+
predicates.should include(value)
|
271
271
|
end
|
272
272
|
end
|
273
273
|
|
@@ -317,7 +317,7 @@ share_as :RDF_Enumerable do
|
|
317
317
|
@enumerable.each_object.to_a.size.should == objects.size
|
318
318
|
@enumerable.each_object do |value|
|
319
319
|
value.should be_a_value
|
320
|
-
objects.should include
|
320
|
+
objects.should include(value)
|
321
321
|
end
|
322
322
|
end
|
323
323
|
|
@@ -368,7 +368,7 @@ share_as :RDF_Enumerable do
|
|
368
368
|
@enumerable.each_context.to_a.size.should == contexts.size
|
369
369
|
@enumerable.each_context do |value|
|
370
370
|
value.should be_a_resource
|
371
|
-
contexts.should include
|
371
|
+
contexts.should include(value)
|
372
372
|
end
|
373
373
|
end
|
374
374
|
|
data/lib/rdf/spec/literal.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# coding: utf-8
|
1
2
|
require 'rdf'
|
2
3
|
require 'rdf/spec'
|
3
4
|
|
@@ -48,8 +49,8 @@ share_as :RDF_Literal do
|
|
48
49
|
end
|
49
50
|
|
50
51
|
it "should have a string representation" do
|
51
|
-
@empty.to_s.should eql(
|
52
|
-
@hello.to_s.should eql(
|
52
|
+
@empty.to_s.should eql("")
|
53
|
+
@hello.to_s.should eql("Hello")
|
53
54
|
end
|
54
55
|
|
55
56
|
it "should not be #anonymous?" do
|
@@ -91,8 +92,18 @@ share_as :RDF_Literal do
|
|
91
92
|
end
|
92
93
|
|
93
94
|
it "should have a string representation" do
|
94
|
-
@empty.to_s.should eql(
|
95
|
-
@hello.to_s.should eql(
|
95
|
+
@empty.to_s.should eql("")
|
96
|
+
@hello.to_s.should eql("Hello")
|
97
|
+
end
|
98
|
+
|
99
|
+
context "c18n" do
|
100
|
+
it "should normalize language to lower-case" do
|
101
|
+
@new.call('Upper', :language => :EN, :canonicalize => true).language.should == :en
|
102
|
+
end
|
103
|
+
|
104
|
+
it "should support sub-taged language specification" do
|
105
|
+
@new.call('Hi', :language => :"en-us", :canonicalize => true).language.should == :"en-us"
|
106
|
+
end
|
96
107
|
end
|
97
108
|
end
|
98
109
|
|
@@ -106,9 +117,9 @@ share_as :RDF_Literal do
|
|
106
117
|
@int = @new.call(123)
|
107
118
|
@long = @new.call(9223372036854775807)
|
108
119
|
@double = @new.call(3.1415)
|
109
|
-
@time = @new.call(Time.now)
|
110
120
|
@date = @new.call(Date.new(2010))
|
111
121
|
@datetime = @new.call(DateTime.new(2010))
|
122
|
+
@time = @new.call(Time.parse('01:02:03Z'))
|
112
123
|
@all = [@false, @true, @int, @long, @double, @time, @date, @datetime]
|
113
124
|
end
|
114
125
|
|
@@ -137,9 +148,9 @@ share_as :RDF_Literal do
|
|
137
148
|
@int.datatype.should == XSD.integer
|
138
149
|
@long.datatype.should == XSD.integer
|
139
150
|
@double.datatype.should == XSD.double
|
140
|
-
@time.datatype.should == XSD.dateTime
|
141
151
|
@date.datatype.should == XSD.date
|
142
152
|
@datetime.datatype.should == XSD.dateTime
|
153
|
+
@time.datatype.should == XSD.time
|
143
154
|
end
|
144
155
|
|
145
156
|
it "should support equality comparisons" do
|
@@ -151,14 +162,297 @@ share_as :RDF_Literal do
|
|
151
162
|
end
|
152
163
|
|
153
164
|
it "should have a string representation" do
|
154
|
-
@false.to_s.should eql(
|
155
|
-
@true.to_s.should eql(
|
156
|
-
@int.to_s.should eql(
|
157
|
-
@long.to_s.should eql(
|
158
|
-
@double.to_s.should eql(
|
159
|
-
@date.to_s.should eql(
|
160
|
-
@datetime.to_s.should eql(
|
165
|
+
@false.to_s.should eql("false")
|
166
|
+
@true.to_s.should eql("true")
|
167
|
+
@int.to_s.should eql("123")
|
168
|
+
@long.to_s.should eql("9223372036854775807")
|
169
|
+
@double.to_s.should eql("3.1415")
|
170
|
+
@date.to_s.should eql("2010-01-01Z")
|
171
|
+
@datetime.to_s.should eql("2010-01-01T00:00:00Z")
|
172
|
+
@time.to_s.should eql("01:02:03Z")
|
173
|
+
end
|
174
|
+
|
175
|
+
it "should have an object representation" do
|
176
|
+
@false.object.should eql(false)
|
177
|
+
@true.object.should eql(true)
|
178
|
+
@int.object.should eql(123)
|
179
|
+
@long.object.should eql(9223372036854775807)
|
180
|
+
@double.object.should eql(3.1415)
|
181
|
+
@date.object.should eql(Date.new(2010))
|
182
|
+
@datetime.object.should eql(DateTime.new(2010))
|
183
|
+
@time.object.should eql(Time.parse('01:02:03Z'))
|
161
184
|
end
|
162
185
|
end
|
163
186
|
|
187
|
+
#require 'nokogiri' rescue nil
|
188
|
+
describe "XML Literal" do
|
189
|
+
describe "with no namespace" do
|
190
|
+
subject { @new.call("foo <sup>bar</sup> baz!", :datatype => RDF.XMLLiteral) }
|
191
|
+
it "should indicate xmlliteral?" do
|
192
|
+
subject.xmlliteral?.should == true
|
193
|
+
end
|
194
|
+
|
195
|
+
describe "encodings" do
|
196
|
+
it "should return n3" do subject.to_s.should == "\"foo <sup>bar</sup> baz!\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
|
197
|
+
end
|
198
|
+
|
199
|
+
it "should be equal if they have the same contents" do
|
200
|
+
should == @new.call("foo <sup>bar</sup> baz!", :datatype => RDF.XMLLiteral)
|
201
|
+
end
|
202
|
+
|
203
|
+
it "should be a XMLLiteral encoding" do
|
204
|
+
subject.datatype.should == RDF.XMLLiteral
|
205
|
+
end
|
206
|
+
end
|
207
|
+
|
208
|
+
describe "with a namespace" do
|
209
|
+
subject {
|
210
|
+
@new.call("foo <sup>bar</sup> baz!", :datatype => RDF.XMLLiteral,
|
211
|
+
:namespaces => {"dc" => RDF::DC.to_s})
|
212
|
+
}
|
213
|
+
|
214
|
+
describe "encodings" do
|
215
|
+
it "should return n3" do subject.to_s.should == "\"foo <sup>bar</sup> baz!\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
|
216
|
+
end
|
217
|
+
|
218
|
+
describe "and language" do
|
219
|
+
subject {
|
220
|
+
@new.call("foo <sup>bar</sup> baz!", :datatype => RDF.XMLLiteral,
|
221
|
+
:namespaces => {"dc" => RDF::DC.to_s},
|
222
|
+
:language => :fr)
|
223
|
+
}
|
224
|
+
|
225
|
+
describe "encodings" do
|
226
|
+
it "should return n3" do subject.to_s.should == "\"foo <sup xml:lang=\\\"fr\\\">bar</sup> baz!\"\^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
|
227
|
+
end
|
228
|
+
end
|
229
|
+
|
230
|
+
describe "and language with an existing language embedded" do
|
231
|
+
subject {
|
232
|
+
@new.call("foo <sup>bar</sup><sub xml:lang=\"en\">baz</sub>",
|
233
|
+
:datatype => RDF.XMLLiteral,
|
234
|
+
:language => :fr)
|
235
|
+
}
|
236
|
+
|
237
|
+
describe "encodings" do
|
238
|
+
it "should return n3" do subject.to_s.should == "\"foo <sup xml:lang=\\\"fr\\\">bar</sup><sub xml:lang=\\\"en\\\">baz</sub>\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
|
239
|
+
end
|
240
|
+
end
|
241
|
+
end
|
242
|
+
|
243
|
+
describe "with a default namespace" do
|
244
|
+
subject {
|
245
|
+
R@new.call("foo <sup>bar</sup> baz!", :datatype => RDF.XMLLiteral,
|
246
|
+
:namespaces => {"" => RDF::DC.to_s})
|
247
|
+
}
|
248
|
+
|
249
|
+
describe "encodings" do
|
250
|
+
it "should return n3" do subject.to_s.should == "\"foo <sup xmlns=\\\"http://purl.org/dc/terms/\\\">bar</sup> baz!\"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>" end
|
251
|
+
end
|
252
|
+
end
|
253
|
+
|
254
|
+
describe "with multiple namespaces" do
|
255
|
+
subject {
|
256
|
+
@new.call("foo <sup xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">bar</sup> baz!", :datatype => RDF.XMLLiteral)
|
257
|
+
}
|
258
|
+
it "should ignore namespace order" do
|
259
|
+
g = @new.call("foo <sup xmlns:dc=\"http://purl.org/dc/terms/\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">bar</sup> baz!", :datatype => RDF.XMLLiteral)
|
260
|
+
should == g
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end if defined?(::Nokogiri)
|
264
|
+
|
265
|
+
context "validation and c18n" do
|
266
|
+
{
|
267
|
+
"true" => "true",
|
268
|
+
"false" => "false",
|
269
|
+
"tRuE" => "true",
|
270
|
+
"FaLsE" => "false",
|
271
|
+
"1" => "true",
|
272
|
+
"0" => "false",
|
273
|
+
}.each_pair do |lit, str|
|
274
|
+
it "should validate boolean '#{lit}'" do
|
275
|
+
@new.call(lit, :datatype => RDF::XSD.boolean).valid?.should be_true
|
276
|
+
end
|
277
|
+
|
278
|
+
it "should not canonicalize boolean '#{lit}' by default" do
|
279
|
+
@new.call(lit, :datatype => RDF::XSD.boolean, :canonicalize => false).to_s.should == lit
|
280
|
+
end
|
281
|
+
|
282
|
+
it "should canonicalize boolean '#{lit}'" do
|
283
|
+
@new.call(lit, :datatype => RDF::XSD.boolean, :canonicalize => true).to_s.should == str
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
{
|
288
|
+
"01" => "1",
|
289
|
+
"1" => "1",
|
290
|
+
"-1" => "-1",
|
291
|
+
"+1" => "1",
|
292
|
+
}.each_pair do |lit, str|
|
293
|
+
it "should validate integer '#{lit}'" do
|
294
|
+
@new.call(lit, :datatype => RDF::XSD.integer).valid?.should be_true
|
295
|
+
end
|
296
|
+
|
297
|
+
it "should not canonicalize integer '#{lit}' by default" do
|
298
|
+
@new.call(lit, :datatype => RDF::XSD.integer, :canonicalize => false).to_s.should == lit
|
299
|
+
end
|
300
|
+
|
301
|
+
it "should canonicalize integer '#{lit}'" do
|
302
|
+
@new.call(lit, :datatype => RDF::XSD.integer, :canonicalize => true).to_s.should == str
|
303
|
+
end
|
304
|
+
end
|
305
|
+
|
306
|
+
{
|
307
|
+
"1" => "1.0",
|
308
|
+
"-1" => "-1.0",
|
309
|
+
"1." => "1.0",
|
310
|
+
"1.0" => "1.0",
|
311
|
+
"1.00" => "1.0",
|
312
|
+
"+001.00" => "1.0",
|
313
|
+
"123.456" => "123.456",
|
314
|
+
"2.345" => "2.345",
|
315
|
+
"1.000000000" => "1.0",
|
316
|
+
"2.3" => "2.3",
|
317
|
+
"2.234000005" => "2.234000005",
|
318
|
+
"2.2340000000000005" => "2.2340000000000005",
|
319
|
+
"2.23400000000000005" => "2.234",
|
320
|
+
"2.23400000000000000000005" => "2.234",
|
321
|
+
"1.2345678901234567890123457890" => "1.2345678901234567",
|
322
|
+
}.each_pair do |lit, str|
|
323
|
+
it "should validate decimal '#{lit}'" do
|
324
|
+
@new.call(lit, :datatype => RDF::XSD.decimal).valid?.should be_true
|
325
|
+
end
|
326
|
+
|
327
|
+
it "should not canonicalize decimal '#{lit}' by default" do
|
328
|
+
@new.call(lit, :datatype => RDF::XSD.decimal, :canonicalize => false).to_s.should == lit
|
329
|
+
end
|
330
|
+
|
331
|
+
it "should canonicalize decimal '#{lit}'" do
|
332
|
+
@new.call(lit, :datatype => RDF::XSD.decimal, :canonicalize => true).to_s.should == str
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
{
|
337
|
+
"1" => "1.0E0",
|
338
|
+
"-1" => "-1.0E0",
|
339
|
+
"+01.000" => "1.0E0",
|
340
|
+
#"1." => "1.0E0",
|
341
|
+
"1.0" => "1.0E0",
|
342
|
+
"123.456" => "1.23456E2",
|
343
|
+
"1.0e+1" => "1.0E1",
|
344
|
+
"1.0e-10" => "1.0E-10",
|
345
|
+
"123.456e4" => "1.23456E6",
|
346
|
+
}.each_pair do |lit, str|
|
347
|
+
it "should validate double '#{lit}'" do
|
348
|
+
@new.call(lit, :datatype => RDF::XSD.double).valid?.should be_true
|
349
|
+
end
|
350
|
+
|
351
|
+
it "should not canonicalize double '#{lit}' by default" do
|
352
|
+
@new.call(lit, :datatype => RDF::XSD.double, :canonicalize => false).to_s.should == lit
|
353
|
+
end
|
354
|
+
|
355
|
+
it "should canonicalize double '#{lit}'" do
|
356
|
+
@new.call(lit, :datatype => RDF::XSD.double, :canonicalize => true).to_s.should == str
|
357
|
+
end
|
358
|
+
end
|
359
|
+
|
360
|
+
# DateTime
|
361
|
+
{
|
362
|
+
"2010-01-01T00:00:00Z" => "2010-01-01T00:00:00Z",
|
363
|
+
"2010-01-01T00:00:00.0000Z" => "2010-01-01T00:00:00Z",
|
364
|
+
"2010-01-01T00:00:00" => "2010-01-01T00:00:00Z",
|
365
|
+
"2010-01-01T00:00:00+00:00" => "2010-01-01T00:00:00Z",
|
366
|
+
"2010-01-01T01:00:00+01:00" => "2010-01-01T01:00:00+01:00",
|
367
|
+
"2009-12-31T23:00:00-01:00" => "2009-12-31T23:00:00-01:00",
|
368
|
+
"-2010-01-01T00:00:00Z" => "-2010-01-01T00:00:00Z",
|
369
|
+
}.each_pair do |lit, str|
|
370
|
+
it "should validate dateTime '#{lit}'" do
|
371
|
+
@new.call(lit, :datatype => RDF::XSD.dateTime).valid?.should be_true
|
372
|
+
end
|
373
|
+
|
374
|
+
it "should not canonicalize dateTime '#{lit}' by default" do
|
375
|
+
@new.call(lit, :datatype => RDF::XSD.dateTime, :canonicalize => false).to_s.should == lit
|
376
|
+
end
|
377
|
+
|
378
|
+
it "should canonicalize dateTime '#{lit}'" do
|
379
|
+
@new.call(lit, :datatype => RDF::XSD.dateTime, :canonicalize => true).to_s.should == str
|
380
|
+
end
|
381
|
+
end
|
382
|
+
|
383
|
+
# Date
|
384
|
+
{
|
385
|
+
"2010-01-01Z" => "2010-01-01Z",
|
386
|
+
"2010-01-01" => "2010-01-01Z",
|
387
|
+
"2010-01-01+00:00" => "2010-01-01Z",
|
388
|
+
"2010-01-01+01:00" => "2010-01-01Z",
|
389
|
+
"2009-12-31-01:00" => "2009-12-31Z",
|
390
|
+
"-2010-01-01Z" => "-2010-01-01Z",
|
391
|
+
}.each_pair do |lit, str|
|
392
|
+
it "should validate date '#{lit}'" do
|
393
|
+
@new.call(lit, :datatype => RDF::XSD.date).valid?.should be_true
|
394
|
+
end
|
395
|
+
|
396
|
+
it "should not canonicalize date '#{lit}' by default" do
|
397
|
+
@new.call(lit, :datatype => RDF::XSD.date, :canonicalize => false).to_s.should == lit
|
398
|
+
end
|
399
|
+
|
400
|
+
it "should canonicalize date '#{lit}'" do
|
401
|
+
@new.call(lit, :datatype => RDF::XSD.date, :canonicalize => true).to_s.should == str
|
402
|
+
end
|
403
|
+
end
|
404
|
+
|
405
|
+
|
406
|
+
# Time
|
407
|
+
{
|
408
|
+
"00:00:00Z" => "00:00:00Z",
|
409
|
+
"00:00:00.0000Z" => "00:00:00Z",
|
410
|
+
"00:00:00" => "00:00:00Z",
|
411
|
+
"00:00:00+00:00" => "00:00:00Z",
|
412
|
+
"01:00:00+01:00" => "00:00:00Z",
|
413
|
+
"23:00:00-01:00" => "00:00:00Z",
|
414
|
+
}.each_pair do |lit, str|
|
415
|
+
it "should validate time '#{lit}'" do
|
416
|
+
@new.call(lit, :datatype => RDF::XSD.time).valid?.should be_true
|
417
|
+
end
|
418
|
+
|
419
|
+
it "should not canonicalize dateTime '#{lit}' by default" do
|
420
|
+
@new.call(lit, :datatype => RDF::XSD.time, :canonicalize => false).to_s.should == lit
|
421
|
+
end
|
422
|
+
|
423
|
+
it "should canonicalize dateTime '#{lit}'" do
|
424
|
+
@new.call(lit, :datatype => RDF::XSD.time, :canonicalize => true).to_s.should == str
|
425
|
+
end
|
426
|
+
end
|
427
|
+
|
428
|
+
# Invalid
|
429
|
+
{
|
430
|
+
"foo" => RDF::XSD.boolean,
|
431
|
+
"xyz" => RDF::XSD.integer,
|
432
|
+
"12xyz" => RDF::XSD.integer,
|
433
|
+
"12.xyz" => RDF::XSD.decimal,
|
434
|
+
"xy.z" => RDF::XSD.double,
|
435
|
+
"+1.0z" => RDF::XSD.double,
|
436
|
+
|
437
|
+
"+2010-01-01T00:00:00Z" => RDF::XSD.dateTime,
|
438
|
+
"2010-01-01T00:00:00FOO" => RDF::XSD.dateTime,
|
439
|
+
"02010-01-01T00:00:00" => RDF::XSD.dateTime,
|
440
|
+
"2010-01-01" => RDF::XSD.dateTime,
|
441
|
+
"2010-1-1T00:00:00" => RDF::XSD.dateTime,
|
442
|
+
"0000-01-01T00:00:00" => RDF::XSD.dateTime,
|
443
|
+
|
444
|
+
"+2010-01-01Z" => RDF::XSD.date,
|
445
|
+
"2010-01-01TFOO" => RDF::XSD.date,
|
446
|
+
"02010-01-01" => RDF::XSD.date,
|
447
|
+
"2010-1-1" => RDF::XSD.date,
|
448
|
+
"0000-01-01" => RDF::XSD.date,
|
449
|
+
|
450
|
+
"+00:00:00Z" => RDF::XSD.time,
|
451
|
+
"-00:00:00Z" => RDF::XSD.time,
|
452
|
+
}.each_pair do |value, datatype|
|
453
|
+
it "should detect invalid encoding for '#{value}'" do
|
454
|
+
@new.call(value, :datatype => datatype).valid?.should be_false
|
455
|
+
end
|
456
|
+
end
|
457
|
+
end
|
164
458
|
end
|
data/lib/rdf/spec/mutable.rb
CHANGED
@@ -55,12 +55,12 @@ share_as :RDF_Mutable do
|
|
55
55
|
it "should load statements" do
|
56
56
|
@mutable.load @filename
|
57
57
|
@mutable.size.should == File.readlines(@filename).size
|
58
|
-
@mutable.should have_subject
|
58
|
+
@mutable.should have_subject(@subject)
|
59
59
|
end
|
60
60
|
|
61
61
|
it "should load statements with a context override" do
|
62
62
|
@mutable.load @filename, :context => @context
|
63
|
-
@mutable.should have_context
|
63
|
+
@mutable.should have_context(@context)
|
64
64
|
@mutable.query(:context => @context).size.should == @mutable.size
|
65
65
|
end
|
66
66
|
end
|
data/lib/rdf/spec/queryable.rb
CHANGED
@@ -76,15 +76,15 @@ share_as :RDF_Queryable do
|
|
76
76
|
|
77
77
|
context "#query when called without a block" do
|
78
78
|
it "should return an enumerator" do
|
79
|
-
@queryable.query([nil, nil, nil]).should
|
79
|
+
@queryable.query([nil, nil, nil]).should be_an_enumerator
|
80
80
|
end
|
81
81
|
|
82
82
|
it "should return an enumerable enumerator" do
|
83
|
-
@queryable.query([nil, nil, nil]).should
|
83
|
+
@queryable.query([nil, nil, nil]).should be_enumerable
|
84
84
|
end
|
85
85
|
|
86
86
|
it "should return a queryable enumerator" do
|
87
|
-
@queryable.query([nil, nil, nil]).should
|
87
|
+
@queryable.query([nil, nil, nil]).should be_queryable
|
88
88
|
end
|
89
89
|
|
90
90
|
it "should return statements" do
|
data/lib/rdf/spec/statement.rb
CHANGED
@@ -191,7 +191,7 @@ share_as :RDF_Statement do
|
|
191
191
|
end
|
192
192
|
|
193
193
|
it "should not be eql? with differing contexts" do
|
194
|
-
@stmt.should_not be_eql
|
194
|
+
@stmt.should_not be_eql(@other_stmt)
|
195
195
|
end
|
196
196
|
|
197
197
|
it "should match (===) a statement with a missing component to one with that component" do
|
@@ -204,9 +204,8 @@ share_as :RDF_Statement do
|
|
204
204
|
|
205
205
|
it "should only equals? with object equality" do
|
206
206
|
@same_stmt = RDF::Statement.new @s, @p, @o
|
207
|
-
@stmt.should_not equal
|
208
|
-
@stmt.should equal
|
207
|
+
@stmt.should_not equal(@same_stmt)
|
208
|
+
@stmt.should equal(@stmt)
|
209
209
|
end
|
210
|
-
|
211
210
|
end
|
212
211
|
end
|
data/lib/rdf/spec/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 2
|
8
|
-
-
|
9
|
-
version: 0.2.
|
8
|
+
- 1
|
9
|
+
version: 0.2.1
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Arto Bendiken
|
@@ -15,21 +15,21 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-06-
|
18
|
+
date: 2010-06-28 00:00:00 +02:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
-
name:
|
22
|
+
name: yard
|
23
23
|
prerelease: false
|
24
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
|
-
- -
|
26
|
+
- - ">="
|
27
27
|
- !ruby/object:Gem::Version
|
28
28
|
segments:
|
29
29
|
- 0
|
30
|
-
-
|
31
|
-
-
|
32
|
-
version: 0.
|
30
|
+
- 5
|
31
|
+
- 8
|
32
|
+
version: 0.5.8
|
33
33
|
type: :development
|
34
34
|
version_requirements: *id001
|
35
35
|
- !ruby/object:Gem::Dependency
|
@@ -47,17 +47,17 @@ dependencies:
|
|
47
47
|
type: :development
|
48
48
|
version_requirements: *id002
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
|
-
name:
|
50
|
+
name: rdf
|
51
51
|
prerelease: false
|
52
52
|
requirement: &id003 !ruby/object:Gem::Requirement
|
53
53
|
requirements:
|
54
|
-
- -
|
54
|
+
- - ~>
|
55
55
|
- !ruby/object:Gem::Version
|
56
56
|
segments:
|
57
57
|
- 0
|
58
|
-
-
|
59
|
-
-
|
60
|
-
version: 0.
|
58
|
+
- 2
|
59
|
+
- 1
|
60
|
+
version: 0.2.1
|
61
61
|
type: :development
|
62
62
|
version_requirements: *id003
|
63
63
|
- !ruby/object:Gem::Dependency
|
@@ -75,7 +75,7 @@ dependencies:
|
|
75
75
|
type: :runtime
|
76
76
|
version_requirements: *id004
|
77
77
|
description: RDF.rb plugin that provides RSpec matchers and shared examples for RDF objects.
|
78
|
-
email:
|
78
|
+
email: public-rdf-ruby@w3.org
|
79
79
|
executables: []
|
80
80
|
|
81
81
|
extensions: []
|
@@ -84,6 +84,7 @@ extra_rdoc_files: []
|
|
84
84
|
|
85
85
|
files:
|
86
86
|
- AUTHORS
|
87
|
+
- CONTRIBUTORS
|
87
88
|
- README
|
88
89
|
- UNLICENSE
|
89
90
|
- VERSION
|
@@ -91,23 +92,27 @@ files:
|
|
91
92
|
- lib/rdf/spec/countable.rb
|
92
93
|
- lib/rdf/spec/durable.rb
|
93
94
|
- lib/rdf/spec/enumerable.rb
|
95
|
+
- lib/rdf/spec/format.rb
|
94
96
|
- lib/rdf/spec/graph.rb
|
95
97
|
- lib/rdf/spec/literal.rb
|
96
98
|
- lib/rdf/spec/matchers.rb
|
97
99
|
- lib/rdf/spec/mutable.rb
|
98
100
|
- lib/rdf/spec/node.rb
|
99
101
|
- lib/rdf/spec/queryable.rb
|
102
|
+
- lib/rdf/spec/reader.rb
|
100
103
|
- lib/rdf/spec/repository.rb
|
101
104
|
- lib/rdf/spec/statement.rb
|
102
105
|
- lib/rdf/spec/uri.rb
|
103
106
|
- lib/rdf/spec/value.rb
|
104
107
|
- lib/rdf/spec/version.rb
|
108
|
+
- lib/rdf/spec/writer.rb
|
105
109
|
- lib/rdf/spec.rb
|
106
110
|
- spec/countable_spec.rb
|
107
111
|
- spec/enumerable_spec.rb
|
108
112
|
- spec/queryable_spec.rb
|
109
113
|
- spec/repository_spec.rb
|
110
114
|
- spec/spec_helper.rb
|
115
|
+
- spec/version_spec.rb
|
111
116
|
has_rdoc: false
|
112
117
|
homepage: http://rdf.rubyforge.org/spec/
|
113
118
|
licenses:
|