1818import org .semanticweb .owlapi .model .OWLOntology ;
1919import org .semanticweb .owlapi .model .OWLOntologyCreationException ;
2020import org .springframework .beans .factory .annotation .Autowired ;
21+ import org .springframework .beans .factory .annotation .Value ;
2122import org .springframework .context .ApplicationContext ;
2223import org .springframework .web .bind .annotation .PathVariable ;
2324import org .springframework .web .bind .annotation .RequestMapping ;
@@ -39,6 +40,9 @@ public class GeneratorController {
3940 public static final String ONTOLOGY_PATH_WITHOUT_SLASH = "ontology" ;
4041 public static final String ONTOLOGY_PATH = ONTOLOGY_PATH_WITHOUT_SLASH + "/" ;
4142
43+ @ Value ("${ontobench.version}" )
44+ private String version ;
45+
4246 private ApplicationContext applicationContext ;
4347 private FeatureParameterMapping featureMapping ;
4448 private StoredGenerationRepository repository ;
@@ -107,32 +111,37 @@ public OWLOntology ontologyFromIdWithFilename(HttpServletResponse response, @Pat
107111 }
108112
109113
110- @ RequestMapping ("/ features" )
114+ @ RequestMapping ("features" )
111115 public List <FeatureDto > features () {
112116 List <Feature > features = featureMapping .getAll ();
113117
114118 return features .stream ().map (FeatureDto ::new ).collect (Collectors .toList ());
115119 }
116120
117- @ RequestMapping ("/ formats" )
121+ @ RequestMapping ("formats" )
118122 public List <FormatDto > formats () {
119123 List <OntologySyntax > syntaxes = Arrays .asList (OntologySyntax .values ());
120124
121125 return syntaxes .stream ().map (FormatDto ::new ).collect (Collectors .toList ());
122126 }
123127
124- @ RequestMapping ("/ categories" )
128+ @ RequestMapping ("categories" )
125129 public List <FeatureCategoryDto > categories () {
126130 List <FeatureCategory > categories = Arrays .asList (FeatureCategory .values ());
127131
128132 return categories .stream ().map (FeatureCategoryDto ::new ).collect (Collectors .toList ());
129133 }
130134
131- @ RequestMapping ("/ presets" )
135+ @ RequestMapping ("presets" )
132136 public List <PresetDto > presets () {
133137 Collection <Preset > presets = applicationContext .getBeansOfType (Preset .class ).values ();
134138
135139 return presets .stream ().map (PresetDto ::new ).collect (Collectors .toList ());
136140 }
137141
142+ @ RequestMapping ("version" )
143+ public String version () {
144+ return version ;
145+ }
146+
138147}
0 commit comments