routes.rb revision c67b096189612bb816b4306ef88080b795b5cf41
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainenrequire 'sidekiq/web' if defined? Sidekiq
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenrequire Rails.root.join('lib', 'router_constraints.rb')
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenSpecroutes.define(Ontohub::Application.routes) do
ffd9a1898a18fadfc5dce399162c25d50548f905Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :filetypes, only: :create
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # IRI Routing #
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ###############
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # as per Loc/Id definition
a2f250a332dfc1e6cd4ffd196c621eb9dbf7b8a1Timo Sirainen
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen # Special (/ref-based) Loc/Id routes
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'api/v1/ontology_versions#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ontology_iri_versioned,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'application/json', constraint: true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/plain', constraint: true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # reroute_on_mime 'application/json', to: 'api/v1/ontology_versions#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the ontology at a
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenontology version referenced by the {reference}.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
221351ed85c839e0b03d82c47654c3d17202e3dbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'ontologies#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ontology_iri_versioned,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the ontology at a
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenontology version referenced by the {reference}.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # MMT-Support
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'ontologies#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ontology_iri_mmt,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen MMTRouterConstraint.new(Ontology, ontology: :id),
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen doc title: 'MMT reference to an ontology',
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen body: <<-BODY
7ded22760598b78ee29f9418eacc0abe3fb51055Timo SirainenWill return a representation of the ontology. The ontology
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainenis determined according to the *path and to the MMT-query-string.
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen BODY
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen end
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'mappings#show',
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen as: :mapping_iri_mmt,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen MMTRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen doc title: 'MMT reference to a mapping',
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen body: <<-BODY
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo SirainenWill return a representation of the mapping. The mapping
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainenis determined according to the *path and to the MMT-query-string.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen end
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'symbols#index',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :symbol_iri_mmt,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen MMTRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen doc title: 'MMT reference to a symbol',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the symbol. The symbol
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainenis determined according to the *path and to the MMT-query-string.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenCurrently the representation ist a list of all symbols in the ontology.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'axioms#index',
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen as: :axiom_iri_mmt,
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen constraints: [
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen MMTRouterConstraint.new(Axiom, ontology: :ontology_id),
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen ] do
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen accept 'text/html'
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen doc title: 'MMT reference to a axiom',
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen body: <<-BODY
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo SirainenWill return a representation of the axiom. The axiom
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainenis determined according to the *path and to the MMT-query-string.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenCurrently the representation is a list of all axioms in the ontology.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'theorems#index',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :theorem_iri_mmt,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen MMTRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'text/html'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen doc title: 'MMT reference to a theorem',
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill return a representation of the theorem. The theorem
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainenis determined according to the *path and to the MMT-query-string.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenCurrently the representation is a list of all theorems in the ontology.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'api/v1/proof_attempt_configurations#show',
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen as: :proof_attempt_configuration_iri_mmt,
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen MMTRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id),
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'application/json'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen doc title: 'MMT reference to a proof attempt configuration',
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill return a representation of the proof attempt configuration. The proof
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainenattempt configuration is determined according to the *path and to the
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenMMT-query-string.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
8ababf3e7b15f793370d1dedf85825d38b42633fTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen # Subsites for ontologies
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ontology_subsites = %i(
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen comments metadata graphs
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen projects categories tasks
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen )
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ontology_api_subsites = %i(
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen mappings symbols children
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen axioms theorems
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ontology_versions
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen license_models formality_levels
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen proof_attempt_configurations
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen )
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ontology_subsites.each do |category|
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen as: :"ontology_iri_#{category}",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'text/html'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill provide a subsite of a specific ontology.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ontology_api_subsites.each do |category|
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen as: :"ontology_iri_#{category}",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'text/html'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{category}#index"
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill provide a subsite of a specific ontology.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen specified_get "/:repository_id/*locid///sentences" => "api/v1/sentences#index",
9573f4283f9118315b0865998d43223fedee0246Timo Sirainen as: :"ontology_iri_sentences",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ] do
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen accept 'application/json'
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen doc title: "Ontology subsite about sentences",
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen body: <<-BODY
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo SirainenWill provide a subsite of a specific ontology.
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen BODY
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen end
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen
6c9699d37fbe4d8af3682ee7f341ede8d54faa87Timo Sirainen # Loc/Id-Show(-equivalent) routes
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen ######
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen specified_get '/:repository_id/*locid' => 'ontologies#show',
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen as: :ontology_iri,
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen constraints: [
ed50658501d9ae8c85f6264831056b1debed11c3Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :id),
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'text/html'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen doc title: 'loc/id reference to an ontology',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill return a representation of the ontology. The ontology
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainenis determined according to the *locid.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/:repository_id/*locid' => 'mappings#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :mapping_iri,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen LocIdRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
1fd0d511885c30028aba388588151acf4ee85e75Timo Sirainen ] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen doc title: 'loc/id reference to a mapping',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the mapping. The mapping
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenis determined according to the *locid.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
cfa9359fbd6a967ccdcd553c5e483a093885ab6fTimo Sirainen specified_get '/:repository_id/*locid' => 'symbols#index',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :symbol_iri,
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen LocIdRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id, element: :id),
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ] do
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen accept 'text/html'
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
ffd9a1898a18fadfc5dce399162c25d50548f905Timo Sirainen
ffd9a1898a18fadfc5dce399162c25d50548f905Timo Sirainen doc title: 'loc/id reference to a symbol',
ffd9a1898a18fadfc5dce399162c25d50548f905Timo Sirainen body: <<-BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo SirainenWill return a representation of the symbol. The symbol
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainenis determined according to the *locid.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenCurrently this will return the list of all symbols of the ontology.
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen BODY
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen theorems_subsites = %i(proof_attempts)
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen theorems_subsites.each do |subsite|
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "#{subsite}#index",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen as: :"theorem_iri_#{subsite}",
746d35bf3dba3ae5ddbcecb9732f60d5e9de77efTimo Sirainen constraints: [
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :theorem_id),
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen ] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
3675a7e9bd3775ba13fe8bc93915902513a0f1a4Timo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{subsite}#index"
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
1fd0d511885c30028aba388588151acf4ee85e75Timo Sirainen doc title: 'loc/id reference to a theorem subsite',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen Will return a representation of the theorem subsite. The theorem
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen is determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen proof_attempt_api_subsites = %i(
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen used_axioms generated_axioms
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen used_theorems prover_output
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen )
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen proof_attempt_api_subsites.each do |subsite|
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempts##{subsite}",
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :"proof_attempt_iri_#{subsite}",
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'application/json'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen doc title: 'loc/id reference to a proof attempt subsite',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen Will return a subsite of the proof attempt. The proof attempt is determined
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get '/:repository_id/*locid' => 'axioms#index',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :axiom_iri,
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(Axiom, ontology: :ontology_id, element: :id),
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'text/html'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen doc title: 'loc/id reference to an axiom',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenWill return a representation of the axiom. The axiom
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainenis determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenCurrently this will return the list of all axioms of the ontology.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get '/:repository_id/*locid' => 'theorems#index',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :theorem_iri,
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'text/html'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/theorems#show'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen doc title: 'loc/id reference to a theorem',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenWill return a representation of the theorem. The theorem
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainenis determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen proof_attempt_configuration_api_subsites =
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen %i(selected_axioms selected_theorems)
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen proof_attempt_configuration_api_subsites.each do |subsite|
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempt_configurations##{subsite}",
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :"proof_attempt_configuration_iri_#{subsite}",
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id, element: :id),
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'application/json'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen doc title: 'loc/id reference to a proof attempt configuration subsite',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen Will return a subsite of the proof attempt configuration. The proof attempt
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen configuration is determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get '/:repository_id/*locid' => 'api/v1/proof_attempt_configurations#show',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :proof_attempt_configuration_iri,
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(ProofAttemptConfiguration, ontology: :ontology_id, element: :id),
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'application/json'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen doc title: 'loc/id reference to a proof attempt configuration',
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenWill return a representation of the proof attempt configuration. The proof attempt configuration
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainenis determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen end
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get '/:repository_id/*locid' => 'sentences#index',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :sentence_iri,
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(Sentence, ontology: :ontology_id, element: :id),
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen ] do
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen accept 'text/html'
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/sentences#show'
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen doc title: 'loc/id reference to a sentence',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen body: <<-BODY
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenWill return a representation of the sentence. The sentence
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainenis determined according to the *locid.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo SirainenCurrently this will return the list of all sentences of the ontology.
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen BODY
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen end
b8d232d88018c5cafd2f3be5a181d318137a45f2Timo Sirainen
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen specified_get '/:repository_id/*locid' => 'proof_attempts#show',
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen as: :proof_attempt_iri,
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen constraints: [
2bd2ca14d18819b77201ab2b46910d9ae6858abeTimo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/proof_attempts#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen doc title: 'loc/id reference to a proof attempt',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the proof attempt. The proof attempt
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenis determined according to the *locid.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/ontology_types/:id' => 'ontology_types#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ontology_type do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontology_types#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'IRI of an ontology type',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the ontology type.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get '/logics/:id' => 'logics#show',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :logic do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'text/html'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'text/xml', to: 'api/v1/logics#show'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen reroute_on_mime 'application/xml', to: 'api/v1/logics#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/rdf+xml', to: 'api/v1/logics#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/logics#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'IRI of a logic',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the logic.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get '/license_models/:id' => 'license_models#show',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :license_model do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/license_models#show'
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen doc title: 'IRI of a license model',
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen body: <<-BODY
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo SirainenWill return a representation of the license model.
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen BODY
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen end
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen specified_get '/formality_levels/:id' => 'formality_levels#show',
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen as: :formality_level do
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen accept 'text/html'
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/formality_levels#show'
2d49f150b4bce6f2f59a84e268e4777901c3e42cTimo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'IRI of a formality level',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the formality level.
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen #
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen ###############
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen get '/after_signup', to: 'home#show' , as: 'after_sign_up'
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen devise_for :users, controllers: {
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen confirmations: 'users/confirmations',
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen registrations: 'users/registrations'
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen }
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen resources :users, only: :show
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen namespace 'users' do
f7656d7bc15510a4259ed74ddda3c560de8a51c1Timo Sirainen resource :api_keys, only: %w(create)
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen resources :keys, except: [:show, :edit, :update]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :logics, only: [:index, :show] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen resources :supports, :only => [:create, :update, :destroy, :index]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :graphs, :only => [:index]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :languages do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :supports, :only => [:create, :update, :destroy, :index]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :language_mappings
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :logic_mappings
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :mappings, only: :index
7eff76882487ef39803446f75a709a97a3cafc53Timo Sirainen
7eff76882487ef39803446f75a709a97a3cafc53Timo Sirainen resources :categories, :only => [:index, :show]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :projects
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :tasks
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen resources :license_models
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen resources :formality_levels
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :language_adjoints
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :logic_adjoints
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen resources :serializations
3e559edb905bb57d1f1fbfda3431b339f45ea791Timo Sirainen
608ae99c5b03989df263d72e49aa83e1f9d8a50eTimo Sirainen namespace :admin do
608ae99c5b03989df263d72e49aa83e1f9d8a50eTimo Sirainen resources :teams, :only => :index
608ae99c5b03989df263d72e49aa83e1f9d8a50eTimo Sirainen resources :users
608ae99c5b03989df263d72e49aa83e1f9d8a50eTimo Sirainen resources :jobs, :only => :index
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen resources :status, only: :index
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen end
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen authenticate :user, lambda { |u| u.admin? } do
50031a6b36a6051512bd18f39e4bbabe54acf565Timo Sirainen mount Sidekiq::Web => 'admin/sidekiq'
3e559edb905bb57d1f1fbfda3431b339f45ea791Timo Sirainen end
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen resources :ontologies, only: [:index] do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen collection do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get 'search' => 'ontology_search#search'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :mappings do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get 'update_version', :on => :member
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :teams do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :permissions, :only => [:index], :controller => 'teams/permissions'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen get 'autocomplete' => 'autocomplete#index'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get 'symbols_search' => 'symbols_search#index'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :repositories do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen post 'undestroy',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen controller: :repositories,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen action: :undestroy,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :undestroy
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :s_s_h_access, :only => :index, path: 'ssh_access'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :permissions, :only => [:index, :create, :update, :destroy]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :url_maps, except: :show
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :errors, :only => :index
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :repository_settings, :only => :index
91add6e26ed2b91e15276c96ffe02d9f71476d71Timo Sirainen
91add6e26ed2b91e15276c96ffe02d9f71476d71Timo Sirainen resources :ontologies, only: [:index, :show, :edit, :update, :destroy] do
91add6e26ed2b91e15276c96ffe02d9f71476d71Timo Sirainen collection do
91add6e26ed2b91e15276c96ffe02d9f71476d71Timo Sirainen post 'retry_failed' => 'ontologies#retry_failed'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get 'search' => 'ontology_search#search'
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen member do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen post 'retry_failed' => 'ontologies#retry_failed'
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :children, :only => :index
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :symbols, only: %i(index show)
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :axioms, only: :index
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :theorems, only: :index do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :proof_attempts, only: %i(index show)
0f66f12eb4cdbf47670975044c88d8f388bf92dfTimo Sirainen get '/proofs/new', controller: :proofs, action: :new
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen post '/proofs', controller: :proofs, action: :create
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen get '/proofs/new', controller: :proofs, action: :new
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen post '/proofs', controller: :proofs, action: :create
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen resources :mappings do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen get 'update_version', :on => :member
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resource :oops_request, :only => [:show, :create]
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :categories
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :tasks
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :license_models
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :tools
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :projects
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :metadata, :only => [:index, :create, :destroy]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :comments, :only => [:index, :create, :destroy]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :graphs, :only => [:index]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :formality_levels
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen resources :files, only: [:new, :create]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen resources :repository_directories, only: [:create]
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen get ':ref/files(/*path)',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen controller: :files,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen action: :show,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ref,
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen constraints: FilesRouterConstraint.new
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get ':ref/history(/:path)',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen controller: :history,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen action: :show,
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen as: :history,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: { path: /.*/ }
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen get ':ref/diff',
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen controller: :diffs,
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen action: :show,
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen as: :diffs
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen # action: entries_info
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen get ':ref/:action(/:path)',
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen controller: :files,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :ref,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen constraints: { path: /.*/ }
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen end
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen specified_get '/:id' => 'api/v1/repositories#show',
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :repository_iri do
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen accept 'application/json', constraint: true
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen doc title: 'loc/id reference to a repository',
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen body: <<-BODY
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo SirainenWill return a representation of the repository. The repository
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainenis determined according to its path, which is considered as
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen{id}.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_post '/:repository_id///combinations' => 'api/v1/combinations#create',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :repository_combinations_iri do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'application/json', constraint: true
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'loc/id reference to a repository',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the repository. The repository
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainenis determined according to its path, which is considered as
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen{id}.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen post ':repository_id/:path',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen controller: :files,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen action: :update,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :repository_tree,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: { path: /.*/ }
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen get ':repository_id(/*path)',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen controller: :files,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen action: :show,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen as: :repository_tree,
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen constraints: FilesRouterConstraint.new
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen get '*path',
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen controller: :ontologies,
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen action: :show,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :iri,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: IRIRouterConstraint.new
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen root :to => 'home#index'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2aa3ac8bfb8fea49fd0ab6d56afcb3af3375d22cTimo Sirainenend
2a34e2be33f8a17d21384a5527ed9f75f4d270e0Timo Sirainen