I am using the bendiken/sparql-client for ruby application.When I execute the given sample query methods its returning any empty array result.
The query method is as follow:
require 'rubygems'
require 'sparql/client'
sparql = SPARQL::Client.new("http://dbpedia.org/sparql")
query = sparql.select.where([:s, :p, :o]).offset(100).limit(10)
query.each_solution do |solution|
puts solution.inspect
end
If I execute with following query it is returning result perfectly .
require 'rubygems'
require 'sparql/client'
sparql = SPARQL::Client.new("http://dbpedia.org/sparql")
queryString="SELECT * WHERE { ?s ?p ?o } OFFSET 100 LIMIT 10"
query= sparql.query(queryString)
query.each_solution do |solution|
puts solution.inspect
end
Please Let me know why the first query method is not working.Let me know if any thing I have missed?
I don’t know why your first sample does not work, since it does seem to match the documentation. It didn’t work for me either, with the 0.0.9 sparql-client gem. However, calling
query.executedoes run the query. So:works for me