6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehasemodule Hets
e4d81151f4841a6354d043551a970418b32be02aEugen Kuksa class ParseCaller < ActionCaller
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase # Server-Instances should be started with the following
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase # arguments: `hets +RTS -K1G -RTS -a none`
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase MODE_ARGUMENTS = {
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase fast_run: %w(just-structured),
87009975356ac69021bebf6a09e6c3b19dd2008bTim Reddehase default: %w(full-signatures full-theories auto),
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase }
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase CMD = 'dg'
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase METHOD = :get
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase def call(iri, with_mode: :default)
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase escaped_iri = Rack::Utils.escape_path(iri)
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase arguments = [escaped_iri, *MODE_ARGUMENTS[with_mode]]
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase api_uri = build_api_uri(CMD, arguments, build_query_string)
7203ae3d43f64ecaf5f210de17b9f2949270948aEugen Kuksa perform(api_uri, {}, METHOD)
b09cf42db481bf6c413844a42ae350952f3dab00Tim Reddehase rescue UnfollowableResponseError => error
b09cf42db481bf6c413844a42ae350952f3dab00Tim Reddehase handle_possible_hets_error(error)
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase end
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehase end
6cf3ba1dcf972672069f0826427619587d32d9e6Tim Reddehaseend