rdf-spec 1.0.5 → 1.0.6
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/AUTHORS +1 -1
- data/README +23 -16
- data/VERSION +1 -1
- data/etc/bendiken.nq +8 -8
- data/etc/bhuga.nq +6 -6
- data/etc/doap.nt +39 -39
- data/etc/gkellogg.nq +6 -5
- data/etc/quads.nq +95 -0
- data/etc/test-data.nt +0 -1
- data/etc/{doap.nq → triples.nt} +76 -73
- data/lib/rdf/spec.rb +20 -0
- data/lib/rdf/spec/countable.rb +21 -26
- data/lib/rdf/spec/durable.rb +8 -12
- data/lib/rdf/spec/enumerable.rb +301 -328
- data/lib/rdf/spec/format.rb +3 -2
- data/lib/rdf/spec/indexable.rb +6 -13
- data/lib/rdf/spec/mutable.rb +62 -49
- data/lib/rdf/spec/queryable.rb +109 -144
- data/lib/rdf/spec/readable.rb +3 -7
- data/lib/rdf/spec/repository.rb +15 -26
- data/lib/rdf/spec/writable.rb +68 -55
- metadata +38 -44
- data/etc/bendiken.nt +0 -8
- data/etc/bendiken.ttl +0 -17
- data/etc/bhuga.nt +0 -6
- data/etc/bhuga.ttl +0 -15
- data/etc/doap.ttl +0 -79
- data/etc/gkellogg.nt +0 -5
- data/etc/gkellogg.ttl +0 -14
data/lib/rdf/spec/readable.rb
CHANGED
@@ -9,12 +9,8 @@ module RDF_Readable
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe RDF::Readable do
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
it "implements #readable?" do
|
17
|
-
!!@readable.readable?.should == @readable.readable?
|
18
|
-
end
|
12
|
+
subject {@readable}
|
13
|
+
it {should respond_to(:readable?)}
|
14
|
+
its(:readable?) {should == subject.readable?}
|
19
15
|
end
|
20
16
|
end
|
data/lib/rdf/spec/repository.rb
CHANGED
@@ -6,61 +6,50 @@ module RDF_Repository
|
|
6
6
|
|
7
7
|
before :each do
|
8
8
|
raise '+@repository+ must be defined in a before(:each) block' unless instance_variable_get('@repository')
|
9
|
-
@
|
10
|
-
@
|
9
|
+
@statements = RDF::Spec.quads
|
10
|
+
if @repository.empty? && @repository.writable?
|
11
|
+
@repository.insert(*@statements)
|
12
|
+
elsif @repository.empty?
|
13
|
+
raise "+@repository+ must respond to #<< or be pre-populated with the statements in #{RDF::Spec::TRIPLES_FILE} in a before(:each) block"
|
14
|
+
end
|
15
|
+
@countable = @repository
|
11
16
|
@enumerable = @repository
|
17
|
+
@queryable = @repository
|
18
|
+
@mutable = @repository
|
12
19
|
end
|
13
20
|
|
14
21
|
describe RDF::Repository do
|
22
|
+
|
15
23
|
context "when counting statements" do
|
16
24
|
require 'rdf/spec/countable'
|
17
|
-
|
18
|
-
before :each do
|
19
|
-
@countable = @repository
|
20
|
-
@countable.insert(*@statements)
|
21
|
-
end
|
22
|
-
|
23
25
|
include RDF_Countable
|
24
26
|
end
|
25
27
|
|
26
28
|
context "when enumerating statements" do
|
27
29
|
require 'rdf/spec/enumerable'
|
28
|
-
|
29
|
-
before :each do
|
30
|
-
@enumerable = @repository
|
31
|
-
@enumerable.insert(*@statements)
|
32
|
-
end
|
33
|
-
|
34
30
|
include RDF_Enumerable
|
35
31
|
end
|
36
32
|
|
37
33
|
context "when querying statements" do
|
38
34
|
require 'rdf/spec/queryable'
|
39
|
-
|
40
|
-
before :each do
|
41
|
-
@queryable = @repository
|
42
|
-
@subject = RDF::URI.new('http://rubygems.org/gems/rdf')
|
43
|
-
end
|
44
|
-
|
45
35
|
include RDF_Queryable
|
46
36
|
end
|
47
37
|
|
38
|
+
# FIXME: This should be condition on the repository being mutable
|
48
39
|
context "when updating" do
|
49
40
|
require 'rdf/spec/mutable'
|
50
|
-
|
51
|
-
|
52
|
-
@mutable = @repository
|
53
|
-
@subject = RDF::URI.new('http://rubygems.org/gems/rdf')
|
54
|
-
@context = RDF::URI.new('http://example.org/context')
|
41
|
+
before(:each) do
|
42
|
+
@mutable.clear
|
55
43
|
end
|
56
|
-
|
57
44
|
include RDF_Mutable
|
58
45
|
end
|
59
46
|
|
47
|
+
# FIXME: This should be condition on the repository being mutable
|
60
48
|
context "as a durable repository" do
|
61
49
|
require 'rdf/spec/durable'
|
62
50
|
|
63
51
|
before :each do
|
52
|
+
@repository.clear
|
64
53
|
@load_durable ||= lambda { @repository }
|
65
54
|
end
|
66
55
|
|
data/lib/rdf/spec/writable.rb
CHANGED
@@ -7,117 +7,130 @@ module RDF_Writable
|
|
7
7
|
before :each do
|
8
8
|
raise '+@writable+ must be defined in a before(:each) block' unless instance_variable_get('@writable')
|
9
9
|
|
10
|
-
@filename =
|
10
|
+
@filename = RDF::Spec::TRIPLES_FILE
|
11
11
|
@statements = RDF::NTriples::Reader.new(File.open(@filename)).to_a
|
12
12
|
|
13
13
|
@supports_context = @writable.respond_to?(:supports?) && @writable.supports?(:context)
|
14
14
|
end
|
15
15
|
|
16
16
|
describe RDF::Writable do
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
it "implements #writable?" do
|
22
|
-
!!@writable.writable?.should == @writable.writable?
|
23
|
-
end
|
17
|
+
subject {@writable}
|
18
|
+
let(:statement) {@statements.detect {|s| s.to_a.all? {|r| r.uri?}}}
|
19
|
+
let(:count) {@statements.size}
|
24
20
|
|
21
|
+
it {should respond_to(:writable?)}
|
22
|
+
its(:writable?) {should == !!subject.writable?}
|
23
|
+
|
25
24
|
describe "#<<" do
|
26
25
|
it "inserts a reader" do
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
26
|
+
pending("writability", :unless => subject.writable?) do
|
27
|
+
reader = RDF::NTriples::Reader.new(File.open(@filename)).to_a
|
28
|
+
subject << reader
|
29
|
+
subject.should have_statement(statement)
|
30
|
+
subject.count.should == count
|
31
|
+
end
|
31
32
|
end
|
32
33
|
|
33
34
|
it "inserts a graph" do
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
35
|
+
pending("writability", :unless => subject.writable?) do
|
36
|
+
graph = RDF::Graph.new << @statements
|
37
|
+
subject << graph
|
38
|
+
subject.should have_statement(statement)
|
39
|
+
subject.count.should == count
|
40
|
+
end
|
38
41
|
end
|
39
42
|
|
40
43
|
it "inserts an enumerable" do
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
44
|
+
pending("writability", :unless => subject.writable?) do
|
45
|
+
enumerable = @statements.dup.extend(RDF::Enumerable)
|
46
|
+
subject << enumerable
|
47
|
+
subject.should have_statement(statement)
|
48
|
+
subject.count.should == count
|
49
|
+
end
|
45
50
|
end
|
46
51
|
|
47
52
|
it "inserts data responding to #to_rdf" do
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
+
pending("writability", :unless => subject.writable?) do
|
54
|
+
mock = double('mock')
|
55
|
+
mock.stub(:to_rdf).and_return(@statements)
|
56
|
+
subject << mock
|
57
|
+
subject.should have_statement(statement)
|
58
|
+
subject.count.should == count
|
59
|
+
end
|
53
60
|
end
|
54
61
|
|
55
62
|
it "inserts a statement" do
|
56
|
-
|
57
|
-
|
58
|
-
|
63
|
+
pending("writability", :unless => subject.writable?) do
|
64
|
+
subject << statement
|
65
|
+
subject.should have_statement(statement)
|
66
|
+
subject.count.should == 1
|
67
|
+
end
|
59
68
|
end
|
60
69
|
|
61
70
|
it "inserts an invalid statement" do
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
71
|
+
pending("writability", :unless => subject.writable?) do
|
72
|
+
s = RDF::Statement.from([nil, nil, nil])
|
73
|
+
s.should_not be_valid
|
74
|
+
subject << s
|
75
|
+
subject.count.should == 1
|
76
|
+
end
|
66
77
|
end
|
67
78
|
end
|
68
79
|
|
69
80
|
context "when inserting statements" do
|
70
81
|
it "should support #insert" do
|
71
|
-
|
82
|
+
pending("writability", :unless => subject.writable?) do
|
83
|
+
subject.should respond_to(:insert)
|
84
|
+
end
|
72
85
|
end
|
73
86
|
|
74
87
|
it "should not raise errors" do
|
75
|
-
|
76
|
-
lambda {
|
88
|
+
pending("writability", :unless => subject.writable?) do
|
89
|
+
lambda { subject.insert(statement) }.should_not raise_error
|
77
90
|
end
|
78
91
|
end
|
79
92
|
|
80
93
|
it "should support inserting one statement at a time" do
|
81
|
-
|
82
|
-
|
83
|
-
|
94
|
+
pending("writability", :unless => subject.writable?) do
|
95
|
+
subject.insert(statement)
|
96
|
+
subject.should have_statement(statement)
|
84
97
|
end
|
85
98
|
end
|
86
99
|
|
87
100
|
it "should support inserting multiple statements at a time" do
|
88
|
-
|
89
|
-
|
101
|
+
pending("writability", :unless => subject.writable?) do
|
102
|
+
subject.insert(*@statements)
|
90
103
|
end
|
91
104
|
end
|
92
105
|
|
93
106
|
it "should insert statements successfully" do
|
94
|
-
|
95
|
-
|
96
|
-
|
107
|
+
pending("writability", :unless => subject.writable?) do
|
108
|
+
subject.insert(*@statements)
|
109
|
+
subject.count.should == count
|
97
110
|
end
|
98
111
|
end
|
99
112
|
|
100
113
|
it "should not insert a statement twice" do
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
114
|
+
pending("writability", :unless => subject.writable?) do
|
115
|
+
subject.insert(statement)
|
116
|
+
subject.insert(statement)
|
117
|
+
subject.count.should == 1
|
105
118
|
end
|
106
119
|
end
|
107
120
|
|
108
121
|
it "should treat statements with a different context as distinct" do
|
109
|
-
|
110
|
-
s1 =
|
122
|
+
pending("writability", :unless => subject.writable?) do
|
123
|
+
s1 = statement.dup
|
111
124
|
s1.context = nil
|
112
|
-
s2 =
|
125
|
+
s2 = statement.dup
|
113
126
|
s2.context = RDF::URI.new("urn:context:1")
|
114
|
-
s3 =
|
127
|
+
s3 = statement.dup
|
115
128
|
s3.context = RDF::URI.new("urn:context:2")
|
116
|
-
|
117
|
-
|
118
|
-
|
129
|
+
subject.insert(s1)
|
130
|
+
subject.insert(s2)
|
131
|
+
subject.insert(s3)
|
119
132
|
# If contexts are not suported, all three are redundant
|
120
|
-
|
133
|
+
subject.count.should == (@supports_context ? 3 : 1)
|
121
134
|
end
|
122
135
|
end
|
123
136
|
end
|
metadata
CHANGED
@@ -1,67 +1,68 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-spec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
5
|
-
prerelease:
|
4
|
+
version: 1.0.6
|
5
|
+
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Arto Bendiken
|
9
9
|
- Ben Lavender
|
10
10
|
- Gregg Kellogg
|
11
|
-
autorequire:
|
11
|
+
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2013-04-
|
14
|
+
date: 2013-04-29 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: rdf
|
18
|
-
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
none: false
|
19
20
|
requirements:
|
20
|
-
- -
|
21
|
+
- - ~>
|
21
22
|
- !ruby/object:Gem::Version
|
22
23
|
version: '1.0'
|
24
|
+
type: :development
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
27
|
none: false
|
24
|
-
requirement: !ruby/object:Gem::Requirement
|
25
28
|
requirements:
|
26
|
-
- -
|
29
|
+
- - ~>
|
27
30
|
- !ruby/object:Gem::Version
|
28
31
|
version: '1.0'
|
29
|
-
none: false
|
30
|
-
prerelease: false
|
31
|
-
type: :development
|
32
32
|
- !ruby/object:Gem::Dependency
|
33
33
|
name: rspec
|
34
|
-
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
35
|
+
none: false
|
35
36
|
requirements:
|
36
|
-
- -
|
37
|
+
- - ! '>='
|
37
38
|
- !ruby/object:Gem::Version
|
38
39
|
version: '2.12'
|
40
|
+
type: :runtime
|
41
|
+
prerelease: false
|
42
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
43
|
none: false
|
40
|
-
requirement: !ruby/object:Gem::Requirement
|
41
44
|
requirements:
|
42
|
-
- -
|
45
|
+
- - ! '>='
|
43
46
|
- !ruby/object:Gem::Version
|
44
47
|
version: '2.12'
|
45
|
-
none: false
|
46
|
-
prerelease: false
|
47
|
-
type: :runtime
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: yard
|
50
|
-
|
50
|
+
requirement: !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
51
52
|
requirements:
|
52
|
-
- -
|
53
|
+
- - ! '>='
|
53
54
|
- !ruby/object:Gem::Version
|
54
55
|
version: '0.8'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: !ruby/object:Gem::Requirement
|
55
59
|
none: false
|
56
|
-
requirement: !ruby/object:Gem::Requirement
|
57
60
|
requirements:
|
58
|
-
- -
|
61
|
+
- - ! '>='
|
59
62
|
- !ruby/object:Gem::Version
|
60
63
|
version: '0.8'
|
61
|
-
|
62
|
-
|
63
|
-
type: :development
|
64
|
-
description: RDF.rb plugin that provides RSpec matchers and shared examples for RDF objects.
|
64
|
+
description: RDF.rb plugin that provides RSpec matchers and shared examples for RDF
|
65
|
+
objects.
|
65
66
|
email: public-rdf-ruby@w3.org
|
66
67
|
executables: []
|
67
68
|
extensions: []
|
@@ -73,19 +74,12 @@ files:
|
|
73
74
|
- UNLICENSE
|
74
75
|
- VERSION
|
75
76
|
- etc/bendiken.nq
|
76
|
-
- etc/bendiken.nt
|
77
|
-
- etc/bendiken.ttl
|
78
77
|
- etc/bhuga.nq
|
79
|
-
- etc/bhuga.nt
|
80
|
-
- etc/bhuga.ttl
|
81
|
-
- etc/doap.nq
|
82
78
|
- etc/doap.nt
|
83
|
-
- etc/doap.ttl
|
84
79
|
- etc/gkellogg.nq
|
85
|
-
- etc/
|
86
|
-
- etc/gkellogg.ttl
|
80
|
+
- etc/quads.nq
|
87
81
|
- etc/test-data.nt
|
88
|
-
-
|
82
|
+
- etc/triples.nt
|
89
83
|
- lib/rdf/spec/countable.rb
|
90
84
|
- lib/rdf/spec/durable.rb
|
91
85
|
- lib/rdf/spec/enumerable.rb
|
@@ -102,32 +96,32 @@ files:
|
|
102
96
|
- lib/rdf/spec/version.rb
|
103
97
|
- lib/rdf/spec/writable.rb
|
104
98
|
- lib/rdf/spec/writer.rb
|
99
|
+
- lib/rdf/spec.rb
|
105
100
|
- spec/spec_helper.rb
|
106
101
|
- spec/version_spec.rb
|
107
102
|
homepage: http://github.com/ruby-rdf/rdf-spec/
|
108
103
|
licenses:
|
109
104
|
- Public Domain
|
110
|
-
post_install_message:
|
105
|
+
post_install_message:
|
111
106
|
rdoc_options: []
|
112
107
|
require_paths:
|
113
108
|
- lib
|
114
109
|
required_ruby_version: !ruby/object:Gem::Requirement
|
110
|
+
none: false
|
115
111
|
requirements:
|
116
|
-
- -
|
112
|
+
- - ! '>='
|
117
113
|
- !ruby/object:Gem::Version
|
118
114
|
version: 1.8.1
|
119
|
-
none: false
|
120
115
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
116
|
+
none: false
|
121
117
|
requirements:
|
122
|
-
- -
|
118
|
+
- - ! '>='
|
123
119
|
- !ruby/object:Gem::Version
|
124
|
-
version:
|
125
|
-
MA==
|
126
|
-
none: false
|
120
|
+
version: '0'
|
127
121
|
requirements: []
|
128
122
|
rubyforge_project: rdf
|
129
|
-
rubygems_version: 1.8.
|
130
|
-
signing_key:
|
123
|
+
rubygems_version: 1.8.25
|
124
|
+
signing_key:
|
131
125
|
specification_version: 3
|
132
126
|
summary: RSpec extensions for RDF.rb.
|
133
127
|
test_files: []
|
data/etc/bendiken.nt
DELETED
@@ -1,8 +0,0 @@
|
|
1
|
-
<http://ar.to/#self> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> .
|
2
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/name> "Arto Bendiken" .
|
3
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox> <mailto:arto.bendiken@gmail.com> .
|
4
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "d0737cceb55eb7d740578d2db1bc0727e3ed49ce" .
|
5
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/mbox_sha1sum> "a033f652c84a4d73b8c26d318c2395699dd2bdfb" .
|
6
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/homepage> <http://ar.to/> .
|
7
|
-
<http://ar.to/#self> <http://xmlns.com/foaf/0.1/made> <http://rubygems.org/gems/rdf> .
|
8
|
-
<http://ar.to/#self> <http://www.w3.org/2000/01/rdf-schema#isDefinedBy> <http://datagraph.org/bendiken/foaf> .
|
data/etc/bendiken.ttl
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
@base <http://rubygems.org/gems/rdf> .
|
2
|
-
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
3
|
-
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
4
|
-
@prefix dc: <http://purl.org/dc/terms/> .
|
5
|
-
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
6
|
-
@prefix doap: <http://usefulinc.com/ns/doap#> .
|
7
|
-
@prefix ex: <http://example.org/> .
|
8
|
-
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
9
|
-
|
10
|
-
<http://ar.to/#self> a foaf:Person ;
|
11
|
-
foaf:name "Arto Bendiken" ;
|
12
|
-
foaf:mbox <mailto:arto.bendiken@gmail.com> ;
|
13
|
-
foaf:mbox_sha1sum "d0737cceb55eb7d740578d2db1bc0727e3ed49ce",
|
14
|
-
"a033f652c84a4d73b8c26d318c2395699dd2bdfb" ;
|
15
|
-
foaf:homepage <http://ar.to/> ;
|
16
|
-
foaf:made <> ;
|
17
|
-
rdfs:isDefinedBy <http://datagraph.org/bendiken/foaf> .
|