/** * It returns the list of recipes whose descriptions match the string passed in the description parameter.<br> * If some recipe matches the description passed a 200 code with the list of recipes is returned. * Otherwise a 404 status code is returned. * * @param description * {@link String} * @return <ul> * <li>200: The list of recipe matching the description provided is returned</li> * <li>404: No recipe matches the description provided</li> * </ul> */ @GET @Produces(value = {MediaType.APPLICATION_JSON, KRFormat.RDF_XML, KRFormat.TURTLE, KRFormat.OWL_XML, KRFormat.RDF_JSON, KRFormat.FUNCTIONAL_OWL, KRFormat.MANCHESTER_OWL, MediaType.TEXT_PLAIN}) @Path("/find/recipes") public Response findRecipes(@QueryParam("description") String description) { log.info("Searching for recipes with description like to {}.", description); RecipeList recipes = ruleStore.findRecipesByDescription(description); log.info("The recipe list is emplty? {} ", recipes.isEmpty()); if (recipes.isEmpty()) { return Response.status(Status.NOT_FOUND).build(); } return Response.ok(recipes).build(); }