Sha256: b6b1c47fe85fae825a770707e389b1bbb3de88f99c9d41ba6fdbd0eac84439a1

Contents?: true

Size: 741 Bytes

Versions: 31

Compression:

Stored size: 741 Bytes

Contents

require_dependency "publish_my_data/application_controller"

module PublishMyData
  class SparqlController < ApplicationController

    include PublishMyData::SparqlProcessing

    before_filter :check_format, :only => [:endpoint]

    def endpoint

      @query_text = params[:query]

      if @query_text.blank?
        unless is_request_html_format? #the html view handles this ok
          render :text => "no query supplied", :status => 400
        end
      else
        build_sparql_query(@query_text)
        @sparql_query_result = process_sparql_query(@sparql_query)
        respond_to do |format|
          format.html { render }
          format.any { render text: @sparql_query_result }
        end
      end

    end

  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
publish_my_data-1.3.25 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.24 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.23 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.22 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.21 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.20 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.19 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.18 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.17 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.16 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.15 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.14 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.13 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.12 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.11 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.10 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.9 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.8 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.7 app/controllers/publish_my_data/sparql_controller.rb
publish_my_data-1.3.6 app/controllers/publish_my_data/sparql_controller.rb