class RDF::Marmotta::Client

Constants

MARMOTTA_GRAPH_ALL

Public Class Methods

new(url, options = {}, &block) click to toggle source
Calls superclass method
# File lib/rdf/marmotta.rb, line 72
def initialize(url, options = {}, &block)
  options[:method]   ||= :get
  options[:protocol] ||= '1.1'
  super
end

Public Instance Methods

parse_rdf_serialization(response, options = {}) click to toggle source

@private

Calls superclass method
# File lib/rdf/marmotta.rb, line 91
def parse_rdf_serialization(response, options = {})
  options[:content_type] ||= 'text/turtle' if response.content_type.nil?
  super
end
request(query, headers={}, &block) click to toggle source

Limit to accepted content types per comment on RDF::Marmotta::CTYPES

Calls superclass method
# File lib/rdf/marmotta.rb, line 80
def request(query, headers={}, &block)
  headers['Accept'] ||= MARMOTTA_GRAPH_ALL if
    (query.respond_to?(:expects_statements?) ?
     query.expects_statements? :
     (query =~ /CONSTRUCT|DESCRIBE|DELETE|CLEAR/))

  super
end
request_method(query) click to toggle source

Do HTTP POST if it's an INSERT

# File lib/rdf/marmotta.rb, line 97
def request_method(query)
  method = (self.options[:method] || DEFAULT_METHOD).to_sym
  method = :post if query.to_s =~ /INSERT/
  method
end