Sha256: 44b393e1fd8824cf3c5a7ffe913bb341491de741c74aba2309a32d0ea840e662

Contents?: true

Size: 665 Bytes

Versions: 1

Compression:

Stored size: 665 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
        @sparql_query = build_sparql_query(@query_text)
        @sparql_query_result = process_sparql_query(@sparql_query)
        respond_with(@sparql_query_result)
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
publish_my_data-0.0.30 app/controllers/publish_my_data/sparql_controller.rb