|
17 | 17 | import java.net.http.HttpResponse.BodyHandlers; |
18 | 18 | import java.nio.charset.StandardCharsets; |
19 | 19 | import java.time.Duration; |
20 | | -import java.time.Instant; |
21 | 20 | import java.util.ArrayList; |
22 | | -import java.util.Comparator; |
23 | 21 | import java.util.List; |
24 | 22 | import java.util.Objects; |
25 | 23 | import java.util.Optional; |
26 | | -import java.util.stream.Collectors; |
27 | 24 | import life.qbic.logging.api.Logger; |
28 | 25 | import life.qbic.projectmanagement.application.ontology.LookupException; |
29 | 26 | import life.qbic.projectmanagement.application.ontology.OntologyClass; |
@@ -243,7 +240,8 @@ private List<TibTerm> fullSearch(String searchTerm, int offset, int limit) |
243 | 240 | searchTerm, |
244 | 241 | StandardCharsets.UTF_8) |
245 | 242 | + "&rows=" + limit + "&start=" + offset |
246 | | - + "&ontology=" + createOntologyFilterQueryParameter())) |
| 243 | + + "&ontology=" + createOntologyFilterQueryParameter() |
| 244 | + + "&type=class")) |
247 | 245 | .header("Content-Type", "application/json").GET().build(); |
248 | 246 | var response = HTTP_CLIENT.send(termSelectQuery, BodyHandlers.ofString()); |
249 | 247 | return parseResponse(response).stream().toList(); |
@@ -273,7 +271,8 @@ private List<TibTerm> select(String searchTerm, int offset, int limit) |
273 | 271 | selectEndpointAbsoluteUrl.toString() + |
274 | 272 | "?q=" + URLEncoder.encode(searchTerm, StandardCharsets.UTF_8) + "&rows=" |
275 | 273 | + limit + "&start=" + offset + "&ontology=" |
276 | | - + createOntologyFilterQueryParameter())) |
| 274 | + + createOntologyFilterQueryParameter() |
| 275 | + + "&type=class")) |
277 | 276 | .header("Content-Type", "application/json").GET().build(); |
278 | 277 | var response = HTTP_CLIENT.send(termSelectQuery, BodyHandlers.ofString()); |
279 | 278 | return parseResponse(response).stream().toList(); |
@@ -304,7 +303,8 @@ private List<TibTerm> searchByOboId(String oboId, int offset, int limit) |
304 | 303 | oboId.replace("_", ":"), StandardCharsets.UTF_8) |
305 | 304 | + "&queryFields=obo_id" |
306 | 305 | + "&rows=" + limit + "&start=" + offset |
307 | | - + "&ontology=" + createOntologyFilterQueryParameter())) |
| 306 | + + "&ontology=" + createOntologyFilterQueryParameter() |
| 307 | + + "&type=class")) |
308 | 308 | .header("Content-Type", "application/json").GET().build(); |
309 | 309 | var response = HTTP_CLIENT.send(termSelectQuery, BodyHandlers.ofString()); |
310 | 310 | return parseResponse(response); |
@@ -333,7 +333,8 @@ private Optional<TibTerm> searchByOboIdExact(String oboId) |
333 | 333 | oboId.replace("_", ":"), StandardCharsets.UTF_8) |
334 | 334 | + "&queryFields=obo_id" |
335 | 335 | + "&exact=true" |
336 | | - + "&ontology=" + createOntologyFilterQueryParameter())) |
| 336 | + + "&ontology=" + createOntologyFilterQueryParameter() |
| 337 | + + "&type=class")) |
337 | 338 | .header("Content-Type", "application/json").GET().build(); |
338 | 339 | var response = HTTP_CLIENT.send(termSelectQuery, BodyHandlers.ofString()); |
339 | 340 | log.debug("Received response code '%d' for term query %s".formatted(response.statusCode(), oboId)); |
|
0 commit comments