Skip to content

Commit 51ae02f

Browse files
cectongkellogg
authored andcommitted
Fixed problems with the alternative endpoint
The alternative endpoint is set optionally in the update method if an endpoint is provided in the options. If the next call doesn't provide an alternative endpoint, it should use the instance's configured endpoint. Also: a call to the query method may use the make_post_request method. We should make sure to not keep any previous alternative endpoint. Note: this commit not only fix the current issues with the alternative endpoints, it also implements a new functionality: the possibility to override the configured endpoint when calling the query method. (cherry picked from commit 82530b9)
1 parent 0b7a141 commit 51ae02f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/sparql/client.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,7 @@ def nodes
291291
# @see http://www.w3.org/TR/sparql11-protocol/#query-operation
292292
def query(query, options = {})
293293
@op = :query
294+
@alt_endpoint = options[:endpoint]
294295
case @url
295296
when RDF::Queryable
296297
require 'sparql' unless defined?(::SPARQL::Grammar)
@@ -317,7 +318,7 @@ def query(query, options = {})
317318
# @see http://www.w3.org/TR/sparql11-protocol/#update-operation
318319
def update(query, options = {})
319320
@op = :update
320-
@alt_endpoint = options[:endpoint] unless options[:endpoint].nil?
321+
@alt_endpoint = options[:endpoint]
321322
case @url
322323
when RDF::Queryable
323324
require 'sparql' unless defined?(::SPARQL::Grammar)

0 commit comments

Comments
 (0)