routes.rb revision dfc7323cf206c044e128ffc866be9d3c777be8b7
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherrequire 'sidekiq/web' if defined? Sidekiq
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherrequire Rails.root.join('lib', 'router_constraints.rb')
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherSpecroutes.define(Ontohub::Application.routes) do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek resources :filetypes, only: :create
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek # IRI Routing #
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ###############
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher # as per Loc/Id definition
531661c7bb54eb71853977a64cb30f80c20b963eJakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher # Special (/ref-based) Loc/Id routes
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek specified_get '/ref/:reference/:repository_id/*locid' => 'api/v1/ontology_versions#show',
ad805face83ba7d67b1cf2067a1982c7e63d1060Jakub Hrozek as: :ontology_iri_versioned,
ad805face83ba7d67b1cf2067a1982c7e63d1060Jakub Hrozek constraints: [
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek RefLocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'application/json', constraint: true
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/plain', constraint: true
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher # reroute_on_mime 'application/json', to: 'api/v1/ontology_versions#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
7a14e8f66c0e932fe2954d792614a3b61d444bd1Jakub Hrozek doc title: 'Ontology IRI (loc/id) with version reference',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the ontology at a
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherontology version referenced by the {reference}.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozek
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek specified_get '/ref/:reference/:repository_id/*locid' => 'ontologies#show',
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek as: :ontology_iri_versioned,
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek constraints: [
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek RefLocIdRouterConstraint.new(Ontology, ontology: :id),
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek ] do
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek accept 'text/html'
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'Ontology IRI (loc/id) with version reference',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the ontology at a
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherontology version referenced by the {reference}.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher # MMT-Support
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/ref/mmt/:repository_id/*path' => 'ontologies#show',
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek as: :ontology_iri_mmt,
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek constraints: [
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek MMTRouterConstraint.new(Ontology, ontology: :id),
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek ] do
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek accept 'text/html'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'MMT reference to an ontology',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the ontology. The ontology
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *path and to the MMT-query-string.
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/ref/mmt/:repository_id/*path' => 'mappings#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :mapping_iri_mmt,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher MMTRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher doc title: 'MMT reference to a mapping',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the mapping. The mapping
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozekis determined according to the *path and to the MMT-query-string.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
65a9065538fd85e6ead925d344e6b421900eb8c2Jakub Hrozek end
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek specified_get '/ref/mmt/:repository_id/*path' => 'symbols#index',
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek as: :symbol_iri_mmt,
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek constraints: [
261cdde02b40aa8dabb3d69e43586a5a220647e9Jakub Hrozek MMTRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id),
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'MMT reference to a symbol',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the symbol. The symbol
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *path and to the MMT-query-string.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherCurrently the representation ist a list of all symbols in the ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/ref/mmt/:repository_id/*path' => 'axioms#index',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :axiom_iri_mmt,
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher MMTRouterConstraint.new(Axiom, ontology: :ontology_id),
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ] do
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek accept 'text/html'
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher doc title: 'MMT reference to a axiom',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the axiom. The axiom
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *path and to the MMT-query-string.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherCurrently the representation is a list of all axioms in the ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher specified_get '/ref/mmt/:repository_id/*path' => 'theorems#index',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher as: :theorem_iri_mmt,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher MMTRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'MMT reference to a theorem',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the theorem. The theorem
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagheris determined according to the *path and to the MMT-query-string.
2ea6196484055397cc4bc011c5960f790431fa9dStephen GallagherCurrently the representation is a list of all theorems in the ontology.
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/ref/mmt/:repository_id/*path' => 'api/v1/proof_attempt_configurations#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :proof_attempt_configuration_iri_mmt,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher MMTRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id),
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ] do
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher accept 'application/json'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'MMT reference to a proof attempt configuration',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the proof attempt configuration. The proof
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagherattempt configuration is determined according to the *path and to the
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherMMT-query-string.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher # Subsites for ontologies
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ontology_subsites = %i(
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher comments metadata graphs
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher projects categories tasks
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher )
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ontology_api_subsites = %i(
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher mappings symbols children
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek axioms theorems
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek ontology_versions
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek license_models formality_levels
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher proof_attempt_configurations
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher )
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ontology_subsites.each do |category|
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek as: :"ontology_iri_#{category}",
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
2ea6196484055397cc4bc011c5960f790431fa9dStephen GallagherWill provide a subsite of a specific ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher ontology_api_subsites.each do |category|
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :"ontology_iri_#{category}",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
531661c7bb54eb71853977a64cb30f80c20b963eJakub Hrozek LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek ] do
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek accept 'text/html'
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek reroute_on_mime 'application/json', to: "api/v1/#{category}#index"
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill provide a subsite of a specific ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get "/:repository_id/*locid///sentences" => "api/v1/sentences#index",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :"ontology_iri_sentences",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher ] do
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher accept 'application/json'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher doc title: "Ontology subsite about sentences",
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill provide a subsite of a specific ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher # Loc/Id-Show(-equivalent) routes
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ######
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher specified_get '/:repository_id/*locid' => 'ontologies#show',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher as: :ontology_iri,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher LocIdRouterConstraint.new(Ontology, ontology: :id),
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'loc/id reference to an ontology',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen GallagherWill return a representation of the ontology. The ontology
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *locid.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher specified_get '/:repository_id/*locid' => 'mappings#show',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher as: :mapping_iri,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher LocIdRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'loc/id reference to a mapping',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher body: <<-BODY
2ea6196484055397cc4bc011c5960f790431fa9dStephen GallagherWill return a representation of the mapping. The mapping
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *locid.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek specified_get '/:repository_id/*locid' => 'symbols#index',
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek as: :symbol_iri,
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek constraints: [
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek LocIdRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id, element: :id),
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek ] do
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek accept 'text/html'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek doc title: 'loc/id reference to a symbol',
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek body: <<-BODY
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub HrozekWill return a representation of the symbol. The symbol
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozekis determined according to the *locid.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub HrozekCurrently this will return the list of all symbols of the ontology.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek BODY
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek theorems_subsites = %i(proof_attempts)
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek theorems_subsites.each do |subsite|
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek specified_get "/:repository_id/*locid///#{subsite}" => "#{subsite}#index",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek as: :"theorem_iri_#{subsite}",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek constraints: [
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :theorem_id),
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek ] do
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek accept 'text/html'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek reroute_on_mime 'application/json', to: "api/v1/#{subsite}#index"
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek doc title: 'loc/id reference to a theorem subsite',
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek body: <<-BODY
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek Will return a representation of the theorem subsite. The theorem
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek is determined according to the *locid.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek BODY
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek specified_get "/:repository_id/*locid" => "prover_outputs#show",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek as: :"prover_output_iri",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek constraints: [
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek LocIdRouterConstraint.new(ProverOutput, ontology: :ontology_id, theorem: :theorem_id, proof_attempt: :proof_attempt_id, element: :id),
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek ] do
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek accept 'application/json'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek reroute_on_mime 'application/json', to: "api/v1/prover_outputs#show"
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek doc title: 'loc/id reference to a prover output',
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek body: <<-BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek Will return a prover output.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek The prover output is determined according to the *locid.
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek proof_attempt_api_subsites = %i(
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek used_axioms generated_axioms
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek used_theorems prover_output
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek )
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek proof_attempt_api_subsites.each do |subsite|
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempts##{subsite}",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek as: :"proof_attempt_iri_#{subsite}",
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek constraints: [
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek ] do
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek accept 'application/json'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek doc title: 'loc/id reference to a proof attempt subsite',
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek body: <<-BODY
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek Will return a subsite of the proof attempt. The proof attempt is determined
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek according to the *locid.
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek BODY
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek end
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek sentence_types = %i(axiom theorem)
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek sentence_api_subsites = %i(symbols)
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek sentence_types.each do |type|
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek sentence_api_subsites.each do |subsite|
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/#{subsite}#index",
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek as: :"#{type}_iri_#{subsite}",
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek constraints: [
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek LocIdRouterConstraint.new(type.to_s.camelize.constantize, ontology: :ontology_id, element: :"sentence_id"),
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek ] do
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek accept 'application/json'
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek doc title: "loc/id reference to a #{type} subsite",
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek body: <<-BODY
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek Will return a representation of the #{type} subsite. The #{type}
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek is determined according to the *locid.
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek BODY
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek end
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek specified_get '/:repository_id/*locid' => 'axioms#index',
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek as: :axiom_iri,
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek constraints: [
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek LocIdRouterConstraint.new(Axiom, ontology: :ontology_id, element: :id),
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek ] do
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek accept 'text/html'
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek doc title: 'loc/id reference to an axiom',
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek body: <<-BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub HrozekWill return a representation of the axiom. The axiom
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozekis determined according to the *locid.
a23014d69b56cbdf48ad05229c334648b5309d8fJakub HrozekCurrently this will return the list of all axioms of the ontology.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek BODY
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek end
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek specified_get '/:repository_id/*locid' => 'theorems#index',
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek as: :theorem_iri,
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek constraints: [
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek ] do
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek accept 'text/html'
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/theorems#show'
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek doc title: 'loc/id reference to a theorem',
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek body: <<-BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub HrozekWill return a representation of the theorem. The theorem
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozekis determined according to the *locid.
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek BODY
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek proof_attempt_configuration_api_subsites =
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek %i(selected_axioms selected_theorems)
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek proof_attempt_configuration_api_subsites.each do |subsite|
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempt_configurations##{subsite}",
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek as: :"proof_attempt_configuration_iri_#{subsite}",
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek constraints: [
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek LocIdRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id, element: :id),
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek ] do
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek accept 'application/json'
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek doc title: 'loc/id reference to a proof attempt configuration subsite',
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek body: <<-BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek Will return a subsite of the proof attempt configuration. The proof attempt
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek configuration is determined according to the *locid.
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek BODY
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek end
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek specified_get '/:repository_id/*locid' => 'api/v1/proof_attempt_configurations#show',
f45a20d6ba9e8d695ec3ab707f0cc082999aa4a3Jakub Hrozek as: :proof_attempt_configuration_iri,
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek constraints: [
0142e7e2558a887992b1c5d4dc3051178e377687Jakub Hrozek LocIdRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id, element: :id),
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek ] do
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek accept 'application/json'
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek doc title: 'loc/id reference to a proof attempt configuration',
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the proof attempt configuration. The proof attempt configuration
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagheris determined according to the *locid.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/:repository_id/*locid' => 'sentences#index',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher as: :sentence_iri,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher LocIdRouterConstraint.new(Sentence, ontology: :ontology_id, element: :id),
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/sentences#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'loc/id reference to a sentence',
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the sentence. The sentence
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagheris determined according to the *locid.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherCurrently this will return the list of all sentences of the ontology.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/:repository_id/*locid' => 'proof_attempts#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :proof_attempt_iri,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: [
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher ] do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/proof_attempts#show'
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'loc/id reference to a proof attempt',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the proof attempt. The proof attempt
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to the *locid.
d25fa6f2608d5fe0617ada47f9d426f45deb96ffJakub Hrozek BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek specified_get '/ontology_types/:id' => 'ontology_types#show',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek as: :ontology_type do
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek accept 'text/html'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/ontology_types#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'IRI of an ontology type',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek body: <<-BODY
056302a92862fda16351d7192600746746f38e5dStephen GallagherWill return a representation of the ontology type.
e59e09b5010f262228bbdeb92a79b733bf5854b3Stephen Gallagher BODY
e59e09b5010f262228bbdeb92a79b733bf5854b3Stephen Gallagher end
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher
a23014d69b56cbdf48ad05229c334648b5309d8fJakub Hrozek specified_get '/logics/:id' => 'logics#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :logic do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek reroute_on_mime 'text/xml', to: 'api/v1/logics#show'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek reroute_on_mime 'application/xml', to: 'api/v1/logics#show'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek reroute_on_mime 'application/rdf+xml', to: 'api/v1/logics#show'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/logics#show'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek doc title: 'IRI of a logic',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek body: <<-BODY
36b56482ca1e53d832accef0354124fd79711172Jakub HrozekWill return a representation of the logic.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher specified_get '/license_models/:id' => 'license_models#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :license_model do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek reroute_on_mime 'application/json', to: 'api/v1/license_models#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'IRI of a license model',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the license model.
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher BODY
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/formality_levels/:id' => 'formality_levels#show',
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek as: :formality_level do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'text/html'
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher reroute_on_mime 'application/json', to: 'api/v1/formality_levels#show'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher doc title: 'IRI of a formality level',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the formality level.
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher #
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek ###############
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get '/after_signup', to: 'home#show' , as: 'after_sign_up'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher devise_for :users, controllers: {
2cb6f28b3a12bb714bf14494d31eb6b6fff64b8bJakub Hrozek confirmations: 'users/confirmations',
be5cc3c013ece0c957f2f8c28a217052227dfd07Jakub Hrozek registrations: 'users/registrations'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher }
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :users, only: :show
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher namespace 'users' do
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resource :api_keys, only: %w(create)
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher resources :keys, except: [:show, :edit, :update]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :logics, only: [:index, :show] do
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek resources :supports, :only => [:create, :update, :destroy, :index]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :graphs, :only => [:index]
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher end
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :languages do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :supports, :only => [:create, :update, :destroy, :index]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :language_mappings
524ceecc11f3d458eb3c1cf1489c3ff6ccb22226Jakub Hrozek resources :logic_mappings
524ceecc11f3d458eb3c1cf1489c3ff6ccb22226Jakub Hrozek
524ceecc11f3d458eb3c1cf1489c3ff6ccb22226Jakub Hrozek resources :mappings, only: :index
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :categories, :only => [:index, :show]
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher resources :projects
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resources :tasks
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :license_models
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher resources :formality_levels
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resources :language_adjoints
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :logic_adjoints
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :serializations
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek namespace :admin do
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek resources :teams, :only => :index
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek resources :users
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek resources :jobs, :only => :index
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :status, only: :index
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek authenticate :user, lambda { |u| u.admin? } do
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek mount Sidekiq::Web => 'admin/sidekiq'
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resources :ontologies, only: [:index] do
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek collection do
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek get 'search' => 'ontology_search#search'
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :mappings do
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek get 'update_version', :on => :member
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resources :teams do
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :permissions, :only => [:index], :controller => 'teams/permissions'
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek get 'autocomplete' => 'autocomplete#index'
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek get 'symbols_search' => 'symbols_search#index'
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :repositories do
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek post 'undestroy',
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek controller: :repositories,
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek action: :undestroy,
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek as: :undestroy
0172959f117b545c8a6b1893f5f56818d82dd624Jakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :s_s_h_access, :only => :index, path: 'ssh_access'
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :permissions, :only => [:index, :create, :update, :destroy]
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :url_maps, except: :show
f10ebaa51ecdcbbd10f171d19fe8e680e5bc74aaJakub Hrozek resources :errors, :only => :index
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :repository_settings, :only => :index
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek resources :ontologies, only: [:index, :show, :edit, :update, :destroy] do
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek collection do
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek post 'retry_failed' => 'ontologies#retry_failed'
a7797068c4deb6ce2bdbcda27c45ff1bbb4a8e78Jakub Hrozek get 'search' => 'ontology_search#search'
b20208b80e99abb79c00d5ec526caa9465859c52Jakub Hrozek end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher member do
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek post 'retry_failed' => 'ontologies#retry_failed'
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher end
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher resources :children, :only => :index
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher resources :symbols, only: %i(index show)
dd3ba5c5b7d2a9d109963ae9e6c94fff34872221Stephen Gallagher resources :axioms, only: :index
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :theorems, only: :index do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :proof_attempts, only: %i(index show) do
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek resource :prover_output, only: :show
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher get '/proofs/new', controller: :proofs, action: :new
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher post '/proofs', controller: :proofs, action: :create
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek get '/proofs/new', controller: :proofs, action: :new
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher post '/proofs', controller: :proofs, action: :create
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :mappings do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get 'update_version', :on => :member
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher resource :oops_request, :only => [:show, :create]
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher resources :categories
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher resources :tasks
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :license_models
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :tools
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek resources :projects
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :metadata, :only => [:index, :create, :destroy]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :comments, :only => [:index, :create, :destroy]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :graphs, :only => [:index]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :formality_levels
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher end
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :files, only: [:new, :create]
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher resources :repository_directories, only: [:create]
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get ':ref/files(/*path)',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher controller: :files,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher action: :show,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :ref,
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher constraints: FilesRouterConstraint.new
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get ':ref/history(/:path)',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher controller: :history,
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek action: :show,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :history,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: { path: /.*/ }
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get ':ref/diff',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher controller: :diffs,
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher action: :show,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :diffs
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek # action: entries_info
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher get ':ref/:action(/:path)',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher controller: :files,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :ref,
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher constraints: { path: /.*/ }
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher specified_get '/:id' => 'api/v1/repositories#show',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher as: :repository_iri do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'application/json', constraint: true
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher doc title: 'loc/id reference to a repository',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the repository. The repository
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozekis determined according to its path, which is considered as
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher{id}.
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher specified_post '/:repository_id///combinations' => 'api/v1/combinations#create',
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher as: :repository_combinations_iri do
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher accept 'application/json', constraint: true
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek doc title: 'loc/id reference to a repository',
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher body: <<-BODY
52261fe16203dec6e6f69177c6d0a810b47d073fStephen GallagherWill return a representation of the repository. The repository
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagheris determined according to its path, which is considered as
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher{id}.
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher BODY
2ea6196484055397cc4bc011c5960f790431fa9dStephen Gallagher end
52261fe16203dec6e6f69177c6d0a810b47d073fStephen Gallagher
e59e09b5010f262228bbdeb92a79b733bf5854b3Stephen Gallagher post ':repository_id/:path',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek controller: :files,
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek action: :update,
531661c7bb54eb71853977a64cb30f80c20b963eJakub Hrozek as: :repository_tree,
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek constraints: { path: /.*/ }
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek get ':repository_id(/*path)',
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek controller: :files,
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek action: :show,
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek as: :repository_tree,
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek constraints: FilesRouterConstraint.new
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek get '*path',
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek controller: :ontologies,
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek action: :show,
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek as: :iri,
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek constraints: IRIRouterConstraint.new
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozek root :to => 'home#index'
36b56482ca1e53d832accef0354124fd79711172Jakub Hrozek
481ec0e1eb0058195732cb320845b41f6f4d43ebJakub Hrozekend
531661c7bb54eb71853977a64cb30f80c20b963eJakub Hrozek