diff --git a/README.md b/README.md index bf4361d..2930126 100644 --- a/README.md +++ b/README.md @@ -49,18 +49,10 @@ dashboard. ```bash export GATEWAY_PUBLIC_IP=52.53.186.26 -# healthcheck -curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ - --data name=wilhelm-ws-healthcheck \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/data/healthcheck" -curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-healthcheck/routes \ - --data "paths[]=/wilhelm/healthcheck" \ - --data name=wilhelm-ws-healthcheck - -# language paged +# vocabulary paged & count curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ --data name=wilhelm-ws-languages \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/data/languages" + --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/neo4j/languages" curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-languages/routes \ --data "paths[]=/wilhelm/languages" \ --data name=wilhelm-ws-languages @@ -68,7 +60,7 @@ curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-languages # expand curl -v -i -s -k -X POST https://api.paion-data.dev:8444/services \ --data name=wilhelm-ws-expand \ - --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/data/expand" + --data url="http://${GATEWAY_PUBLIC_IP}:8080/v1/neo4j/expand" curl -i -k -X POST https://api.paion-data.dev:8444/services/wilhelm-ws-expand/routes \ --data "paths[]=/wilhelm/expand" \ --data name=wilhelm-ws-expand diff --git a/src/main/java/org/qubitpi/wilhelm/web/endpoints/Neo4JServlet.java b/src/main/java/org/qubitpi/wilhelm/web/endpoints/Neo4JServlet.java index 66d4641..c0c6c31 100644 --- a/src/main/java/org/qubitpi/wilhelm/web/endpoints/Neo4JServlet.java +++ b/src/main/java/org/qubitpi/wilhelm/web/endpoints/Neo4JServlet.java @@ -59,7 +59,7 @@ @Singleton @Immutable @ThreadSafe -@Path("/data") +@Path("/neo4j") @Produces(MediaType.APPLICATION_JSON) public class Neo4JServlet { @@ -78,19 +78,6 @@ public Neo4JServlet() { // intentionally left blank } - /** - * A webservice sanity-check endpoint. - * - * @return 200 OK response - */ - @GET - @Path("/healthcheck") - public Response healthcheck() { - return Response - .status(Response.Status.OK) - .build(); - } - /** * Returns the total number of terms of a specified langauges. * @@ -177,13 +164,13 @@ public Response expand(@NotNull @PathParam("word") final String word) { * @return a JSON representation of the expanded sub-graph */ @GET - @Path("/expandBfs/{word}") + @Path("/expandDfs/{word}") @Produces(MediaType.APPLICATION_JSON) @SuppressWarnings("MultipleStringLiterals") - public Response expandBfs(@NotNull @PathParam("word") final String word) { + public Response expandDfs(@NotNull @PathParam("word") final String word) { return Response .status(Response.Status.OK) - .entity(expandBfs(word, new HashSet<>())) + .entity(expandDfs(word, new HashSet<>())) .build(); } @@ -196,7 +183,7 @@ public Response expandBfs(@NotNull @PathParam("word") final String word) { * * @return the expanded sub-graph */ - private Graph expandBfs(@NotNull final String label, @NotNull final Set visited) { + private Graph expandDfs(@NotNull final String label, @NotNull final Set visited) { if (visited.contains(label)) { return Graph.emptyGraph(); } @@ -212,7 +199,7 @@ private Graph expandBfs(@NotNull final String label, @NotNull final Set return new IllegalArgumentException(message); }); return oneHopExpand.getUndirectedNeighborsOf(wordNode).stream() - .map(neighbor -> expandBfs(neighbor.getLabel(), visited)) + .map(neighbor -> expandDfs(neighbor.getLabel(), visited)) .reduce(oneHopExpand, Graph::merge); }