Skip to content

Commit 0d126cd

Browse files
committed
updated to RDF.rb 1.1
1 parent d37cbf2 commit 0d126cd

6 files changed

Lines changed: 14 additions & 16 deletions

File tree

lib/rdf/virtuoso/query.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,10 @@ def result
476476

477477
##
478478
# @return [Object]
479-
def execute
479+
# def execute
480480
#query
481481
#raise NotImplementedError
482-
end
482+
# end
483483

484484
##
485485
# Returns the string representation of this query.

lib/rdf/virtuoso/repository.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class ServerError < StandardError; end
2525

2626
attr_reader :uri, :update_uri, :username, :password, :auth_method
2727

28-
def initialize(uri, opts={})
28+
def initialize(uri, opts={}, &block)
2929
@uri = URI.parse(uri)
3030
@update_uri = URI.parse(opts[:update_uri]) if opts[:update_uri]
3131
@base_uri = "#{@uri.scheme}://#{@uri.host}"
@@ -54,7 +54,7 @@ def initialize(uri, opts={})
5454
response = api_post *args
5555
end
5656
end
57-
57+
5858
private
5959

6060
def check_response_errors(response)

lib/rdf/virtuoso/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
module RDF
22
module Virtuoso
3-
VERSION = "0.1.5"
3+
VERSION = "0.1.6"
44
end
55
end

rdf-virtuoso.gemspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ Gem::Specification.new do |s|
2020
s.require_paths = ['lib']
2121

2222
s.add_development_dependency 'rspec', '~> 2.14.1'
23-
s.add_development_dependency 'rdf-spec', '~> 1.0.9'
23+
s.add_development_dependency 'rdf-spec', '~> 1.1.0'
2424

25-
s.add_runtime_dependency 'rdf', '~> 1.0.10.2'
25+
s.add_runtime_dependency 'rdf', '~> 1.1.0'
2626
s.add_runtime_dependency 'httparty', '~> 0.12.0'
2727
s.add_runtime_dependency 'api_smith', '~> 1.3.0'
2828

spec/query_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,16 +149,16 @@
149149
it "should support SELECT with complex WHERE patterns" do
150150
@query.select.where(
151151
[:s, :p, :o],
152-
[:s, RDF.type, RDF::DC.Document]
152+
[:s, RDF.type, RDF::DC.BibliographicResource]
153153
).to_s.should ==
154-
"SELECT * WHERE { ?s ?p ?o . ?s <#{RDF.type}> <#{RDF::DC.Document}> . }"
154+
"SELECT * WHERE { ?s ?p ?o . ?s <#{RDF.type}> <#{RDF::DC.BibliographicResource}> . }"
155155
end
156156

157157
it "should support SELECT WHERE patterns from different GRAPH contexts" do
158158
@graph1 = "http://example1.org/"
159159
@graph2 = "http://example2.org/"
160-
@query.select.where([:s, :p, :o, :context => @graph1],[:s, RDF.type, RDF::DC.Document, :context => @graph2]).to_s.should ==
161-
"SELECT * WHERE { GRAPH <#{@graph1}> { ?s ?p ?o . } GRAPH <#{@graph2}> { ?s <#{RDF.type}> <#{RDF::DC.Document}> . } }"
160+
@query.select.where([:s, :p, :o, :context => @graph1],[:s, RDF.type, RDF::DC.BibliographicResource, :context => @graph2]).to_s.should ==
161+
"SELECT * WHERE { GRAPH <#{@graph1}> { ?s ?p ?o . } GRAPH <#{@graph2}> { ?s <#{RDF.type}> <#{RDF::DC.BibliographicResource}> . } }"
162162
end
163163

164164
it "should support string objects in SPARQL queries" do
@@ -291,8 +291,8 @@
291291
it "should support OPTIONAL with GRAPH contexts" do
292292
@graph1 = "http://example1.org/"
293293
@graph2 = "http://example2.org/"
294-
@query.select.where([:s, :p, :o, :context => @graph1]).optional([:s, RDF.type, RDF::DC.Document, :context => @graph2]).to_s.should ==
295-
"SELECT * WHERE { GRAPH <#{@graph1}> { ?s ?p ?o . } OPTIONAL { GRAPH <#{@graph2}> { ?s <#{RDF.type}> <#{RDF::DC.Document}> . } } }"
294+
@query.select.where([:s, :p, :o, :context => @graph1]).optional([:s, RDF.type, RDF::DC.BibliographicResource, :context => @graph2]).to_s.should ==
295+
"SELECT * WHERE { GRAPH <#{@graph1}> { ?s ?p ?o . } OPTIONAL { GRAPH <#{@graph2}> { ?s <#{RDF.type}> <#{RDF::DC.BibliographicResource}> . } } }"
296296
end
297297

298298
it "should support multiple OPTIONALs" do

spec/repository_spec.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
require File.join(File.dirname(__FILE__), 'spec_helper')
33
require 'rdf/spec/repository'
44

5-
#require_relative '../lib/rdf/virtuoso/repository'
6-
75
describe RDF::Virtuoso::Repository do
86

97
before(:each) do
108
@uri = "http://localhost:8890/sparql"
119
@update_uri = "http://localhost:8890/sparql-auth"
1210
@repository = RDF::Virtuoso::Repository.new(@uri)
1311
end
14-
12+
1513
#include RDF_Repository # not implemented
1614

1715
it "should support connecting to a Virtuoso SPARQL endpoint" do

0 commit comments

Comments
 (0)