routes.rb revision 94e57e017dbd7f0ecd388a648a731b840db24418
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenrequire 'sidekiq/web' if defined? Sidekiq
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenrequire Rails.root.join('lib', 'router_constraints.rb')
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenSpecroutes.define(Ontohub::Application.routes) do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen resources :filetypes, only: :create
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # IRI Routing #
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ###############
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # as per Loc/Id definition
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen specified_get '/actions/:id' => 'api/v1/actions#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :action_iri,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen format: :json do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json', constraint: true
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'An action that represents a long-running operation'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # Special (/ref-based) Loc/Id routes
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'api/v1/ontology_versions#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :ontology_iri_versioned,
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen constraints: [
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json', constraint: true
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/plain', constraint: true
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # reroute_on_mime 'application/json', to: 'api/v1/ontology_versions#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology at a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenontology version referenced by the {reference}.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'ontologies#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :ontology_iri_versioned,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology at a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenontology version referenced by the {reference}.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # MMT-Support
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'ontologies#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :ontology_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Ontology, ontology: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to an ontology',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology. The ontology
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'mappings#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :mapping_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a mapping',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the mapping. The mapping
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'symbols#index',
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainen as: :symbol_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen doc title: 'MMT reference to a symbol',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo SirainenWill return a representation of the symbol. The symbol
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo SirainenCurrently the representation ist a list of all symbols in the ontology.
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'axioms#index',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :axiom_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Axiom, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a axiom',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the axiom. The axiom
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenCurrently the representation is a list of all axioms in the ontology.
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'theorems#index',
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen as: :theorem_iri_mmt,
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a theorem',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the theorem. The theorem
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainenis determined according to the *path and to the MMT-query-string.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenCurrently the representation is a list of all theorems in the ontology.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen BODY
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen end
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'api/v1/proof_attempt_configurations#show',
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen as: :proof_attempt_configuration_iri_mmt,
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen MMTRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ] do
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen accept 'application/json'
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen doc title: 'MMT reference to a proof attempt configuration',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the proof attempt configuration. The proof
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainenattempt configuration is determined according to the *path and to the
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenMMT-query-string.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen end
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen # Subsites for ontologies
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_subsites = %i(
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen comments metadata graphs
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen projects categories tasks
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen )
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_api_subsites = %i(
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen mappings symbols children
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen axioms theorems
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen ontology_versions
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen license_models formality_levels
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen )
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_subsites.each do |category|
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"ontology_iri_#{category}",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen constraints: [
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen ] do
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen accept 'text/html'
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen body: <<-BODY
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo SirainenWill provide a subsite of a specific ontology.
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainen BODY
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainen end
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen end
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen ontology_api_subsites.each do |category|
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen as: :"ontology_iri_#{category}",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen constraints: [
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen ] do
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen accept 'text/html'
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{category}#index"
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen body: <<-BODY
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo SirainenWill provide a subsite of a specific ontology.
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen BODY
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen end
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen end
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen specified_get "/:repository_id/*locid///sentences" => "api/v1/sentences#index",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen as: :"ontology_iri_sentences",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen constraints: [
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen ] do
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen accept 'application/json'
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about sentences",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen body: <<-BODY
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo SirainenWill provide a subsite of a specific ontology.
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen end
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen # Loc/Id-Show(-equivalent) routes
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen ######
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen specified_get '/:repository_id/*locid' => 'ontologies#show',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen as: :ontology_iri,
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen constraints: [
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :id),
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen ] do
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'text/html'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen doc title: 'loc/id reference to an ontology',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen body: <<-BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo SirainenWill return a representation of the ontology. The ontology
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainenis determined according to the *locid.
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen end
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen specified_get '/:repository_id/*locid' => 'mappings#show',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen as: :mapping_iri,
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen constraints: [
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen LocIdRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen ] do
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'text/html'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen doc title: 'loc/id reference to a mapping',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen body: <<-BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo SirainenWill return a representation of the mapping. The mapping
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainenis determined according to the *locid.
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/:repository_id/*locid' => 'symbols#index',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :symbol_iri,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen doc title: 'loc/id reference to a symbol',
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the symbol. The symbol
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenCurrently this will return the list of all symbols of the ontology.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen theorems_subsites = %i(proof_attempts)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen theorems_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "#{subsite}#index",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"theorem_iri_#{subsite}",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :theorem_id),
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ] do
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen accept 'text/html'
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{subsite}#index"
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen doc title: 'loc/id reference to a theorem subsite',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen Will return a representation of the theorem subsite. The theorem
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen is determined according to the *locid.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen end
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen specified_get "/:repository_id/*locid" => "prover_outputs#show",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"prover_output_iri",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen LocIdRouterConstraint.new(ProverOutput, ontology: :ontology_id, theorem: :theorem_id, proof_attempt: :proof_attempt_id, element: :id),
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ] do
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'application/json'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/prover_outputs#show"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'loc/id reference to a prover output',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a prover output.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen The prover output is determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen proof_attempt_api_subsites = %i(
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen used_axioms generated_axioms
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen used_theorems prover_output
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen )
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen proof_attempt_api_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempts##{subsite}",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :"proof_attempt_iri_#{subsite}",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'loc/id reference to a proof attempt subsite',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a subsite of the proof attempt. The proof attempt is determined
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_types = %i(axiom theorem)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_api_subsites = %i(symbols)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_types.each do |type|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_api_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/#{subsite}#index",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :"#{type}_iri_#{subsite}",
bcbca4b66800f0fbfe2643a86d5a6b63d752454dTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(type.to_s.camelize.constantize, ontology: :ontology_id, element: :"sentence_id"),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ] do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen doc title: "loc/id reference to a #{type} subsite",
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a representation of the #{type} subsite. The #{type}
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen is determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen end
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/:repository_id/*locid' => 'axioms#index',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :axiom_iri,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
LocIdRouterConstraint.new(Axiom, ontology: :ontology_id, element: :id),
] do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
doc title: 'loc/id reference to an axiom',
body: <<-BODY
Will return a representation of the axiom. The axiom
is determined according to the *locid.
Currently this will return the list of all axioms of the ontology.
BODY
end
specified_get '/:repository_id/*locid' => 'theorems#index',
as: :theorem_iri,
constraints: [
LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
] do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/theorems#show'
doc title: 'loc/id reference to a theorem',
body: <<-BODY
Will return a representation of the theorem. The theorem
is determined according to the *locid.
BODY
end
proof_attempt_configuration_api_subsites =
%i(selected_axioms selected_theorems)
proof_attempt_configuration_api_subsites.each do |subsite|
specified_get "/:repository_id/*locid///proof-attempt-configuration///#{subsite}" => "api/v1/proof_attempt_configurations##{subsite}",
as: :"proof_attempt_configuration_iri_#{subsite}",
constraints: [
LocIdRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
] do
accept 'application/json'
doc title: 'loc/id reference to a proof attempt configuration subsite',
body: <<-BODY
Will return a subsite of the proof attempt configuration. The proof attempt
configuration is determined according to the *locid.
BODY
end
end
specified_get '/:repository_id/*locid///proof-attempt-configuration' => 'api/v1/proof_attempt_configurations#show',
as: :proof_attempt_configuration_iri,
constraints: [
LocIdRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
] do
accept 'application/json'
doc title: 'loc/id reference to a proof attempt configuration',
body: <<-BODY
Will return a representation of the proof attempt configuration. The proof attempt configuration
is determined according to the *locid.
BODY
end
specified_get '/:repository_id/*locid' => 'sentences#index',
as: :sentence_iri,
constraints: [
LocIdRouterConstraint.new(Sentence, ontology: :ontology_id, element: :id),
] do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/sentences#show'
doc title: 'loc/id reference to a sentence',
body: <<-BODY
Will return a representation of the sentence. The sentence
is determined according to the *locid.
Currently this will return the list of all sentences of the ontology.
BODY
end
specified_get '/:repository_id/*locid' => 'proof_attempts#show',
as: :proof_attempt_iri,
constraints: [
LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
] do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/proof_attempts#show'
doc title: 'loc/id reference to a proof attempt',
body: <<-BODY
Will return a representation of the proof attempt. The proof attempt
is determined according to the *locid.
BODY
end
specified_get '/ontology_types/:id' => 'ontology_types#show',
as: :ontology_type do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/ontology_types#show'
doc title: 'IRI of an ontology type',
body: <<-BODY
Will return a representation of the ontology type.
BODY
end
specified_get '/logics/:id' => 'logics#show',
as: :logic do
accept 'text/html'
reroute_on_mime 'text/xml', to: 'api/v1/logics#show'
reroute_on_mime 'application/xml', to: 'api/v1/logics#show'
reroute_on_mime 'application/rdf+xml', to: 'api/v1/logics#show'
reroute_on_mime 'application/json', to: 'api/v1/logics#show'
doc title: 'IRI of a logic',
body: <<-BODY
Will return a representation of the logic.
BODY
end
specified_get '/license_models/:id' => 'license_models#show',
as: :license_model do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/license_models#show'
doc title: 'IRI of a license model',
body: <<-BODY
Will return a representation of the license model.
BODY
end
specified_get '/formality_levels/:id' => 'formality_levels#show',
as: :formality_level do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/formality_levels#show'
doc title: 'IRI of a formality level',
body: <<-BODY
Will return a representation of the formality level.
BODY
end
specified_get '/proof-statuses' => 'api/v1/proof_statuses#index',
as: :proof_statuses do
accept 'application/json'
doc title: 'index of proof statuses',
body: <<-BODY
Will return a representation of the proof statuses index.
BODY
end
specified_get '*locid' => 'api/v1/proof_statuses#show',
as: :proof_status_iri,
constraints: [
LocIdRouterConstraint.new(ProofStatus, element: :id),
] do
accept 'application/json'
doc title: 'loc/id reference to a proof status',
body: <<-BODY
Will return a representation of the proof status. The proof status
is determined according to the *locid.
BODY
end
#
###############
get '/after_signup', to: 'home#show' , as: 'after_sign_up'
devise_for :users, controllers: {
confirmations: 'users/confirmations',
registrations: 'users/registrations'
}
resources :users, only: :show
namespace 'users' do
resource :api_keys, only: %w(create)
end
resources :keys, except: [:show, :edit, :update]
resources :logics, only: [:index, :show] do
resources :supports, :only => [:create, :update, :destroy, :index]
resources :graphs, :only => [:index]
end
resources :languages do
resources :supports, :only => [:create, :update, :destroy, :index]
end
resources :language_mappings
resources :logic_mappings, except: %i(index show)
specified_get '/logic_mappings' => 'logic_mappings#index',
as: :logic_mapping do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/logic_mappings#index'
doc title: 'index of logic mappings',
body: <<-BODY
Will return a representation of the logic mappings index.
BODY
end
specified_get '/logic_mappings/:id' => 'logic_mappings#show',
as: :logic_mapping do
accept 'text/html'
reroute_on_mime 'application/json', to: 'api/v1/logic_mappings#show'
doc title: 'id reference to a logic mapping',
body: <<-BODY
Will return a representation of the logic mapping. The logic mapping
is determined according to the id.
BODY
end
resources :mappings, only: :index
resources :categories, :only => [:index, :show]
resources :projects
resources :tasks
resources :license_models
resources :formality_levels
resources :language_adjoints
resources :logic_adjoints
resources :serializations
namespace :admin do
resources :teams, :only => :index
resources :users
resources :jobs, :only => :index
resources :status, only: :index
end
authenticate :user, lambda { |u| u.admin? } do
mount Sidekiq::Web => 'admin/sidekiq'
end
resources :ontologies, only: [:index] do
collection do
get 'search' => 'ontology_search#search'
end
end
resources :mappings do
get 'update_version', :on => :member
end
resources :teams do
resources :permissions, :only => [:index], :controller => 'teams/permissions'
resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
end
get 'autocomplete' => 'autocomplete#index'
get 'symbols_search' => 'symbols_search#index'
resources :repositories do
post 'undestroy',
controller: :repositories,
action: :undestroy,
as: :undestroy
resources :s_s_h_access, :only => :index, path: 'ssh_access'
resources :permissions, :only => [:index, :create, :update, :destroy]
resources :url_maps, except: :show
resources :errors, :only => :index
resources :repository_settings, :only => :index
resources :ontologies, only: [:index, :show, :edit, :update, :destroy] do
collection do
post 'retry_failed' => 'ontologies#retry_failed'
get 'search' => 'ontology_search#search'
end
member do
post 'retry_failed' => 'ontologies#retry_failed'
end
resources :children, :only => :index
resources :symbols, only: %i(index show)
resources :axioms, only: :index
resources :theorems, only: :index do
resources :proof_attempts, only: %i(index show) do
member do
post 'retry_failed' => 'proof_attempts#retry_failed'
end
resource :prover_output, only: :show
end
get '/proofs/new', controller: :proofs, action: :new
post '/proofs', controller: :proofs, action: :create
end
get '/proofs/new', controller: :proofs, action: :new
post '/proofs', controller: :proofs, action: :create
resources :mappings do
get 'update_version', :on => :member
end
resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
resource :oops_request, :only => [:show, :create]
end
resources :categories
resources :tasks
resources :license_models
resources :tools
resources :projects
resources :metadata, :only => [:index, :create, :destroy]
resources :comments, :only => [:index, :create, :destroy]
resources :graphs, :only => [:index]
resources :formality_levels
end
resources :files, only: [:new, :create]
resources :repository_directories, only: [:create]
get ':ref/files(/*path)',
controller: :files,
action: :show,
as: :ref,
constraints: FilesRouterConstraint.new
get ':ref/history(/:path)',
controller: :history,
action: :show,
as: :history,
constraints: { path: /.*/ }
get ':ref/diff',
controller: :diffs,
action: :show,
as: :diffs
# action: entries_info
get ':ref/:action(/:path)',
controller: :files,
as: :ref,
constraints: { path: /.*/ }
end
specified_get '/:id' => 'api/v1/repositories#show',
as: :repository_iri do
accept 'application/json', constraint: true
doc title: 'loc/id reference to a repository',
body: <<-BODY
Will return a representation of the repository. The repository
is determined according to its path, which is considered as
{id}.
BODY
end
specified_post '/:repository_id///combinations' => 'api/v1/combinations#create',
as: :repository_combinations_iri do
accept 'application/json', constraint: true
doc title: 'loc/id reference to a repository',
body: <<-BODY
Will return a representation of the repository. The repository
is determined according to its path, which is considered as
{id}.
BODY
end
post ':repository_id/:path',
controller: :files,
action: :update,
as: :repository_tree,
constraints: { path: /.*/ }
delete ':repository_id/*path',
controller: :files,
action: :destroy,
as: :repository_tree,
constraints: FilesRouterConstraint.new
get ':repository_id(/*path)',
controller: :files,
action: :show,
as: :repository_tree,
constraints: FilesRouterConstraint.new
get '*path',
controller: :ontologies,
action: :show,
as: :iri,
constraints: IRIRouterConstraint.new
root :to => 'home#index'
end