routes.rb revision abd7c27a83ab2ad7c8bdd27c561a8023cd7f66df
76b43e4417bab52e913da39b5f5bc2a130d3f149Timo Sirainenrequire 'sidekiq/web' if defined? Sidekiq
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainenrequire Rails.root.join('lib', 'router_constraints.rb')
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
8aacc9e7c84f8376822823ec98c2f551d4919b2eTimo SirainenSpecroutes.define(Ontohub::Application.routes) do
16f816d3f3c32ae3351834253f52ddd0212bcbf3Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen resources :filetypes, only: :create
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen # IRI Routing #
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ###############
463e82bdf0e990f4f2252d2b53ea23a5abe5883cTimo Sirainen # as per Loc/Id definition
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen specified_get '/actions/:id' => 'api/v1/actions#show',
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen as: :action_iri,
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen format: :json do
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen accept 'application/json', constraint: true
d41573018e85896ec836d897fd554e87126147f5Timo Sirainen doc title: 'An action that represents a long-running operation'
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen end
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen # Special (/ref-based) Loc/Id routes
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'api/v1/ontology_versions#show',
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen as: :ontology_iri_versioned,
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen constraints: [
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen ] do
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen accept 'application/json', constraint: true
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen accept 'text/plain', constraint: true
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen # reroute_on_mime 'application/json', to: 'api/v1/ontology_versions#show'
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen body: <<-BODY
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo SirainenWill return a representation of the ontology at a
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainenontology version referenced by the {reference}.
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen BODY
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen end
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'ontologies#show',
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen as: :ontology_iri_versioned,
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen constraints: [
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :id),
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen ] do
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen accept 'text/html'
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen
7bd3f5614e0dd2324dd1015f084de72c0b069a1aTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
7bd3f5614e0dd2324dd1015f084de72c0b069a1aTimo Sirainen body: <<-BODY
7bd3f5614e0dd2324dd1015f084de72c0b069a1aTimo SirainenWill return a representation of the ontology at a
7bd3f5614e0dd2324dd1015f084de72c0b069a1aTimo Sirainenontology version referenced by the {reference}.
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen BODY
51795bfe9d05d92fe942cb451aec2b9d16d32a11Timo Sirainen end
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen # MMT-Support
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'ontologies#show',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :ontology_iri_mmt,
bbf796c17f02538058d7559bfe96d677e5b55015Timo Sirainen constraints: [
e6d7d19c328e7043ad35d5a52c1617bde915a16fTimo Sirainen MMTRouterConstraint.new(Ontology, ontology: :id),
d7095f3a4466fbb78b2d5eb3d322bc15a5b0ab1fTimo Sirainen ] do
153de7823e64c67678b3fc95719c41a8ec5b864dTimo Sirainen accept 'text/html'
153de7823e64c67678b3fc95719c41a8ec5b864dTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen
bbf796c17f02538058d7559bfe96d677e5b55015Timo Sirainen doc title: 'MMT reference to an ontology',
e6d7d19c328e7043ad35d5a52c1617bde915a16fTimo Sirainen body: <<-BODY
8d131435ba4648c8821160ec38d508c97177c715Timo SirainenWill return a representation of the ontology. The ontology
9315dd69233d554452df0c12bc57002d2042a8f4Timo Sirainenis determined according to the *path and to the MMT-query-string.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
538c58fc95200fcc5e91abdda8b912b574a2f968Timo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'mappings#show',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :mapping_iri_mmt,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
945631faab2bf1aed8d95a1fd0c317a9ce153725Timo Sirainen MMTRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ] do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen accept 'text/html'
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'MMT reference to a mapping',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the mapping. The mapping
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainenis determined according to the *path and to the MMT-query-string.
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen BODY
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen end
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'symbols#index',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :symbol_iri_mmt,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen MMTRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id),
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen ] do
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen accept 'text/html'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
bbf796c17f02538058d7559bfe96d677e5b55015Timo Sirainen doc title: 'MMT reference to a symbol',
8aacc9e7c84f8376822823ec98c2f551d4919b2eTimo Sirainen body: <<-BODY
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenWill return a representation of the symbol. The symbol
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainenis determined according to the *path and to the MMT-query-string.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenCurrently the representation ist a list of all symbols in the ontology.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen BODY
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen end
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'axioms#index',
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen as: :axiom_iri_mmt,
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen constraints: [
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen MMTRouterConstraint.new(Axiom, ontology: :ontology_id),
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen ] do
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen accept 'text/html'
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen doc title: 'MMT reference to a axiom',
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen body: <<-BODY
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenWill return a representation of the axiom. The axiom
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainenis determined according to the *path and to the MMT-query-string.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenCurrently the representation is a list of all axioms in the ontology.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen BODY
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen end
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'theorems#index',
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen as: :theorem_iri_mmt,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen constraints: [
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen MMTRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen ] do
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen accept 'text/html'
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen doc title: 'MMT reference to a theorem',
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen body: <<-BODY
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenWill return a representation of the theorem. The theorem
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainenis determined according to the *path and to the MMT-query-string.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo SirainenCurrently the representation is a list of all theorems in the ontology.
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen BODY
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen end
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'api/v1/proof_attempt_configurations#show',
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen as: :proof_attempt_configuration_iri_mmt,
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen constraints: [
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen MMTRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen ] do
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen accept 'application/json'
1cad0dd34667548ba39f794ddeb9fc486cf4c666Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen doc title: 'MMT reference to a proof attempt configuration',
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen body: <<-BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo SirainenWill return a representation of the proof attempt configuration. The proof
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainenattempt configuration is determined according to the *path and to the
a28a6267f48971117dec958b160deefd14ebb7a6Timo SirainenMMT-query-string.
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen # Subsites for ontologies
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ontology_subsites = %i(
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen comments metadata graphs
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen projects categories tasks
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen )
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen ontology_api_subsites = %i(
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen mappings symbols children
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen axioms theorems
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ontology_versions
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen license_models formality_levels
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen )
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ontology_subsites.each do |category|
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :"ontology_iri_#{category}",
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen ] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen body: <<-BODY
a28a6267f48971117dec958b160deefd14ebb7a6Timo SirainenWill provide a subsite of a specific ontology.
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ontology_api_subsites.each do |category|
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen as: :"ontology_iri_#{category}",
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen constraints: [
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen ] do
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen accept 'text/html'
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{category}#index"
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen body: <<-BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo SirainenWill provide a subsite of a specific ontology.
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen end
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen specified_get "/:repository_id/*locid///sentences" => "api/v1/sentences#index",
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen as: :"ontology_iri_sentences",
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen constraints: [
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen ] do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen accept 'application/json'
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen doc title: "Ontology subsite about sentences",
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill provide a subsite of a specific ontology.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen # Loc/Id-Show(-equivalent) routes
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ######
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen specified_get '/:repository_id/*locid' => 'ontologies#show',
9315dd69233d554452df0c12bc57002d2042a8f4Timo Sirainen as: :ontology_iri,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :id),
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
7889c9f65e23c83fc31cecf304cab4ab070d6aa1Timo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen doc title: 'loc/id reference to an ontology',
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the ontology. The ontology
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainenis determined according to the *locid.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen specified_get '/:repository_id/*locid' => 'mappings#show',
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen as: :mapping_iri,
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen constraints: [
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen LocIdRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen ] do
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainen accept 'text/html'
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'loc/id reference to a mapping',
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the mapping. The mapping
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainenis determined according to the *locid.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get '/:repository_id/*locid' => 'symbols#index',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :symbol_iri,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen LocIdRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id, element: :id),
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ] do
3da614c39dd29f536c485089e67839b4cf89fed3Timo Sirainen accept 'text/html'
3da614c39dd29f536c485089e67839b4cf89fed3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'loc/id reference to a symbol',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo SirainenWill return a representation of the symbol. The symbol
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo Sirainenis determined according to the *locid.
31050c3df6cbe403e8ced8ef11b5c4e12124d354Timo SirainenCurrently this will return the list of all symbols of the ontology.
075f90abe6b6b12dc72bca21bfce8086b4b190ecTimo Sirainen BODY
9bc6e10d9c6d6ffb4a2ed49a3b3d2a180f2a87a3Timo Sirainen end
9bc6e10d9c6d6ffb4a2ed49a3b3d2a180f2a87a3Timo Sirainen
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen theorems_subsites = %i(proof_attempts)
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen theorems_subsites.each do |subsite|
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "#{subsite}#index",
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :"theorem_iri_#{subsite}",
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen constraints: [
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :theorem_id),
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen ] do
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen accept 'text/html'
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{subsite}#index"
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'loc/id reference to a theorem subsite',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen Will return a representation of the theorem subsite. The theorem
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen is determined according to the *locid.
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen BODY
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen end
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen end
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get "/:repository_id/*locid" => "prover_outputs#show",
abfcd9f73b9ad1eeef4fe6e9940383defabf68c3Timo Sirainen as: :"prover_output_iri",
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: [
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen LocIdRouterConstraint.new(ProverOutput, ontology: :ontology_id, theorem: :theorem_id, proof_attempt: :proof_attempt_id, element: :id),
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen ] do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen accept 'application/json'
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/prover_outputs#show"
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen doc title: 'loc/id reference to a prover output',
abfcd9f73b9ad1eeef4fe6e9940383defabf68c3Timo Sirainen body: <<-BODY
abfcd9f73b9ad1eeef4fe6e9940383defabf68c3Timo Sirainen Will return a prover output.
cd5ee8630497fdbd853ef588a858b4ef619a5e03Timo Sirainen The prover output is determined according to the *locid.
cd5ee8630497fdbd853ef588a858b4ef619a5e03Timo Sirainen BODY
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen end
7394389230750c45b105cdefb5850c81cae8cdc0Timo Sirainen
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen proof_attempt_api_subsites = %i(
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen used_axioms generated_axioms
7e94cf9d70ce9fdeccb7a85ff400b899e6386f36Timo Sirainen used_theorems prover_output
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen )
7e94cf9d70ce9fdeccb7a85ff400b899e6386f36Timo Sirainen proof_attempt_api_subsites.each do |subsite|
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempts##{subsite}",
9887c39c5ba429169389153ca99de49e084a73f0Timo Sirainen as: :"proof_attempt_iri_#{subsite}",
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen constraints: [
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen ] do
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen accept 'application/json'
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'loc/id reference to a proof attempt subsite',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen body: <<-BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen Will return a subsite of the proof attempt. The proof attempt is determined
bf91bed88d4e294b4577ba2a3b14d87cf35ae135Timo Sirainen according to the *locid.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen sentence_types = %i(axiom theorem)
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen sentence_api_subsites = %i(symbols)
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen sentence_types.each do |type|
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen sentence_api_subsites.each do |subsite|
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/#{subsite}#index",
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen as: :"#{type}_iri_#{subsite}",
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen constraints: [
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen LocIdRouterConstraint.new(type.to_s.camelize.constantize, ontology: :ontology_id, element: :"sentence_id"),
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen ] do
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen accept 'application/json'
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen doc title: "loc/id reference to a #{type} subsite",
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen body: <<-BODY
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen Will return a representation of the #{type} subsite. The #{type}
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen is determined according to the *locid.
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen BODY
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen end
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen end
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen specified_get '/:repository_id/*locid' => 'axioms#index',
2ebfb5c0608e2323b73271208f4036a7ea7d7f3aTimo Sirainen as: :axiom_iri,
2ebfb5c0608e2323b73271208f4036a7ea7d7f3aTimo Sirainen constraints: [
2ebfb5c0608e2323b73271208f4036a7ea7d7f3aTimo Sirainen LocIdRouterConstraint.new(Axiom, ontology: :ontology_id, element: :id),
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen ] do
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen accept 'text/html'
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen
41bb0aa8e357876bc9a1916a37c9e3e78e5f8185Timo Sirainen doc title: 'loc/id reference to an axiom',
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen body: <<-BODY
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo SirainenWill return a representation of the axiom. The axiom
dd8de60250511cc729b67249e61dfc6b4debff11Timo Sirainenis determined according to the *locid.
3342badd8c69adff34db589fb0a221ace5996212Timo SirainenCurrently this will return the list of all axioms of the ontology.
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen BODY
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen end
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen specified_get '/:repository_id/*locid' => 'theorems#index',
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen as: :theorem_iri,
20b9283d4af31e45e588014da427fb2dbcd3227aTimo Sirainen constraints: [
20b9283d4af31e45e588014da427fb2dbcd3227aTimo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen ] do
7394389230750c45b105cdefb5850c81cae8cdc0Timo Sirainen accept 'text/html'
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/theorems#show'
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen
20b9283d4af31e45e588014da427fb2dbcd3227aTimo Sirainen doc title: 'loc/id reference to a theorem',
20b9283d4af31e45e588014da427fb2dbcd3227aTimo Sirainen body: <<-BODY
20b9283d4af31e45e588014da427fb2dbcd3227aTimo SirainenWill return a representation of the theorem. The theorem
20b9283d4af31e45e588014da427fb2dbcd3227aTimo Sirainenis determined according to the *locid.
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen BODY
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
41bb0aa8e357876bc9a1916a37c9e3e78e5f8185Timo Sirainen
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen proof_attempt_configuration_api_subsites =
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen %i(selected_axioms selected_theorems)
b35f7104715edee0cfac6d46ab0b342033867eb7Timo Sirainen proof_attempt_configuration_api_subsites.each do |subsite|
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen specified_get "/:repository_id/*locid///proof-attempt-configuration///#{subsite}" => "api/v1/proof_attempt_configurations##{subsite}",
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen as: :"proof_attempt_configuration_iri_#{subsite}",
51920d00fa50edf7b2e9b1019288d64b7abee7f3Timo Sirainen constraints: [
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen LocIdRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
51920d00fa50edf7b2e9b1019288d64b7abee7f3Timo Sirainen ] do
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen accept 'application/json'
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen doc title: 'loc/id reference to a proof attempt configuration subsite',
21ec6628c567eeff025af35d8027be01044b0b1aTimo Sirainen body: <<-BODY
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen Will return a subsite of the proof attempt configuration. The proof attempt
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen configuration is determined according to the *locid.
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen BODY
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen end
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen end
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen specified_get '/:repository_id/*locid///proof-attempt-configuration' => 'api/v1/proof_attempt_configurations#show',
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen as: :proof_attempt_configuration_iri,
3342badd8c69adff34db589fb0a221ace5996212Timo Sirainen constraints: [
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen LocIdRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
a28a6267f48971117dec958b160deefd14ebb7a6Timo Sirainen ] do
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen accept 'application/json'
fa5957ffc9b676bfd649fa9953e63e72ee4ebeb4Timo Sirainen
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen doc title: 'loc/id reference to a proof attempt configuration',
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen body: <<-BODY
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo SirainenWill return a representation of the proof attempt configuration. The proof attempt configuration
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainenis determined according to the *locid.
e06c0b65c16ccce69bbee009ead14d7d3d17a256Timo Sirainen BODY
cd5ee8630497fdbd853ef588a858b4ef619a5e03Timo Sirainen end
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen specified_get '/:repository_id/*locid' => 'sentences#index',
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen as: :sentence_iri,
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen constraints: [
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen LocIdRouterConstraint.new(Sentence, ontology: :ontology_id, element: :id),
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen ] do
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen accept 'text/html'
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/sentences#show'
9887c39c5ba429169389153ca99de49e084a73f0Timo Sirainen
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen doc title: 'loc/id reference to a sentence',
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen body: <<-BODY
5a07b37a9df398b5189c14872a600384208ab74bTimo SirainenWill return a representation of the sentence. The sentence
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainenis determined according to the *locid.
5a07b37a9df398b5189c14872a600384208ab74bTimo SirainenCurrently this will return the list of all sentences of the ontology.
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen BODY
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen specified_get '/:repository_id/*locid' => 'proof_attempts#show',
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen as: :proof_attempt_iri,
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen constraints: [
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen ] do
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen accept 'text/html'
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/proof_attempts#show'
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen
1b3bb8d39686ed24730cbc31cc9a33dc62c8c6c3Timo Sirainen doc title: 'loc/id reference to a proof attempt',
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen body: <<-BODY
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo SirainenWill return a representation of the proof attempt. The proof attempt
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainenis determined according to the *locid.
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen BODY
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen end
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen specified_get '/ontology_types/:id' => 'ontology_types#show',
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen as: :ontology_type do
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen accept 'text/html'
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontology_types#show'
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen doc title: 'IRI of an ontology type',
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen body: <<-BODY
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo SirainenWill return a representation of the ontology type.
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen BODY
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen end
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen specified_get '/logics/:id' => 'logics#show',
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen as: :logic do
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen accept 'text/html'
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen reroute_on_mime 'text/xml', to: 'api/v1/logics#show'
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen reroute_on_mime 'application/xml', to: 'api/v1/logics#show'
d647e72663b52cb2301df5eaf93e67ee873a41f8Timo Sirainen reroute_on_mime 'application/rdf+xml', to: 'api/v1/logics#show'
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/logics#show'
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen doc title: 'IRI of a logic',
5a7b52012bf77132bb8f466d07e0e88c63fdba42Timo Sirainen body: <<-BODY
5a07b37a9df398b5189c14872a600384208ab74bTimo SirainenWill return a representation of the logic.
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen BODY
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen specified_get '/license_models/:id' => 'license_models#show',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen as: :license_model do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen accept 'text/html'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/license_models#show'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen doc title: 'IRI of a license model',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen body: <<-BODY
d143077bd518de129b8d446fb58e003903e50867Timo SirainenWill return a representation of the license model.
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen BODY
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen specified_get '/formality_levels/:id' => 'formality_levels#show',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen as: :formality_level do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen accept 'text/html'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/formality_levels#show'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen doc title: 'IRI of a formality level',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen body: <<-BODY
d143077bd518de129b8d446fb58e003903e50867Timo SirainenWill return a representation of the formality level.
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen BODY
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen specified_get '/proof-statuses' => 'api/v1/proof_statuses#index',
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen as: :proof_statuses do
e063aca6bc2f08bec516d4b631052ea9191f011dTimo Sirainen accept 'application/json'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen doc title: 'index of proof statuses',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen body: <<-BODY
d143077bd518de129b8d446fb58e003903e50867Timo SirainenWill return a representation of the proof statuses index.
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen BODY
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen specified_get '*locid' => 'api/v1/proof_statuses#show',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen as: :proof_status_iri,
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen constraints: [
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen LocIdRouterConstraint.new(ProofStatus, element: :id),
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen ] do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen accept 'application/json'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen doc title: 'loc/id reference to a proof status',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen body: <<-BODY
d143077bd518de129b8d446fb58e003903e50867Timo SirainenWill return a representation of the proof status. The proof status
d143077bd518de129b8d446fb58e003903e50867Timo Sirainenis determined according to the *locid.
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen BODY
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen #
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen ###############
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen get '/after_signup', to: 'home#show' , as: 'after_sign_up'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen devise_for :users, controllers: {
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen confirmations: 'users/confirmations',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen registrations: 'users/registrations'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen }
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :users, only: :show
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen namespace 'users' do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resource :api_keys, only: %w(create)
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :keys, except: [:show, :edit, :update]
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen resources :logics, only: [:index, :show] do
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen resources :supports, :only => [:create, :update, :destroy, :index]
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen resources :graphs, :only => [:index]
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen end
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen
2c677e9d339bc91d5b54376ba2986f71476c06abTimo Sirainen resources :languages do
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen resources :supports, :only => [:create, :update, :destroy, :index]
f81a4d2002da0db33d11ca694d3a91b3ee2a0fdbTimo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :language_mappings
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :logic_mappings, except: %i(index show)
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen specified_get '/logic_mappings' => 'logic_mappings#index',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen as: :logic_mapping do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen accept 'text/html'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/logic_mappings#index'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen doc title: 'index of logic mappings',
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen body: <<-BODY
a5b331e18b220fac557480b569b85215a1b3bd8eTimo SirainenWill return a representation of the logic mappings index.
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen BODY
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen end
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen
c91de2744f8c1e61e91082ff5e214450f28a0e7cTimo Sirainen specified_get '/logic_mappings/:id' => 'logic_mappings#show',
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen as: :logic_mapping do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen accept 'text/html'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen reroute_on_mime 'application/json', to: 'api/v1/logic_mappings#show'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen doc title: 'id reference to a logic mapping',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen body: <<-BODY
d143077bd518de129b8d446fb58e003903e50867Timo SirainenWill return a representation of the logic mapping. The logic mapping
d143077bd518de129b8d446fb58e003903e50867Timo Sirainenis determined according to the id.
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen BODY
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :mappings, only: :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :categories, :only => [:index, :show]
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :projects
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :tasks
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :license_models
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :formality_levels
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :language_adjoints
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :logic_adjoints
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :serializations
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen namespace :admin do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :teams, :only => :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :users
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :jobs, :only => :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :status, only: :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen end
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen authenticate :user, lambda { |u| u.admin? } do
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen mount Sidekiq::Web => 'admin/sidekiq'
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen end
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen resources :ontologies, only: [:index] do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen collection do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen get 'search' => 'ontology_search#search'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :mappings do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen get 'update_version', :on => :member
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :teams do
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :permissions, :only => [:index], :controller => 'teams/permissions'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :team_users, :only => [:index, :create, :update, :destroy], :path => 'users'
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen get 'autocomplete' => 'autocomplete#index'
2d79e603e20a32bdae4c2b516ead5c5c9169545aTimo Sirainen get 'symbols_search' => 'symbols_search#index'
86d52f310fe939090c66b780a3b6ffe5d10dc8faTimo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :repositories do
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen post 'undestroy',
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen controller: :repositories,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen action: :undestroy,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen as: :undestroy
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :s_s_h_access, :only => :index, path: 'ssh_access'
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :permissions, :only => [:index, :create, :update, :destroy]
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :url_maps, except: :show
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :errors, :only => :index
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen resources :repository_settings, :only => :index
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen
2d79e603e20a32bdae4c2b516ead5c5c9169545aTimo Sirainen resources :ontologies, only: [:index, :show, :edit, :update, :destroy] do
2d79e603e20a32bdae4c2b516ead5c5c9169545aTimo Sirainen collection do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen post 'retry_failed' => 'ontologies#retry_failed'
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen get 'search' => 'ontology_search#search'
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen end
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen member do
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen post 'retry_failed' => 'ontologies#retry_failed'
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen end
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :children, :only => :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :symbols, only: %i(index show)
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :axioms, only: :index
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :theorems, only: :index do
a5b331e18b220fac557480b569b85215a1b3bd8eTimo Sirainen resources :proof_attempts, only: %i(index show) do
a0d34d3982507f513a9d800082481e9faeb9a943Timo Sirainen member do
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen post 'retry_failed' => 'proof_attempts#retry_failed'
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resource :prover_output, only: :show
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen end
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen get '/proofs/new', controller: :proofs, action: :new
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen post '/proofs', controller: :proofs, action: :create
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen end
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen get '/proofs/new', controller: :proofs, action: :new
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen post '/proofs', controller: :proofs, action: :create
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen
16c89b1260c9d07c01c83a9219424d3727069b2eTimo Sirainen resources :mappings do
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen get 'update_version', :on => :member
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen end
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen resources :ontology_versions, :only => [:index, :show, :new, :create], :path => 'versions' do
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen resource :oops_request, :only => [:show, :create]
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen end
faed8babca9914257f34fb2e603d74016d563b2dTimo Sirainen resources :categories
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :tasks
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen resources :license_models
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen resources :tools
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen resources :projects
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen
20261d71760e4199cb8d906ab9704a4561d954d7Timo Sirainen resources :metadata, :only => [:index, :create, :destroy]
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :comments, :only => [:index, :create, :destroy]
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :graphs, :only => [:index]
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen resources :formality_levels
d143077bd518de129b8d446fb58e003903e50867Timo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen end
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen resources :files, only: [:new, :create]
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen resources :repository_directories, only: [:create]
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen get ':ref/files(/*path)',
7ded22760598b78ee29f9418eacc0abe3fb51055Timo Sirainen controller: :files,
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen action: :show,
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen as: :ref,
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen constraints: FilesRouterConstraint.new
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen get ':ref/history(/:path)',
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen controller: :history,
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen action: :show,
91d4c7b37580b031ed7b0154ae10c643521803f3Timo Sirainen as: :history,
0f66f12eb4cdbf47670975044c88d8f388bf92dfTimo Sirainen constraints: { path: /.*/ }
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen get ':ref/diff',
5626ae5e3316eced244adb6485c0927f1c7fdc41Timo Sirainen controller: :diffs,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen action: :show,
6a19e109ee8c5a6f688da83a86a7f6abeb71abddTimo Sirainen as: :diffs
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
ccffbed92cb02c24fd717808a84138240bf1885bTimo Sirainen # action: entries_info
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen get ':ref/:action(/:path)',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen controller: :files,
ccffbed92cb02c24fd717808a84138240bf1885bTimo Sirainen as: :ref,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen constraints: { path: /.*/ }
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen end
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen specified_get '/:id' => 'api/v1/repositories#show',
3697080532ccd9f51fac108be6079b616c7a2ddfTimo Sirainen as: :repository_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
ccffbed92cb02c24fd717808a84138240bf1885bTimo Sirainen{id}.
ccffbed92cb02c24fd717808a84138240bf1885bTimo Sirainen BODY
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen end
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen specified_post '/:repository_id///combinations' => 'api/v1/combinations#create',
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen as: :repository_combinations_iri do
1d3f7c1278168d5b1cbfa9a2cc9929a0909056b4Timo Sirainen accept 'application/json', constraint: true
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen
d12f05c7c391786d0d9795ec3aa4377280bbfaeaTimo Sirainen doc title: 'loc/id reference to a repository',
d12f05c7c391786d0d9795ec3aa4377280bbfaeaTimo Sirainen body: <<-BODY
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo SirainenWill return a representation of the repository. The repository
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainenis determined according to its path, which is considered as
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen{id}.
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen BODY
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen end
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen post ':repository_id/:path',
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen controller: :files,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen action: :update,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen as: :repository_tree,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen constraints: { path: /.*/ }
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen delete ':repository_id/*path',
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen controller: :files,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen action: :destroy,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen as: :repository_tree,
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen constraints: FilesRouterConstraint.new
e26a771fad55dfba4d5021d12ed5685c951d9b7bTimo Sirainen
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen get ':repository_id(/*path)',
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen controller: :files,
0cb2e8eb55e70f8ebe1e8349bdf49e4cbe5d8834Timo Sirainen action: :show,
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen as: :repository_tree,
b0be0bead3d6963149f7f2a9504b8ab5aced9af5Timo Sirainen constraints: FilesRouterConstraint.new
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainen root :to => 'home#index'
5a07b37a9df398b5189c14872a600384208ab74bTimo Sirainen
2a6af811ea3de3cf9e2f15e446674dd21b0705f3Timo Sirainenend
c3248869ddd406a7a46b8c05633f0cccc72fcb77Timo Sirainen