|
22 | 22 |
|
23 | 23 | describe 'when changing subject' do
|
24 | 24 | before do
|
25 |
| - subject << RDF::Statement.new(subject.rdf_subject, RDF::DC.title, RDF::Literal('Comet in Moominland')) |
26 |
| - subject << RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::DC.isPartOf, subject.rdf_subject) |
27 |
| - subject << RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::DC.relation, 'http://example.org/moomin_land') |
| 25 | + subject << RDF::Statement.new(subject.rdf_subject, RDF::Vocab::DC.title, RDF::Literal('Comet in Moominland')) |
| 26 | + subject << RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::Vocab::DC.isPartOf, subject.rdf_subject) |
| 27 | + subject << RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::Vocab::DC.relation, 'http://example.org/moomin_land') |
28 | 28 | subject.set_subject! RDF::URI('http://example.org/moomin')
|
29 | 29 | end
|
30 | 30 |
|
31 | 31 | it 'should update graph subjects' do
|
32 |
| - expect(subject.has_statement?(RDF::Statement.new(subject.rdf_subject, RDF::DC.title, RDF::Literal('Comet in Moominland')))).to be true |
| 32 | + expect(subject.has_statement?(RDF::Statement.new(subject.rdf_subject, RDF::Vocab::DC.title, RDF::Literal('Comet in Moominland')))).to be true |
33 | 33 | end
|
34 | 34 |
|
35 | 35 | it 'should update graph objects' do
|
36 |
| - expect(subject.has_statement?(RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::DC.isPartOf, subject.rdf_subject))).to be true |
| 36 | + expect(subject.has_statement?(RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::Vocab::DC.isPartOf, subject.rdf_subject))).to be true |
37 | 37 | end
|
38 | 38 |
|
39 | 39 | it 'should leave other uris alone' do
|
40 |
| - expect(subject.has_statement?(RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::DC.relation, 'http://example.org/moomin_land'))).to be true |
| 40 | + expect(subject.has_statement?(RDF::Statement.new(RDF::URI('http://example.org/moomin_comics'), RDF::Vocab::DC.relation, 'http://example.org/moomin_land'))).to be true |
41 | 41 | end
|
42 | 42 | end
|
43 | 43 |
|
|
58 | 58 | # -------------------------------------------------
|
59 | 59 |
|
60 | 60 | describe 'type' do
|
61 |
| - it "should be an RDF::FOAF.Person" do |
62 |
| - expect(subject.type.first.value).to eq RDF::FOAF.Person.value |
| 61 | + it "should be an RDF::Vocab::FOAF.Person" do |
| 62 | + expect(subject.type.first.value).to eq RDF::Vocab::FOAF.Person.value |
63 | 63 | end
|
64 | 64 | end
|
65 | 65 |
|
|
128 | 128 |
|
129 | 129 | describe '#destroy!' do
|
130 | 130 | before do
|
131 |
| - subject << RDF::Statement(RDF::DC.LicenseDocument, RDF::DC.title, 'LICENSE') |
| 131 | + subject << RDF::Statement(RDF::Vocab::DC.LicenseDocument, RDF::Vocab::DC.title, 'LICENSE') |
132 | 132 | end
|
133 | 133 |
|
134 | 134 | subject { LD4L::FoafRDF::Person.new('456')}
|
|
185 | 185 | before do
|
186 | 186 | class DummyPerson < ActiveTriples::Resource
|
187 | 187 | configure :type => RDF::URI('http://example.org/Person')
|
188 |
| - property :foafname, :predicate => RDF::FOAF.name |
189 |
| - property :publications, :predicate => RDF::FOAF.publications, :class_name => 'DummyDocument' |
190 |
| - property :knows, :predicate => RDF::FOAF.knows, :class_name => DummyPerson |
| 188 | + property :foafname, :predicate => RDF::Vocab::FOAF.name |
| 189 | + property :publications, :predicate => RDF::Vocab::FOAF.publications, :class_name => 'DummyDocument' |
| 190 | + property :knows, :predicate => RDF::Vocab::FOAF.knows, :class_name => DummyPerson |
191 | 191 | end
|
192 | 192 |
|
193 | 193 | class DummyDocument < ActiveTriples::Resource
|
194 | 194 | configure :type => RDF::URI('http://example.org/Document')
|
195 |
| - property :title, :predicate => RDF::DC.title |
196 |
| - property :creator, :predicate => RDF::DC.creator, :class_name => 'DummyPerson' |
| 195 | + property :title, :predicate => RDF::Vocab::DC.title |
| 196 | + property :creator, :predicate => RDF::Vocab::DC.creator, :class_name => 'DummyPerson' |
197 | 197 | end
|
198 | 198 |
|
199 |
| - LD4L::FoafRDF::Person.property :item, :predicate => RDF::DC.relation, :class_name => DummyDocument |
| 199 | + LD4L::FoafRDF::Person.property :item, :predicate => RDF::Vocab::DC.relation, :class_name => DummyDocument |
200 | 200 | end
|
201 | 201 |
|
202 | 202 | subject { LD4L::FoafRDF::Person.new }
|
@@ -249,8 +249,10 @@ class DummyDocument < ActiveTriples::Resource
|
249 | 249 | document1.creator = [person1, person2]
|
250 | 250 | document2.creator = person1
|
251 | 251 | person1.knows = person2
|
| 252 | + person2.knows = person1 |
252 | 253 | subject.item = [document1]
|
253 |
| - expect(subject.item.first.creator.first.knows.first.foafname).to eq ['Bob'] |
| 254 | + expect(subject.item.first.creator.first.knows.first.foafname) |
| 255 | + .to satisfy { |names| ['Alice', 'Bob'].include? names.first } |
254 | 256 | end
|
255 | 257 | end
|
256 | 258 | end
|
0 commit comments