Method: Lbp::Query#query

Defined in:
lib/lbp/query.rb

#query(query) ⇒ Object



22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/lbp/query.rb', line 22

def query(query)
	if ENV['SPARQL'] == "local"
  	sparqlendpoint = "http://localhost:3030/ds/query"
  elsif ENV['SPARQL'] == "staging"
  	sparqlendpoint = "http://sparql-staging.scta.info/ds/query"
  elsif ENV['RACK_ENV'] == "production" || ENV['SPARQL'] == "production"
    sparqlendpoint = "http://sparql.scta.info/ds/query"
  else
    sparqlendpoint = "http://sparql.scta.info/ds/query"
  end
	
	sparql = SPARQL::Client.new(sparqlendpoint)
  result = sparql.query(query)

  return result
end