|
63 | 63 | end |
64 | 64 |
|
65 | 65 | it "does not alter a given hash argument" do |
66 | | - query = {subject: resource, predicate: RDF::DOAP.name, object: RDF::FOAF.Person} |
| 66 | + query = {subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name"), object: RDF::URI("http://xmlns.com/foaf/0.1/Person")} |
67 | 67 | original_query = query.dup |
68 | 68 | subject.query(query) |
69 | 69 | expect(query).to eq original_query |
|
147 | 147 | expect(subject.query([nil, nil, nil]).size).to eq @statements.size |
148 | 148 | expect(subject.query([resource, nil, nil]).size).to eq File.readlines(@doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size |
149 | 149 | expect(subject.query([RDF::URI("http://ar.to/#self"), nil, nil]).size).to eq File.readlines(@doap).grep(/^<http:\/\/ar.to\/\#self>/).size |
150 | | - expect(subject.query([resource, RDF::DOAP.name, nil]).size).to eq 1 |
151 | | - expect(subject.query([nil, nil, RDF::DOAP.Project]).size).to eq 1 |
| 150 | + expect(subject.query([resource, RDF::URI("http://usefulinc.com/ns/doap#name"), nil]).size).to eq 1 |
| 151 | + expect(subject.query([nil, nil, RDF::URI("http://usefulinc.com/ns/doap#Project")]).size).to eq 1 |
152 | 152 | end |
153 | 153 |
|
154 | 154 | it "returns the correct number of results for hash queries" do |
155 | 155 | expect(subject.query({}).size).to eq @statements.size |
156 | 156 | expect(subject.query(subject: resource).size).to eq File.readlines(@doap).grep(/^<http:\/\/rubygems\.org\/gems\/rdf>/).size |
157 | | - expect(subject.query(subject: resource, predicate: RDF::DOAP.name).size).to eq 1 |
158 | | - expect(subject.query(object: RDF::DOAP.Project).size).to eq 1 |
| 157 | + expect(subject.query(subject: resource, predicate: RDF::URI("http://usefulinc.com/ns/doap#name")).size).to eq 1 |
| 158 | + expect(subject.query(object: RDF::URI("http://usefulinc.com/ns/doap#Project")).size).to eq 1 |
159 | 159 | end |
160 | 160 |
|
161 | 161 | it "returns the correct number of results for query queries" do |
|
456 | 456 | let(:resource) {RDF::Node.new} |
457 | 457 | subject { |
458 | 458 | RDF::Graph.new do |graph| |
459 | | - graph << [resource, RDF.type, RDF::DOAP.Project] |
460 | | - graph << [resource, RDF::DC.creator, RDF::URI.new('http://example.org/#jhacker')] |
461 | | - graph << [resource, RDF::DC.creator, literal] |
| 459 | + graph << [resource, RDF.type, RDF::URI("http://usefulinc.com/ns/doap#Project")] |
| 460 | + graph << [resource, RDF::URI("http://purl.org/dc/terms/creator"), RDF::URI.new('http://example.org/#jhacker')] |
| 461 | + graph << [resource, RDF::URI("http://purl.org/dc/terms/creator"), literal] |
462 | 462 | end |
463 | 463 | } |
464 | 464 | it {is_expected.to respond_to(:first_literal)} |
|
469 | 469 | end |
470 | 470 |
|
471 | 471 | it "returns the correct value when the pattern matches" do |
472 | | - matching_patterns = [[nil, nil, nil], [resource, nil, nil], [nil, RDF::DC.creator, nil], [nil, nil, literal]] |
| 472 | + matching_patterns = [[nil, nil, nil], [resource, nil, nil], [nil, RDF::URI("http://purl.org/dc/terms/creator"), nil], [nil, nil, literal]] |
473 | 473 | matching_patterns.each do |matching_pattern| |
474 | 474 | expect(subject.first_literal(matching_pattern)).to eq literal |
475 | 475 | end |
|
0 commit comments