I tried to do the same thing using the sparql-client but I the following error:
sparql = SPARQL::Client.new("http://vocabularies.unesco.org/sparql")
query = sparql.select.where([:s, :p, :o]).limit(100)
query.each_solution {|solution| puts solution}
# error
SPARQL::Client::ServerError: Infinite redirect at http://vocabularies.unesco.org/sparql. Redirected more than 10 times.
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client.rb:699:in `request'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client.rb:344:in `response'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client.rb:305:in `query'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client.rb:270:in `block in call_query_method'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client/query.rb:416:in `result'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/sparql-client-1.99.1/lib/sparql/client/query.rb:409:in `each_solution'
from (irb):120
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/console.rb:110:in `start'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/console.rb:9:in `start'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:68:in `console'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/$user/.rbenv/versions/2.4.4/lib/ruby/gems/2.4.0/gems/railties-4.2.10/lib/rails/commands.rb:17:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
the uri that gets build by the query not matching what unesco is expecting, or
a case of altering config to increase the redirect threshold
I'm probably going to switch to using a regular http get for now using the url generated by the page,
but ideally I'd like to build the query using ruby. Thanks in advance!
Unesco provide a sparql endpoint http://vocabularies.unesco.org/sparql-form/ The first example on that page is
I tried to do the same thing using the sparql-client but I the following error:
http://vocabularies.unesco.org/sparql does redirect to http://vocabularies.unesco.org/sparql-form/,
but if the url has all the required params, e.g. this uri, generated by selecting the first query on the page and clicking run query, it resolves.
I'm not sure whether this is an issue with
I'm probably going to switch to using a regular http get for now using the url generated by the page,
but ideally I'd like to build the query using ruby. Thanks in advance!