Module: Sinatra::SPARQL
- Defined in:
- vendor/bundler/ruby/3.3.0/bundler/gems/sparql-36baa432eb7f/lib/sinatra/sparql.rb
Overview
The Sinatra::SPARQL module adds Rack::SPARQL middleware support for responding to SPARQL requests. It is the responsibility of the application to manage the SPARQL endpoint and perform the query. The query results are then sent as the response body. Rack::SPARQL middleware uses content negotiation to format the results appropriately.
To override negotiation on Content-Type, set :format in sparql_options
to a RDF Format class, or symbol identifying a format.
Defined Under Namespace
Modules: Helpers
Class Method Summary collapse
-
.registered(app)
- Registers Rack::SPARQL::ContentNegotiation * adds helpers * includes SPARQL, RDF and LinkedData * defines
sparql_options
, which are passed to the Rack middleware available assettings.sparql_options
and as options within the Rack::SPARQL middleware.
- Registers Rack::SPARQL::ContentNegotiation * adds helpers * includes SPARQL, RDF and LinkedData * defines
Class Method Details
.registered(app)
This method returns an undefined value.
- Registers Rack::SPARQL::ContentNegotiation
- adds helpers
- includes SPARQL, RDF and LinkedData
- defines
sparql_options
, which are passed to the Rack middleware available assettings.sparql_options
and as options within the Rack::SPARQL middleware.
144 145 146 147 148 149 150 151 152 |
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sparql-36baa432eb7f/lib/sinatra/sparql.rb', line 144 def self.registered(app) = {} app.set :sparql_options, app.use(Rack::SPARQL::ContentNegotiation, ) app.helpers(Sinatra::SPARQL::Helpers) app.send(:include, ::SPARQL) app.send(:include, ::RDF) app.send(:include, ::LinkedData) if defined?(::LinkedData) end |