routes.rb revision 94e57e017dbd7f0ecd388a648a731b840db24418
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenrequire Rails.root.join('lib', 'router_constraints.rb')
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenSpecroutes.define(Ontohub::Application.routes) do
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # IRI Routing #
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen ###############
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # as per Loc/Id definition
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen specified_get '/actions/:id' => 'api/v1/actions#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'An action that represents a long-running operation'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # Special (/ref-based) Loc/Id routes
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'api/v1/ontology_versions#show',
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # reroute_on_mime 'application/json', to: 'api/v1/ontology_versions#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology at a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenontology version referenced by the {reference}.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/:reference/:repository_id/*locid' => 'ontologies#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :ontology_iri_versioned,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen RefLocIdRouterConstraint.new(Ontology, ontology: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'Ontology IRI (loc/id) with version reference',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology at a
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenontology version referenced by the {reference}.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen # MMT-Support
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'ontologies#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :ontology_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Ontology, ontology: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to an ontology',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the ontology. The ontology
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'mappings#show',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :mapping_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a mapping',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the mapping. The mapping
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'symbols#index',
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainen as: :symbol_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainen doc title: 'MMT reference to a symbol',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo SirainenWill return a representation of the symbol. The symbol
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo SirainenCurrently the representation ist a list of all symbols in the ontology.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'axioms#index',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :axiom_iri_mmt,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Axiom, ontology: :ontology_id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/axioms#show'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a axiom',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the axiom. The axiom
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *path and to the MMT-query-string.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenCurrently the representation is a list of all axioms in the ontology.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'theorems#index',
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen as: :theorem_iri_mmt,
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen MMTRouterConstraint.new(Theorem, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'MMT reference to a theorem',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the theorem. The theorem
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainenis determined according to the *path and to the MMT-query-string.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenCurrently the representation is a list of all theorems in the ontology.
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen specified_get '/ref/mmt/:repository_id/*path' => 'api/v1/proof_attempt_configurations#show',
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen as: :proof_attempt_configuration_iri_mmt,
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen MMTRouterConstraint.new(ProofAttempt, element: :proof_attempt_id),
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen accept 'application/json'
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen doc title: 'MMT reference to a proof attempt configuration',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenWill return a representation of the proof attempt configuration. The proof
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainenattempt configuration is determined according to the *path and to the
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo SirainenMMT-query-string.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen # Subsites for ontologies
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_subsites = %i(
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen comments metadata graphs
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen projects categories tasks
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_api_subsites = %i(
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen mappings symbols children
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen axioms theorems
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen ontology_versions
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen license_models formality_levels
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen ontology_subsites.each do |category|
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"ontology_iri_#{category}",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen constraints: [
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen accept 'text/html'
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen body: <<-BODY
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo SirainenWill provide a subsite of a specific ontology.
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen ontology_api_subsites.each do |category|
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen specified_get "/:repository_id/*locid///#{category}" => "#{category}#index",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen as: :"ontology_iri_#{category}",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen constraints: [
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen accept 'text/html'
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{category}#index"
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about #{category.to_s.gsub(/_/, ' ')}",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen body: <<-BODY
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo SirainenWill provide a subsite of a specific ontology.
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen specified_get "/:repository_id/*locid///sentences" => "api/v1/sentences#index",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen as: :"ontology_iri_sentences",
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen constraints: [
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :ontology_id),
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen accept 'application/json'
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainen doc title: "Ontology subsite about sentences",
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo Sirainen body: <<-BODY
b2024fa4e6ed39f9b5b6bb6c051f6d535fc0e011Timo SirainenWill provide a subsite of a specific ontology.
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen # Loc/Id-Show(-equivalent) routes
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen specified_get '/:repository_id/*locid' => 'ontologies#show',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen as: :ontology_iri,
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen constraints: [
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen LocIdRouterConstraint.new(Ontology, ontology: :id),
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'text/html'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'text/plain', to: 'api/v1/ontologies#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/ontologies#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen doc title: 'loc/id reference to an ontology',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen body: <<-BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo SirainenWill return a representation of the ontology. The ontology
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainenis determined according to the *locid.
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen specified_get '/:repository_id/*locid' => 'mappings#show',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen as: :mapping_iri,
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen constraints: [
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen LocIdRouterConstraint.new(Mapping, ontology: :ontology_id, element: :id),
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'text/html'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/mappings#show'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen doc title: 'loc/id reference to a mapping',
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen body: <<-BODY
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo SirainenWill return a representation of the mapping. The mapping
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainenis determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/:repository_id/*locid' => 'symbols#index',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :symbol_iri,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(OntologyMember::Symbol, ontology: :ontology_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'text/html'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen reroute_on_mime 'application/json', to: 'api/v1/symbols#show'
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen doc title: 'loc/id reference to a symbol',
f158d9a303bb15a6848ca276c9391c7ca52e452bTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenWill return a representation of the symbol. The symbol
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenis determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenCurrently this will return the list of all symbols of the ontology.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen theorems_subsites = %i(proof_attempts)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen theorems_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "#{subsite}#index",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"theorem_iri_#{subsite}",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen LocIdRouterConstraint.new(Theorem, ontology: :ontology_id, element: :theorem_id),
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen accept 'text/html'
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/#{subsite}#index"
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen doc title: 'loc/id reference to a theorem subsite',
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen body: <<-BODY
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen Will return a representation of the theorem subsite. The theorem
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen is determined according to the *locid.
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen specified_get "/:repository_id/*locid" => "prover_outputs#show",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen as: :"prover_output_iri",
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen constraints: [
5e9bb72de1209cd39fdf3e95bdb26e047cc5594eTimo Sirainen LocIdRouterConstraint.new(ProverOutput, ontology: :ontology_id, theorem: :theorem_id, proof_attempt: :proof_attempt_id, element: :id),
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen accept 'application/json'
caa1fa99c79c568ce2e42477bc169e7024fb220bTimo Sirainen reroute_on_mime 'application/json', to: "api/v1/prover_outputs#show"
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'loc/id reference to a prover output',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a prover output.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen The prover output is determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen proof_attempt_api_subsites = %i(
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen used_axioms generated_axioms
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen used_theorems prover_output
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen proof_attempt_api_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/proof_attempts##{subsite}",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :"proof_attempt_iri_#{subsite}",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(ProofAttempt, ontology: :ontology_id, theorem: :theorem_id, element: :id),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json'
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen doc title: 'loc/id reference to a proof attempt subsite',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a subsite of the proof attempt. The proof attempt is determined
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_types = %i(axiom theorem)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_api_subsites = %i(symbols)
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_types.each do |type|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen sentence_api_subsites.each do |subsite|
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get "/:repository_id/*locid///#{subsite}" => "api/v1/#{subsite}#index",
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :"#{type}_iri_#{subsite}",
bcbca4b66800f0fbfe2643a86d5a6b63d752454dTimo Sirainen constraints: [
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen LocIdRouterConstraint.new(type.to_s.camelize.constantize, ontology: :ontology_id, element: :"sentence_id"),
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen accept 'application/json'
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen doc title: "loc/id reference to a #{type} subsite",
9522aa5f33cc37fe8ccd0d647cc51dd3ba6a9b55Timo Sirainen body: <<-BODY
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen Will return a representation of the #{type} subsite. The #{type}
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen is determined according to the *locid.
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen specified_get '/:repository_id/*locid' => 'axioms#index',
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen as: :axiom_iri,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen constraints: [
specified_get "/:repository_id/*locid///proof-attempt-configuration///#{subsite}" => "api/v1/proof_attempt_configurations##{subsite}",
specified_get '/:repository_id/*locid///proof-attempt-configuration' => 'api/v1/proof_attempt_configurations#show',